Sandbox testing Receipt validation without Inapp purchase

My product does not have any inapp purchases.All i want to check is that if the user has purchased the app from the app store as i cant implement my own licensing scheme. I have seen many examples on receipt validation to achieve the same,All these tutorials are based on inapp purchases. Does apple provide a receipt when the user purchases the app from the app store? If yes,how can i sandbox test it?

You have seen this one?

https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateLocally.html


Yes, Apple provides a receipt if someone downlods your app from the appstore. You can validate it locally or validate it with the appstore. For Testing you need a sandbox tester account.


Greetings

Brigitte

Checking in-app purchases is a three step process:

  1. Get the receipt.

  2. Check the validity of the receipt.

  3. Check the contents of the receipt.

If you just want to check your app, you can skip step 3. Thus, my advice would be to pick your favourite tutorial and stop at that point.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks for your reply.I have looked at local validation.Seems quite complex to implement as there are not much examples.If there are some SWIFT examples could you please point me in the right direction.Currently i have implemented Server validation.

Thanks for your response.

I added a sandbox user, fetched a new receipt using SKReceiptRequest after signing in as the sandbox user from the App.

I added validation code to get the receipt using the sandbox URL and i got the receipt as JSON.


I have 2 questions

  1. If the user Copy the AppBundle along with the receipt to another machine,will the receipt validation work?
  2. Should i replace the Sandbox URL with the Production server URL when i submit the app to app store for approval?

Please advice


If the user Copy the AppBundle along with the receipt to another machine, will the receipt validation work?

No. The receipt includes information about the machine and that is invalidated when you copy the app between machines.

Should i replace the Sandbox URL with the Production server URL when i submit the app to app store for approval?

I can’t answer this, alas. I’m going to move your thread over to System Frameworks > In-App Purchase, where you’re more likely to encounter someone with relevant experience.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

okay... Thanks

Sandbox testing Receipt validation without Inapp purchase
 
 
Q