微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

我的离子应用程序在iOS 13上的cordova j3k0 / cordova-plugin-purchase失败

如何解决我的离子应用程序在iOS 13上的cordova j3k0 / cordova-plugin-purchase失败

我在App Store上有几个现有应用程序,我试图添加一个应用程序,但是由于应用程序内购买问题,我的应用程序一直被Apple拒绝。我尚未更改inapp购买代码,因此不确定可能出了什么问题。我没有Mac,因为我在云上构建事物。因此,想向社区寻求指导。请在下面找到我观察到的内容

  1. 我知道您无法在模拟器上测试inapp购买。但是,模拟器可以很好地显示商店数据。换句话说,应在iTunes一侧将inapp设置为OK。
  2. 在iOS 11上,购买会弹出一个窗口供用户登录。但是,在iOS 13上,它会直接通过"Cannot connect to the itunes store"消息失败。因此,我认为问题可能与iOS13有关,或者我应该做一些处理iOS 13的事情。 Apple在iOS13上测试了我的应用程序,而我以前的应用程序过去曾被批准过,可能在iOS11上得到了批准。此外,苹果的拒绝也表明了相同的错误消息。
  3. iOS13上,我还在日志中看到以下错误
Found nil parameter when creating SKPaymentdiscount

下面是我的代码的基本结构:

在应用初始化时,我调用了以下方法

  configurePurchasing() {
      try {                          
          this.iapStore.register({
              id: this.productId,alias: this.productAlias,type: this.iapStore.CONSUMABLE
          });
              
          this.iapStore.when(productId).approved((product) => {
              product.finish();
              
              // Purchase is completed         
          });           

          this.iapStore.when(productId).updated((product) => {
              this.renderProductInfo();                    
          });

          this.iapStore.when(productId).cancelled((product) => {
              // Show purchase cancelled message   
          });
             
          this.iapStore.error((err) => {
              // Show error message
          });

          this.iapStore.ready((status) => {                    
              this.renderProductInfo();                    
          });

          this.iapStore.when(productId).error((err) => {
              // Show error message
          });                
          
          this.iapStore.refresh();            
      }
      catch (err) {
      }
  }

  renderProductInfo() {
    try {                  
        let product = this.iapStore.get(this.productId);        

        if (!product) {                    
          // Show error message       
        }
        else if (product.state === this.iapStore.INVALID) {
          // Show error message             
        }                
        else if (product.state === this.iapStore.VALID) {
            // Product loaded and valid.
            if (this.storeInfoLoadedFlag == false) {              
              this.title = product.title;
              this.price = product.price;
              this.description = product.description;                             
            }
            else if (this.purchaseErrorFlag) {
          // Show error message       
            }
            else if (this.purchaseCancelledFlag) {                        
          // Show cancel message
            }                         
        }                            
    }
    catch (e) {
    }
  }

以下是我的购买方式:

  purchaseLives() {
      try {                        
          productId = this.productId;
          this.iapStore.get(productId);              
          this.iapStore.order(productId);
          
      }
      catch (err) {
      }
  }  

如果能提供任何指针,我将不胜感激,因为我没有Mac可以在真实设备上测试代码

谢谢

道格

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。