When submitting an app, reviewers are aware that they are using the In App Purchase in Sandbox environment.
Therefore, we recognize that when processing an app to run the App Store Server API from the app, the production App Store Server API must be run, and if it is a failure, the Snadbox API must be run. As follows.
https://developer.apple.com/documentation/appstoreserverapi#3820693
This would result in two http communications, so is there any more efficient way to do this?
Post
Replies
Boosts
Views
Activity
We are currently implementing in-app purchases with auto-renewing subscriptions.
If an AccountNotFoundError is returned from the App Store Server API, is it correct for the app to stop the service offered with that subscription?
The documentation does not go into detail, so I am just checking to be sure.
https://developer.apple.com/documentation/appstoreserverapi/accountnotfounderror
We are wondering if it is possible to distinguish between purchases made through our app and those made directly from the App Store in the subscription process.
Does the API information such as Server notifications v2 and Get All Subscription Statuses contain information that can distinguish between these cases?
If not, we are thinking of using the appAccountToken included in JWSTransaction to distinguish between them.
We are aware that appAccountToken is set when an appAccountToken or applicationUsername is given to an app when purchasing a subscription.
Therefore, we believe that the appAccountToken of JWSTransaction is not set when you purchase a subscription directly from the App Store.
We think that by setting the appAccountToken for purchases made through our app, we can distinguish whether the subscription was purchased directly from the App Store or not, but is this an appropriate way to do so?
Please let us know if there is a case where the appAccountToken is set even if the subscription was purchased directly from the App Store.
https://developer.apple.com/documentation/appstoreserverapi/appaccounttoken
According to the following document, when the AppStore Server API is executed and the account does not exist, the response "errorCode: 4040001" is returned.
If this response is returned, is it safe to assume that the account has been deleted and treat the subscription as cancelled?
Also, please let us know if there are any other error codes other than this error code that can be used to determine that the subscription has been cancelled.
https://developer.apple.com/documentation/appstoreserverapi/accountnotfounderror
**Question 1: **
Will ServerNotificationV2 be able to provide real-time notifications regarding Storekit1 contract renewals, and is receiving Storekit1 notifications in ServerNotificationV2 an expected use? (The documentation does not say that receiving Storekit1 notifications is not recommended, so we would like to confirm Apple's assumption.)
**Question 2: **
If ServerNotificationV2 is not able to receive Storekit1 notifications in real time, what is the expected time lag?
When retrieving Sales and Trends Report via AppStoreConnectAPI, occasionally get a 401 error.
The following is the error.
""errors"": [{
""status"": ""401"",
""code"": ""NOT_AUTHORIZED"",
""title"": ""Authentication credentials are missing or invalid."",
""detail"": ""Provide a properly configured and signed bearer token, and make sure that it has not expired. Learn more about Generating Tokens for API Requests https://developer.apple.com/go/?id=api-generating-tokens""
}]
It appears as if the JWT token was rejected, but the execution after the next day has been completed normally.
Also, the validity time for JWT token creation is set to 20 minutes, and the 401 error occurred about 3 minutes after the start of processing, so we do not think it is due to processing delays.
Please allow me to confirm the following.
Are there any conditions under which the JWT token is disabled by Apple?
If so, what can we do about it?
A similar issue has been raised in a Fastlane Issue, and they have responded by getting the JWT back for now. Is this solution correct?
https://github.com/fastlane/fastlane/issues/19072
https://github.com/SwiftyMike/fastlane/pull/1/files