in app purchase - Persisting a Receipt in iCloud using CloudKit in iOS -
#1
i'm developing ios app non-renewing subscription in it. want make subscription available on of user’s devices , let users restore purchase.
as said in apple's docs:
for non-renewing subscriptions, use icloud or own server keep persistent record.
i not use own server because app available ios now. icloud seems easer solution.
after watching , reading lot of wwdc videos , docs icloud seems best solution me cloudkit because key-value storage limited 1mb , have big chances total data size bigger per 1 user (after year of different purchases ex.).
question is: am right far?
#2
i'm using rmstore library purchases. said in docs rmstore doesn't have reference implementation of transaction persistence icloud , couldn't find examples in internet i'll have own scratch.
the first problem staring me in face is: what if there problem syncing receipt icloud after user has purchased subscription? example: user bought subscription, got error syncing icloud, closed app , that's it. is real scenario? non-renewing subscriptions receipt not stored anywhere apple responsible delivering , saving user. should save receipt in nsuserdefaults
or in keychain after transaction finished able compare synced data local 1 next time user launches app? or maybe should not 'finish transaction' until receipt synced? not find guides apple this...
#3
the next obvious question is: can user clear app's icloud private storage? can user somehow delete stored in icloud receipt thereby deleting information purchases? if yes - how should handle it? if scenario real have no way recover purchase , open app's functionality him until buys subscription again.
thank in advance.
cloudkit not limited 1mb. record limited. if have more 1mb of data in record, should consider refactor. if it's sort of data blob, should save in ckasset. limitations higher.
syncing problem no matter technique use. 1 way improve on registering begin purchase flag, purchase , after set purchased flag. if record stays in 'begin purchase' state know went wrong , can check app store if purchase successful.
you should add restore purchases function app
Comments
Post a Comment