简体   繁体   English

经常弹出窗口要求以生产模式登录iTunes Store

[英]Frequent Popup asking to sign in to iTunes Store in Production mode

Issue: Getting frequent popups asking to sign in to iTunes Store in both development and Production mode(Live version of app on App store). 问题:经常出现弹出窗口,要求以开发和生产模式(App Store上的应用程序实时版本)登录iTunes Store。 Popup occurs each time on app starts and asks for password frequent times, the below code is called each time on app start to check the subscription status and on particular subscription page. 每次在应用程序启动时都会弹出窗口,并频繁询问密码,每次在应用程序启动时都会调用以下代码,以检查订阅状态和特定的订阅页面。

Plugin Used : https://github.com/AlexDisler/cordova-plugin-inapppurchase 使用的插件: https : //github.com/AlexDisler/cordova-plugin-inapppurchase

Code / steps to reproduce 复制代码/步骤

On calling window.inAppPurchase.getReceipt() returns receipt in base64 string then to validate the receipt i call getlatestReceiptData() on node server, calling 'sandbox.itunes.apple.com/verifyReceipt' for sandbox mode and 'buy.itunes.apple.com/verifyReceipt' for production mode, then compare purchases to get the active purchase. 在调用window.inAppPurchase.getReceipt()时,以base64字符串返回收据,然后通过在节点服务器上调用getlatestReceiptData()来验证收据,对于沙盒模式和“ buy.itunes.apple”,调用“ sandbox.itunes.apple.com/verifyReceipt” .com / verifyReceipt”用于生产模式,然后比较购买次数以获取有效购买。

window.inAppPurchase.getReceipt().then(function (receipt) {
    getlatestReceiptData(receipt).then(function(latest_purchase){
            var timeStamp = Date.now();
               if (purchase && purchase.expires_date_ms && purchase.expires_date_ms > timeStamp) {
                            purchased = true;
                } else{ 
                           purchased = false;
               }
     });           
}).catch(function (error) {
    Utils.log(JSON.stringify(error), 'error');
    deferred.reject(error);
 });

Console output 控制台输出

Type of product - subscription 产品类型 -订阅

System Information: 系统信息:

Cordova CLI: 6.5.0 Ionic CLI Version: 2.2.3 Ionic App Lib Version: 2.2.1 ios-deploy version: 1.9.0 ios-sim version: 5.0.12 OS: OS X El Capitan Node Version: v7.0.0 Xcode version: Xcode 8.1 Build version 8B62 Cordova CLI:6.5.0 Ionic CLI版本:2.2.3 Ionic App Lib版本:2.2.1 ios-deploy版本:1.9.0 ios-sim版本:5.0.12 OS:OS X El Capitan节点版本:v7.0.0 Xcode版本:Xcode 8.1 Build版本8B62

Are you by any chance using SKReceiptRefreshRequest ? 您是否有机会使用SKReceiptRefreshRequest That would always trigger credential checks. 那总是会触发证书检查。

Refreshing the receipt asks the App Store for the latest copy of the receipt. 刷新收据会向App Store索要收据的最新副本。 Refreshing a receipt does not create any new transactions. 刷新收据不会创建任何新交易。 Although you should avoid refreshing multiple times in a row, this action would have same result as refreshing it just once. 尽管您应该避免连续刷新多次,但是此操作的效果与一次刷新相同。

Restoring purchases prompts for the user's App Store credentials, which interrupts the flow of your app: because of this, don't automatically restore purchases, especially not every time your app is launched. 恢复购买会提示您输入用户的App Store凭据,这会中断您的应用程序流:因此,不要自动恢复购买,尤其是不是在每次启动应用程序时。

 https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Restoring.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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