You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why does it work on Android but not on iOS? And what's the deal with being asked to purchase again when it's supposed to be a consumable purchase? Android is fine
#1560
Open
ulsoftnaver opened this issue
Apr 23, 2024
· 2 comments
Why does it work on Android but not on iOS? And what's the deal with being asked to purchase again when it's supposed to be a consumable purchase? Android is fine
import { Injectable } from '@angular/core';
import { Platform } from '@ionic/angular';
import 'cordova-plugin-purchase/www/store.d';
private approved1: any = (p: any) =>
{
var pay_id = p.nativePurchase['orderId'];
var id = p.nativePurchase['productId'];
var purchaseToken = p.nativePurchase['purchaseToken'];
const myProduct = this.ps.store.get(p.nativePurchase['productId']);
var price = myProduct.offers[0].pricingPhases[0].price;
var currency = myProduct.offers[0].pricingPhases[0].currency;
var platform = p.platform;
I use Cordova so I don't know if it's different with Capacitor / Ionic, but you should console.log your p parameter. Most likely, the code to get the id (p.nativePurchase['productId']) works for Android, but it's not correct for iOS. So read the console.log, and find where you can actually find the id, because it might be different from Android.
Why does it work on Android but not on iOS? And what's the deal with being asked to purchase again when it's supposed to be a consumable purchase? Android is fine
import { Injectable } from '@angular/core';
import { Platform } from '@ionic/angular';
import 'cordova-plugin-purchase/www/store.d';
private approved1: any = (p: any) =>
{
var pay_id = p.nativePurchase['orderId'];
var id = p.nativePurchase['productId'];
var purchaseToken = p.nativePurchase['purchaseToken'];
const myProduct = this.ps.store.get(p.nativePurchase['productId']);
var price = myProduct.offers[0].pricingPhases[0].price;
var currency = myProduct.offers[0].pricingPhases[0].currency;
var platform = p.platform;
p.finish();
this.ps.store.off(this.approved1);
...
}
The text was updated successfully, but these errors were encountered: