Trouble getting the original app version that the user installed (receipt validation)?

后端 未结 2 651
误落风尘
误落风尘 2021-02-03 13:05

I have an app that I recently updated to work with in app purchases. The previous version (paid but with no in app purchases) was 1.0 and the current version is 1.1.

As

2条回答
  •  清歌不尽
    2021-02-03 13:24

    It's been a while since this question was asked, but it raises some very important points:

    The original app version field in the receipt corresponds to CFBundleVersion, not CFBundleShortVersionString. In a sandbox (developer build) environment, the value string is always "1.0".

    Note that when converting from a paid app to freemium, if an original (paid version) user uninstalls the app, then reinstalls from iTunes, there will be no local receipt. Calling SKPaymentQueue restoreCompletedTransactions will not cause a new receipt to be downloaded if that user has never made an in-app purchase. In this situation, you need ask for a receipt refresh using SKReceiptRefreshRequest and not rely on restore functionality.

提交回复
热议问题