Hello everyone, i’m need to implement InAppPurchase, but i not clear at all.
In my play store console, i’ve created two products that they are ‘premium subscriptions’ and in my app i have this code:
public paySubscription(subscription: any): void {
InAppPurchase
.buy(subscription.productId)
.then(data => InAppPurchase.consume(data.productType, data.receipt, data.signature))
.then(() => {
let prompt = this.alertCtrl.create({
title: 'Exito',
subTitle: 'Suscripcion adquerida!',
buttons: ['Aceptar']
});
prompt.present();
})
.catch( err => {
console.log(err);
let prompt = this.alertCtrl.create({
title: 'Error',
subTitle: err,
buttons: ['Aceptar']
});
prompt.present();
})
}
But, always i have an error, it go for the catch way and i see the message “Error Object object” and i can’t debug on my device.
Any example or something to do this? Maybe I’m doing it wrong
Than’s in advance!!
Ivan