ios7 - Auto-Renewable In-App Purchases in iOS -
i stuck implementing iap app. here basic information on how works
- i offering one-year auto-renewable subscription service. user pay iap , they'll have access service.
- it should possible user purchase multiple subscriptions. possible (although unlikely) user want connect 2 different services, should able pay 2 subscriptions @ same time
that's basic idea, sounds pretty simple. have followed apple's instructions great success, until point paymentqueue:updatedtransactions
gets called skpaymenttransactionstatepurchased
state. here, several questions arise.
- apple's documentation shows should store
transaction.transactionreceipt
in nsuserdefaults. i'm storing array of these (since want support multiple, simultaneous subscriptions). problem has been deprecated in ios7, don't know use instead. - the next problem don't know data. once app killed , re-started, know size of array in nsuserdefaults (e.g. there 2 receipts, 2 subscriptions have been purchased). however, how can read data in receipt number verification on own server? how date range subscription valid? (i need block access once subscription no longer valid, assuming stop auto-renew , expires). have nsdata objects have no idea with.
thank help!
you have way go. purpose of saving transaction.transactionreceipt submit @ point in future apple servers. apple servers respond receipt sending latest receipt subscription. transaction.transactionreceipt deprecated, receipt onboard receipt:
nsurl *receipturl = [[nsbundle mainbundle] appstorereceipturl]; nsdata *receiptdata = [nsdata datawithcontentsofurl:receipturl];
and either decode (using openssl , other c++ stuff) or, once again, send apple servers decoding , responding.
an easier approach, , perhaps 1 more acceptable app review 'service', use non-renewing subscription. non-renewing subscriptions can overlap problem 2 services can handled app.
Comments
Post a Comment