Apple introduced Promoted In-App Purchases in iOS 11. Though I have implemented the new required SKPaymentTransactionObserver method, paymentQueue:shouldAddStorePayment:for:, I have not been able to successfully test "buying" an item. Should one be able to test and purchase in the Sandbox test environment?
Apple does discuss initiating testing through an URL of the form:
itms-services://?action=purchaseIntent&bundleId=com.example.app&productIdentifier=com.example.app.myIAP
I've put the URL in an email to myself. When I click on the URL, I get the following sequence:
1) Switches to MyApp, and shouldAddStorePayment is called with a product with my product identifier, com.example.app.myIAP (encouraging start)
2) Have paymentQueue:shouldAddStorePayment:for: return true.
3) paymentQueue:updatedTransactions: is called, with a transaction in the “purchasing” (but not purchased) state. It has a nil transactionIdentifier.
4) An alert pops up saying to Sign In. I sign in with a sandbox Apple ID - hitting the “Buy” button on the sign in alert.
5) Another pop up saying to Sign In. I sign in with a sandbox Apple ID - hitting the “Buy” button on the sign in alert.
6) paymentQueue:updatedTransactions: is called, with a transaction in the “failed” state. It has a non-nil transactionIdentifier.
Should the shouldAddStorePayment routine be doing something extra?