简体   繁体   中英

In-App Purchase doesn't send SKPaymentCancelled when cancelling from login UIAlertView

I am writing an application that uses in-app purchase. It is currently able to retrieve product id's and I can successfully test the in-app purchase through to completion.

The problem I am having is the error handling. What I wanted to do was display a UIAlertView when the transaction fails as long as it is not failing by SKPaymentCancelled, in which case it will just default back to a normal condition before the purchase. The problem is if I click on my Buy It Now button and then click OK to make the purchase, the store asks for my username and password. If I click cancel at that point, it is not sending SKPaymentCancelled. Instead it will display my UIAlertView which means it does not treat this as a cancelled payment. I am wondering how I should handle this condition as I don't want an alert to pop up if the user cancels, even at the login screen.

Thanks.

Are you accidentally trying to use a LIVE iTunes account rather than a test account? I've just tried that in my current project while using the sandbox, and you get SKErrorUnknown when you cancel at that point if you are using a LIVE account by mistake.

Equally it could be the sandbox playing up - I've lost track of how much downtime in a project is caused by sandbox 'temporary' issues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM