SKPaymentQueue addTransactionObserver asking for App Store password on startup after in-app purchase

后端 未结 14 1186
耶瑟儿~
耶瑟儿~ 2020-12-01 04:46

My app is using in-app purchases, and most of my users can purchase just fine without any problems. For these folks, my app downloads the content after the purchase succeeds

14条回答
  •  庸人自扰
    2020-12-01 05:26

    You said:

    However, for a growing number of my users, once they complete a successful in-app purchase they are being asked for their App Store password every time the app starts up after that. I believe this is happening on the call to:

    [[SKPaymentQueue defaultQueue] addTransactionObserver:observer];

    Note that the docs for add(_ observer: / addTransationObserver: state that the call may cause the user to authenticate with the App Store, so this appears to be expected behavior.

    // Observers are not retained. The transactions array will only be synchronized with the server while the queue has observers. This may require that the user authenticate.

    open func add(_ observer: SKPaymentTransactionObserver)
    open func remove(_ observer: SKPaymentTransactionObserver)

    So in addition to other answers here, it may be that you should stop calling add observer until you are ready to potentially display an App Store login prompt.

提交回复
热议问题