I am making an attempt add an IAP (In App Buy) to my IOS cellular app. I am add a state of testing the acquisition course of domestically. Nonetheless, the App will not be capable of retrieve merchandise from App Join Retailer. Unsure what I am doing unsuitable.
The subscription is created an subscription product and add all particulars on it. The brand new model will not be submitted for Evaluation but.
Within the Ionic, I am utilizing cordova-plugin-purchase
, to deal with the native occasions. When constructing and operating the app through XCode,
Right here is the logic:
this.retailer.initialize([
{
id: FOODIE_PLAN_ID_MONTHLY,
type: this.store.PAID_SUBSCRIPTION, // Access directly
platform: this.store.APPLE_APPSTORE // Access directly (use correct key)
}
])
.then(() => {
console.log('[IAP Initialize] Retailer initialized efficiently.');
this.isInitializing.set(false);
this.loadProductDetails(); // Load particulars after profitable init
})
.catch((err: CdvPurchasePlugin.CdvPurchaseError) => {
console.error('[IAP Initialize] Retailer initialization failed:', err);
this.isInitializing.set(false);
});
async loadProductDetails(): Promise {
console.log('[IAP LoadProducts] Loading product particulars...');
strive {
// Retrieve the cached product state after initialize/refresh
const product = this.retailer.get(FOODIE_PLAN_ID_MONTHLY);
if (product) {
this.zone.run(() => {
this.merchandise.set([product]);
});
console.log(
'[IAP LoadProducts] Product particulars loaded from cache:',
product
);
} else {
console.warn('[IAP LoadProducts] Product particulars not but obtainable.');
this.zone.run(() => {
this.merchandise.set([]);
});
}
} catch (error) {
console.error('[IAP LoadProducts] Didn't get product particulars:', error);
this.zone.run(() => {
this.merchandise.set([]);
});
} lastly {
this.zone.run(() => {
this.isLoadingProducts.set(false);
});
}
}
Right here is the log from my actual cellphone:
⚡️ [log] - [CdvPurchase.Adapters] INFO: AppStore initialized.
⚡️ [log] - [CdvPurchase.Adapters] INFO: AppStore merchandise: []
⚡️ [log] - [CdvPurchase.AdapterListener] DEBUG: setSupportedPlatforms: ios-appstore (0 have their receipts prepared)
⚡️ [log] - [IAP Initialize] Retailer initialized efficiently.
⚡️ [log] - [IAP LoadProducts] Loading product particulars...
⚡️ [warn] - [IAP LoadProducts] Product particulars not but obtainable.
Unsure if I perceive accurately or not. Once we add the merchandise in App Retailer Join. Ought to it is obtainable when testing domestically through Xcode?