Automatic renewal of subscription and receipt of application

I want to know when and when an application receipt is automatically renewed, when an IAP auto-service subscription is automatically renewed. The documentation implies that the receipt of the application is updated upon purchase (update?), But I do not see this behavior in the IAP sandbox:

Information on consumed products and non-renewable subscriptions is added to the receipt when they are paid and remain in until receipt of the transaction. After you complete the transaction, this information is deleted the next time it is updated, for example, the next time the user makes a purchase.

Information about all other types of purchases is added to the receipt when they are paid and remain in the receipt for an indefinite period.

In addition, the documents indicate:

After a successful subscription renewal, the Store Kit adds a transaction to resume the transaction queue. Validating your application is a transactional queue at startup and processes the update in the same way as any other transaction. Please note that if your application is already running when the subscription resumes, the transaction observer is not called; your application will know about the update the next time it is launched.

For me, this means that I can control SKPaymentQueue for completed transactions, and then check the receipt of the application to find their record. But I do not see this in practice in the IAP sandbox. In the IAP sandbox, I have an automatic renewal of the subscription, which is automatically renewed (6 times per user / purchase, the usual behavior of the sandbox) , but to open the update I need to manually update the application receipt .

Assuming all of this works as I expect, are there better testing methods in the IAP sandbox to trigger this behavior?

+7
ios in-app-purchase
source share
1 answer

As an additional note, the documentation is not compatible with the types of purchases and their storage in the receipt - see my answer to this question.

Receipt is updated on the server side when automatic updating is ticking - you can confirm this by checking the call using the validateReceipt method on the server side.

UPDATE: Seeing that you are using RMStore, I made fun of something so that I can look at the behavior.

It seems to me that updating the client side updated. My scenario: monthly to monthly subscription (so 5 minutes of updates in the sandbox). I put the diagnostic code in viewDidLoad :

 RMAppReceipt *receipt = [RMAppReceipt bundleReceipt]; if (receipt != nil) { NSDateFormatter* localDateTime = [[NSDateFormatter alloc] init]; [localDateTime setTimeZone:[NSTimeZone timeZoneWithName:@"PST"]]; [localDateTime setDateFormat:@"yyyy.MM.dd HH:mm:ss zzz"]; for (RMAppReceiptIAP* purchase in receipt.inAppPurchases) { NSString* cancellationDate = nil; if (purchase.cancellationDate) { cancellationDate = [localDateTime stringFromDate:purchase.cancellationDate]; } NSLog(@"Transaction: %@: product %@, original purchase date: %@, expiration date: %@, cancellation date: %@", purchase.originalTransactionIdentifier, purchase.productIdentifier, [localDateTime stringFromDate:purchase.originalPurchaseDate], [localDateTime stringFromDate:purchase.subscriptionExpirationDate], cancellationDate); } 

I also set a breakpoint in RMStore paymentQueue:updatedTransactions: to find out if the queue is updated with subsequent AR purchases.

Then I bought one month of my test product, checked the transaction, and then left the application.

During subsequent recalls of the application at 5-minute intervals, I saw that the breakpoint in the SKPaymentTransactionObserver method was deleted using the transactionSate SKPaymentTransactionStatePurchased . The magazine showed consecutive additions of purchases (only the latest version):

 2015-05-27 14:27:32.828 StoreKitSandbox[5803:1054853] Transaction: 1000000156919353: product com.foo.StoreKitSandbox.1_month_autorenew_foo, original purchase date: 2015.05.27 14:02:59 GMT-7, expiration date: 2015.05.27 14:07:58 GMT-7, cancellation date: (null) 2015-05-27 14:27:33.350 StoreKitSandbox[5803:1054853] Transaction: 1000000156919353: product com.foo.StoreKitSandbox.1_month_autorenew_foo, original purchase date: 2015.05.27 14:06:02 GMT-7, expiration date: 2015.05.27 14:12:58 GMT-7, cancellation date: (null) 2015-05-27 14:27:33.774 StoreKitSandbox[5803:1054853] Transaction: 1000000156919353: product com.foo.StoreKitSandbox.1_month_autorenew_foo, original purchase date: 2015.05.27 14:11:07 GMT-7, expiration date: 2015.05.27 14:17:58 GMT-7, cancellation date: (null) 2015-05-27 14:27:34.174 StoreKitSandbox[5803:1054853] Transaction: 1000000156919353: product com.foo.StoreKitSandbox.1_month_autorenew_foo, original purchase date: 2015.05.27 14:16:00 GMT-7, expiration date: 2015.05.27 14:22:58 GMT-7, cancellation date: (null) 2015-05-27 14:27:34.637 StoreKitSandbox[5803:1054853] Transaction: 1000000156919353: product com.foo.StoreKitSandbox.1_month_autorenew_foo, original purchase date: 2015.05.27 14:21:04 GMT-7, expiration date: 2015.05.27 14:27:58 GMT-7, cancellation date: (null) 2015-05-27 14:27:35.069 StoreKitSandbox[5803:1054853] Transaction: 1000000156919353: product com.foo.StoreKitSandbox.1_month_autorenew_foo, original purchase date: 2015.05.27 14:26:15 GMT-7, expiration date: 2015.05.27 14:32:58 GMT-7, cancellation date: (null) 

Can you reproduce this diagnostic approach?

+4
source share

All Articles