It's seems to be very tricky to test in-app purchases of a macOS app. This is what I've done:
- Defining two products with prodict identifiers in iTunesConnnct. Theyx are ready for submission.
- Creating a new version of the app linked to a new build and the said products.
- Closing the additional contract with Apple in iTunesConnect.
- Creating a sandbox user in iTunesConnect.
- Implementing the in-app store.
- Logging out from the app store on my developer machine.
- Building the app and starting the app in finder. The debug log should be a confirmation of the developer mode.
- Testing retrieving product information in the app successtully.
In several tests, sometimes the popup für a login into the app store appears. Sometimes the message "sandbox environement" was shown, mostly not. Last time the additional message was shown, that the user was't allowed to buy in the US store and login would be redirected to the national store. After this, nothing returned from the payment queue. In further tests, the popup doesn't appear any more and the payment queue doesn't return any event, even not an error.
This is, what I've checked:
- I checked, that there is nothing in a non persistant cache by restarting my developer machine.
- I checked, that the sandbox user still exists.
- I chacked, that the product identifiers are still valid.
- I checked, that the sandbox container and preferences are deleted by an Autormator script.
- I chacked, that my developer machine is connected to the USA by VPN, to avoid the redirect, that seems to make problems.
- I chacked, that the projects target was cleaned and the app rebuild.
- I checked, that the bundle identifier and version is the same as the version n the app store, that is linked to the products.
I have no more ides. Can someone help? Is there a way to reset the application? Maybe I missed to delte any persisted cache or receipt.