storekit

Restoring an in app purchase with a user who never paid for it

。_饼干妹妹 提交于 2019-12-03 14:34:54
I'm trying to test the in app purchase in my app. When i restore the in app purchase with a test user who bought the in app purchase it all works fine. But when i try to restore an in app purchase with a user who didn't make the in app purchase before i expected the framework to call the following method: -paymentQueue:restoreCompletedTransactionsFailedWithError: but instead the framework calls: -paymentQueueRestoreCompletedTransactionsFinished: like my test user already bought the in app purchase.... Is this the normal behavior? And if so, how do i test a user trying to restore without ever

Already purchased subscriptions in StoreKit

…衆ロ難τιáo~ 提交于 2019-12-03 13:18:05
I am using renewable subscriptions in app purchases in an iOS app. When a user attempts to purchase a subscription that they already have paid for a message is displayed from iTunes "You're currently subscribed to this". How I can detect when this event has occurred so that I can process the transaction and grant access to my app. In the paymentQueue:updatedTransactions: method of the observer it is coming through as a SKPaymentTransactionStateFailed. How do I distinguish between this type of failure and other failures such as the user pressing the cancel buttons? Do I submit the transaction

SSErrorDomain, SKReceiptRefreshRequest, SKRequest did fail with error, code = 16, code = 110

雨燕双飞 提交于 2019-12-03 13:07:28
iOS 9.2.1, Xcode 7.2.1, ARC enabled I am using the following method to check for failures of SKProductsRequest and SKReceiptRefreshRequest : - (void)request:(SKRequest *)request didFailWithError:(NSError *)error { NSLog(@"error: %@", error); } My question is specifically about SKReceiptRefreshRequest . I am testing for two conditions, (1) when the user cancels the sign-in to iTunes Store for the receipt request and (2) when the user tries to sign-in and there is no connection (Air Plane Mode). I get the following errors: When there is no connection: Error Domain=SSErrorDomain Code=110 "Cannot

In-App-Purchase takes too long time to show confirmation alert view

流过昼夜 提交于 2019-12-03 12:47:37
I have encountered the following issue: when my app runs on a device and I tap BUY button, which triggers In-App-Purchase mechanism it takes up to ten seconds to show the standard confirmation UIAlertView , the one which says: "Do you want to buy...". I have never seen such a behaviour before. Usually it happens immediately. So first I thought it might be due to poor internet connection or something like this, but the simulator uses the same WiFi network and it works perfectly, the alert view is presented instantly as it should be. So the problem probably lies somewhere else. Did anyone solve

iOS In-App Purchases: Sandbox Invalid Product ID

余生长醉 提交于 2019-12-03 12:44:18
Background on the slightly odd setup before I get to the problem: Working on an app for a client and we're using an different iTunes developer account than the one this will eventually be published on for development and Ad-Hoc builds of an app that has Game Center and IAP integration. Obviously, we'll eventually have to duplicate our setup on the final release account, but the issue seems to be unrelated. The issue is trying to test In-App Purchases in the sandbox. We do not have any Tax/Banking info in the interim account, it was not set up in my name so I can't just add mine. Right now,

Handle cancelled IAP transactions

前提是你 提交于 2019-12-03 12:42:57
I'm using StoreKit for in-app purchases. I'm finding that the API is quirky in its behavior when the user presses the "Cancel" button. For example, if I push Cancel on the "Confirm Your In App Purchase" screen, I get a SKPaymentTransactionStateFailed transaction with error.code == SKErrorPaymentCancelled as I'd expect. But if I push Buy and then press Cancel, I get a Failed transaction with error.code == 0 . The error.localizedDescription is "Cannot connect to iTunes Store" which is clearly a lie. It's tempting to treat all Failed transactions as ignorable cancellations, but I can also clearly

NSLocale currency symbol, show before or after amount value

こ雲淡風輕ζ 提交于 2019-12-03 11:37:56
I am using StoreKit to implement an in app purchase store in my application. I have a custom design and it means that the value of the price should be white and large, and the currency symbol smaller, darker and aligned to the top of the price value. I can get the currency symbol without any problems by using the NSLocale in SKproduct 's priceLocale property, and the value of the price in the price property. My problem is knowing when I should put the currency symbol before the price and when to put it after the price. Examples: $5,99 0,79€ I could easily use the NSNumberFormatter to get this

When should i validate in-app purchase transaction receipt?

点点圈 提交于 2019-12-03 11:13:23
问题 I mean, should my steps be? 1) Get SKPaymentTransactionStatePurchased 2) Remove it from SKPaymentQueue and provide the content by [[SKPaymentQueue defaultQueue] finishTransaction: transaction]; 3) Validate the receipt and then, if it's invalid, block the content i've just provided Or should i change 2nd step to 3rd instead? 1) Get SKPaymentTransactionStatePurchased 2) Validate the receipt and then, if it's invalid, dont't provide content 3) Remove it from SKPaymentQueue anyway [

How to restore non-renewing Apple subscriptions

旧时模样 提交于 2019-12-03 09:36:41
问题 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

Refreshing iOS app receipt: How to determine if user will need to sign in for app store?

我与影子孤独终老i 提交于 2019-12-03 09:19:11
问题 I am implemeting Apple's "Grand unified receipt" on iOS 7, which allows the app to check an app's purchase receipt locally without having to contact Apple's servers for validation & verification. This works great if the user has a receipt stored in the app. Iin the case that the app is missing the receipt, the best practice is to request the app to refresh its receipt, as such: SKReceiptRefreshRequest *request = [[SKReceiptRefreshRequest alloc] init]; [request setDelegate:self]; [request