无法在android中显示应用内购买产品数据

无法在android中显示应用内购买产品数据,android,in-app-purchase,cordova-plugins,google-developers-console,Android,In App Purchase,Cordova Plugins,Google Developers Console,到目前为止,我能够接收iOS设备的产品信息,但无法接收Android 以下是我在组件模块中的代码: registerProduct(){ this.inAppPurchase.verbosity=this.inAppPurchase.DEBUG; 此文件为.inAppPurchase.register({ id:'android.prod', 类型:this.inAppPurchase.NON_耗材 }); this.registerHandlersForPurchase('android.p

到目前为止,我能够接收iOS设备的产品信息,但无法接收Android

以下是我在组件模块中的代码:

registerProduct(){
this.inAppPurchase.verbosity=this.inAppPurchase.DEBUG;
此文件为.inAppPurchase.register({
id:'android.prod',
类型:this.inAppPurchase.NON_耗材
});
this.registerHandlersForPurchase('android.prod');
此参数为.inAppPurchase.refresh();
}
registerHandlersForPurchase(产品ID){
const self=this.inAppPurchase;
此.inAppPurchase.when(productId).updated((产品)=>{
if(product.loaded&&product.valid&&product.state==self.APPROVED&&product.transaction!=null){
product.finish();
}
});
此.inAppPurchase.when(productId).registered((产品:IAPProduct)=>{
//警报(`owned${product.owned}`);
});
此.inAppPurchase.when(productId).owned((产品:IAPProduct)=>{
//警报(`owned${product.owned}`);
product.finish();
});
此.inAppPurchase.when(productId).approved((产品:IAPProduct)=>{
//警报(“批准”);
product.finish();
});
此.inAppPurchase.when(productId).退款((产品:IAPProduct)=>{
//警报(“退款”);
});
此.inAppPurchase.when(productId).expired((产品:IAPProduct)=>{
//警报(“过期”);
});

}
您可以在Google Play Console(新)中的Monetization Setup>Licensing(货币化设置>许可)下找到Android计费键,从“miibxxxxxxxxxxxx”开始

您还需要在终端中运行命令ionic cordova plugin add cc.fovea.cordova.purchase--variable BILLING_KEY=“miibxxxxxxxxx(您自己的计费密钥)”