문제

I have my (sandbox) In App Purchase working, but how do I determine if the app is busy communicating with the server? I am having a rough time getting my normal ActiviyIndicator to work in this setting, the app seems to go in and out of responsiveness throughout the process. Then if the user closes the screen before finishTransaction, they can get caught in a human made loop where they might never get their download, if they keep closing the screen before the download is done.

Any examples or suggestions would be appreciated.

도움이 되었습니까?

해결책

You should manage the communication by responding to the delegate method(s), and also implementing the SKPaymentTransactionObserver.

If the user closes the app before the transaction is completed, the process will/should be restored on the next time that the user opens the app.

Your application should associate an observer with the payment queue when it launches, rather than wait until the user attempts to purchase an item. Transactions are not lost when an application terminates. The next time the application launches, Store Kit resumes processing transactions. Adding the observer during your application’s initialization ensures that all transactions are returned to your application.

http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/MakingaPurchase/MakingaPurchase.html#//apple_ref/doc/uid/TP40008267-CH3-SW1

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top