storekit

How to use requestReview (SKStore​Review​Controller) to show review popup in the current viewController after a random period of time

ⅰ亾dé卋堺 提交于 2019-12-03 07:46:07
问题 I've read about this new feature available in iOS 10.3 and thought it will be more flexible and out of the box. But after I read the docs I found out that you need to decide the time to show it and the viewController who calls it. Is there any way I can make it trigger after a random period of time in any viewController is showing at that moment? 回答1: In your AppDelegate: Swift: import StoreKit func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions:

Obj-C, Storekit restoreCompletedTransactions returns zero transactions?

旧时模样 提交于 2019-12-03 06:51:10
问题 I'm having some problems restoring completed transactions. [[SKPaymentQueue defaultQueue] restoreCompletedTransactions]; I've added the observer mentioned in several examples, I've tried adding paymentQueueRestoreCompletedTransactionsFinished and already have updatedTransactions . paymentQueueRestoreCompletedTransactionsFinished says I have zero transactions. I can buy a product and if I try to buy again, it stops me and says I've already bought the product, using this code. SKPayment

Unresolved Identifier - SKErrorPaymentCancelled [duplicate]

泄露秘密 提交于 2019-12-03 06:41:21
This question already has answers here : Use of unresolved identifier when using StoreKit constants with iOS 9.3/Xcode 7.3 (3 answers) I updated to the latest version of Xcode 7.3 with the release of iOS 9.3 & OSX 10.11.4 (inclusive of Swift 2.2) yesterday. When I build my app I get an error stating Use of unresolved identifier 'SKErrorPaymentCancelled' which I use to check if the user has cancelled a payment. I don't do anything special with it, just log it (as seen below). private func failedTransaction(transaction: SKPaymentTransaction) { print("failedTransaction...") if transaction.error!

Unable to finish unfinished transactions in payment queue

核能气质少年 提交于 2019-12-03 02:25:49
My application went to some odd state in IAP sandbox... Every time I launch application it is asking for password of particular test user. I guess due to unfinished transaction. I really want to finish that transaction, but it's not possible. Some background info and what I have done for it: I've deleted that test user from itunesconnect As soon as application launches I call [[SKPaymentQueue defaultQueue] addTransactionObserver:self] No payment queue update notification is received after I enter password for that particular test user, or hit cancel [SKPaymentQueue defaultQueue].transactions

How to restore non-renewing Apple subscriptions

柔情痞子 提交于 2019-12-02 23:56:55
The app I'm working on was recently rejected by Apple for containing an auto-renewable subscription. They recommended that we switch to non-renewing subscriptions for our content. The one thing I can't quite wrap my brain round is how to restore a purchased subscription to a shared device. Apple recommends we don't use user login - something we would like to avoid ourselves. I did come across one solution where unique codes were used between the two devices - to validate a purchased subscription, through a server. But I believe that could be easily pirated, as in theory friends or employees

Trouble getting the original app version that the user installed (receipt validation)?

∥☆過路亽.° 提交于 2019-12-02 22:52:50
I have an app that I recently updated to work with in app purchases. The previous version (paid but with no in app purchases) was 1.0 and the current version is 1.1. As the in app purchase essentially unlocks all features (which were included in the paid version 1.0), I wanted a way for users that had originally downloaded version 1.0 to be upgraded if they pressed my restore purchases button. To do this, I first try to restore purchases and if the response to: - (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue If this provides me with a queue with a transactions

How to use requestReview (SKStore​Review​Controller) to show review popup in the current viewController after a random period of time

老子叫甜甜 提交于 2019-12-02 20:28:35
I've read about this new feature available in iOS 10.3 and thought it will be more flexible and out of the box. But after I read the docs I found out that you need to decide the time to show it and the viewController who calls it. Is there any way I can make it trigger after a random period of time in any viewController is showing at that moment? Michael Sacks In your AppDelegate: Swift: import StoreKit func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { let shortestTime: UInt32 = 50 let longestTime:

Obj-C, Storekit restoreCompletedTransactions returns zero transactions?

↘锁芯ラ 提交于 2019-12-02 19:27:05
I'm having some problems restoring completed transactions. [[SKPaymentQueue defaultQueue] restoreCompletedTransactions]; I've added the observer mentioned in several examples, I've tried adding paymentQueueRestoreCompletedTransactionsFinished and already have updatedTransactions . paymentQueueRestoreCompletedTransactionsFinished says I have zero transactions. I can buy a product and if I try to buy again, it stops me and says I've already bought the product, using this code. SKPayment *payment = [SKPayment paymentWithProductIdentifier:productIdentifier]; [[SKPaymentQueue defaultQueue]

In app purchase for auto-renewable content prompts user to share information

喜夏-厌秋 提交于 2019-12-02 19:12:42
I am adding the ability to purchase auto-renewable content through the iOS SDK's StoreKit API. When testing this in the sandbox on my iOS device, the following message appears in an alert after agreeing to purchase: Share your Information? The publisher of [app name here] would like your name, email, and zip code for use in accordance with their privacy policy. With buttons for "Don't Allow" and "Allow" I don't want / need this information and don't want to annoy my users by prompting for it. However, I can't figure out how to disable this prompt to collect private information. Any tips are

Best practice to add a transaction queue observer at application launch for Storekit

 ̄綄美尐妖づ 提交于 2019-12-02 14:26:25
问题 I am having trouble trying to follow Apple's recommendation of adding a transaction queue observer in didFinishLaunchingWithOptions . Specifically I am trying to adapt code from a Ray Wenderlich tutorial which does not do this - it adds the observer only once the 'buy' button is tapped. My app crashes when the buyProduct function is called: public func buyProduct(_ product: SKProduct) { print("Buying \(product.productIdentifier)...") let payment = SKPayment(product: product) SKPaymentQueue