How can I check the user has preorder in production app when app is free and user who has purchased nothing?

Hello.

I has a plan to release the app with pre-order. And I want to give the user who has preorder to some reward. So I have research about preorder.

Related Doc:

The preorder_date receipt field helps you identify customers who pre-ordered your app. You can use this information to unlock rewards — such as additional coins in a game — for pre-order customers or display in-app messaging to thank them for their purchase.

preorder_date The time the user ordered the app available for pre-order, in a date-time format similar to ISO 8601.

Fetch the Receipt Data To retrieve the receipt data from the app on the device, use the appStoreReceiptURL method of NSBundle to locate the app’s receipt, and encode the data in Base64. Send this Base64-encoded data to your server.

I have read these doc and tested verifyReceipt API. Now I know how to verify receipt and how to check if whether preorder date is presented.

However, I cannot know the user has always receipt data. I have tested fetching the receipt data in Xcode and TestFlight when user is just installed first time. Result is fail and throw error like below:

appStoreReceiptUrlNotFound(url: "/private/var/mobile/Containers/Data/Application/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX/StoreKit/sandboxReceipt")

Unfortunately, I have not found yet how to test for fetching receipt data in preorder status.

Now I have question about preorder.

  1. If app is free and user has purchase nothing, can I fetch receipt data in production app?
  2. If the data cannot be fetched, should I wait the user purchasing something for checking preorder?

Or if someone know how to test this in preorder status, please let me know it.

Thanks for reading.

Answered by in 720993022

In response to your questions -

Q1. If iOS app is free and user has purchase nothing, can I fetch receipt data in production app? Response - A production app will be installed from the App Store - in which case there will always be an appStoreReceipt to check. In the pre-order case, you can validate the appStoreReceipt with the production verifyReceipt endpoint and there should be the preorder_date field for the preordered app.

There is presently no support for checking for a pre-ordered app in the sandbox. There is never an appStoreReceipt present for any iOS application installed via Xcode, TestFlight, nor in App Review.

I'd verify this functionality once the iOS application is released on the App Store.

Rich Kubota - Developer Technical Support

Accepted Answer

In response to your questions -

Q1. If iOS app is free and user has purchase nothing, can I fetch receipt data in production app? Response - A production app will be installed from the App Store - in which case there will always be an appStoreReceipt to check. In the pre-order case, you can validate the appStoreReceipt with the production verifyReceipt endpoint and there should be the preorder_date field for the preordered app.

There is presently no support for checking for a pre-ordered app in the sandbox. There is never an appStoreReceipt present for any iOS application installed via Xcode, TestFlight, nor in App Review.

I'd verify this functionality once the iOS application is released on the App Store.

Rich Kubota - Developer Technical Support

How can I check the user has preorder in production app when app is free and user who has purchased nothing?
 
 
Q