Open rebeloper opened 7 years ago
@rebeloper Perhaps you could try to call the fetchReceipt or verifyReceipt methods when the app starts?
Hey @rebeloper, any updates? I'm experiencing the same issue with my rejected app.
It looks like we need to validate purchases in Main. Now in objective c projects there is a Main.h file but I cannot reach the SwiftyStoreKit module. And in swift projects there is no Main file at all. Still looking for solutions...
Nailed it!
macOS applications should perform receipt validation immediately after launch. The apps should call exit with a status of 173 if validation fails as shown in Listing 1.
func applicationDidFinishLaunching(_ aNotification: Notification) {
// Test whether the app's receipt exists.
if let url = Bundle.main.appStoreReceiptURL, let _ = try? Data(contentsOf: url) {
// The receipt exists. Do something.
} else {
// Validation fails. The receipt does not exist.
exit(173)
}
}
https://developer.apple.com/library/content/technotes/tn2259/_index.html
Is the applicationDidFinishLaunchig function the place to call this? Apple docs say:
Perform receipt validation immediately after your app is launched, before displaying any user interface or spawning any child processes. Implement this check in the main function, before the NSApplicationMain function is called.
If so, than we could simply call verifyReceipt if it exists.
Yessir. Just used their code snippet and everything worked like a charm.
Thumds up @msamoylov This is my first macOS app after hundreds of iOS ones. Will submit my app soon and confirm this solution myself if the app gets approved.
Platform
In app purchase type
Environment
Version
0.11.0
Related issues
ℹ Please replace this with references to similar issues (either open or already closed).
Report
Issue summary
Apple wants that the app should validate receipt after immediately app launches.
What did you expect to happen
Apple Review Team Approve my submission.
What happened instead
The Apple Review Team Rejected my app with the following response:
The app should validate receipt after immediately app launches:
Any help on this is appreciated. Thank you.