Вот логика: < /p>
this.store.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] Store initialized successfully.');
this.isInitializing.set(false);
this.loadProductDetails(); // Load details after successful init
})
.catch((err: CdvPurchasePlugin.CdvPurchaseError) => {
console.error('[IAP Initialize] Store initialization failed:', err);
this.isInitializing.set(false);
});
async loadProductDetails(): Promise {
console.log('[IAP LoadProducts] Loading product details...');
try {
// Retrieve the cached product state after initialize/refresh
const product = this.store.get(FOODIE_PLAN_ID_MONTHLY);
if (product) {
this.zone.run(() => {
this.products.set([product]);
});
console.log(
'[IAP LoadProducts] Product details loaded from cache:',
product
);
} else {
console.warn('[IAP LoadProducts] Product details not yet available.');
this.zone.run(() => {
this.products.set([]);
});
}
} catch (error) {
console.error('[IAP LoadProducts] Failed to get product details:', error);
this.zone.run(() => {
this.products.set([]);
});
} finally {
this.zone.run(() => {
this.isLoadingProducts.set(false);
});
}
}
< /code>
Вот журнал с моего настоящего телефона: < /p>
< /code>
Не уверен, правильно ли я понимаю или нет. Когда мы добавляем продукты в App Store Connect. Должен ли он доступен при локальном тестировании через xcode?
Подробнее здесь: https://stackoverflow.com/questions/795 ... nect-ionic