iOS StoreKit - When to call - (void)restoreCompletedTransactions?

后端 未结 5 583
一个人的身影
一个人的身影 2021-01-11 23:41

I have lots of 1 time purchase IAPs inside of my application. Users can purchase them just fine.

My problem is that I am integrating with Flurry to track real purch

5条回答
  •  清歌不尽
    2021-01-12 00:10

    As far as i have observed, there are two possible cases where user may have to call restore purchase,

    1. If you are not maintaining purchase information in your backend server: you may loose purchase info if user uninstall the app or any such cases where app data is lost. In this case user may call restore and Storekit will give receipt of purchase again through which you can decide whether user had purchased earlier and whether that purchase is active now.

    2. If you are storing purchase information at your backed(backed api decides whether user is privileged of subscription feature) : there might be an case where you were able to purchase from Apple but somehow failed to update to your server, in this case user can restore purchase which willl update purchase info at your backend server, thereafter user can use app across multiple devices/platform/reinstall but still be entitled to have privileged access.

    Therefore it is always recommend to show restore option in the same page as purchase. If user unintentionally tries to purchase while having active subscription without opting to restore, 1.if he had selected same plan as of currently active onr, he will be informed about the existing and subscription 2.if he selects other plan apart from current subscription, he/she will be informed about current subscription as well as option to upgrade/downgrade as per latest selection of plan.

提交回复
热议问题