我想将inapp购买添加到我的ionic应用程序(用于ios)。我使用以下命令安装了插件和npm包:
ionic cordova plugin add cordova-plugin-inapppurchase
npm install --save @ionic-native/in-app-purchase
在我的代码中:
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
constructor(
private plateform: Platform,
private iap: InAppPurchase
) {
this.plateform.ready().then(() => {
this.iap.buy(PRODUCT_KEY).then((res) => {
console.log("Purchase completed!");
}).catch(err => console.log("Purchase Error!", err))
});
}
}
此代码返回错误:
Purchase Error! plugin_not_installed
.
我怎样才能解决这个问题?