Is it possible to associate a subscription with an iTunes account with a file in the application?

We are trying to introduce a subscription service with an in-app purchase in our application. The problem is that our service does not require a user account for the last year of service. Users simply use this service with the displayed ads. We want to give them a subscription where they can buy, say, 3 months to remove ads.

How can I do that? We must do this because it is a subscription. But we won’t know when the subscription will end.

  • We cannot save the state locally because the user can reinstall the application
  • We cannot save the state on the server and bind it to our device, because sometimes the user changes the device
  • We do not have a user account to associate a subscription, and we do not want to introduce a user account system that spoils the experience.

Is there a way to associate a purchase with their iTunes account? So that they are transferred with them when reinstalling or changing the device?

+3
source share
3 answers

How to link it to your Facebook or Twitter account? Then you turned “account creation” into a social network feature.

EDIT:

, , , . , , , , . , , , . GenericKeychain .

+1

, iTunesMetadata.plist, appleId, , .

[NSHomeDirectory() stringByAppendingPathComponent:@"iTunesMetadata.plist"]

, , Apple .

0

, IS iTunes. , , ( Apple iTunes).

" " apple ( ): http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/StoreKitGuide/MakingaPurchase/MakingaPurchase.html#//apple_ref/doc/uid/TP40008267-CH3-SW2

itunes " ?"

Then, when recovering transactions, you return a link to everything SKPaymentTransactionyou can request for transactionDate(as a property). This will give you the WHEN information that the user bought your supplies.

From it you can also get a product that was purchased with aPaymentTransaction.payment.productIdentifier

If you know that this product identifier is a 3-month subscription, you can compare the date of its transaction and the current date and check whether it is more than 3 months or not.

-1
source

Source: https://habr.com/ru/post/1737174/


All Articles