j3k0 / cordova-plugin-purchase

In-App Purchase for Cordova on iOS, Android and Windows
https://purchase.cordova.fovea.cc
1.29k stars 529 forks source link

[iOS] Empty Product List #1474

Closed univalchemist closed 7 months ago

univalchemist commented 7 months ago

Observed behavior

⚡️ [log] - [CdvPurchase] INFO: initialize() ⚡️ [log] - [CdvPurchase.Adapters] INFO: Adding platforms: [{"platform":"ios-appstore"}] ⚡️ [log] - [CdvPurchase.Adapters] INFO: ⚡️ [log] - [CdvPurchase.Adapters] INFO: AppStore initializing... ⚡️ [log] - [CdvPurchase.AppleAppStore] INFO: bridge.init To Native Cordova -> InAppPurchase debug InAppPurchase856714935 ["options": []] To Native Cordova -> InAppPurchase setup InAppPurchase856714936 ["options": []] 2023-09-26 13:25:57.357138+0800 App[8380:5315324] [CdvPurchase.AppleAppStore.objc] setup: OK To Native Cordova -> InAppPurchase canMakePayments InAppPurchase856714937 ["options": []] ⚡️ [log] - [CdvPurchase.AppleAppStore.Bridge] DEBUG: setup ok ⚡️ [log] - [CdvPurchase.AppleAppStore] INFO: ready ⚡️ [log] - [CdvPurchase.AppleAppStore] INFO: bridge.init done 2023-09-26 13:25:57.369557+0800 App[8380:5315324] [CdvPurchase.AppleAppStore.objc] canMakePayments: Device can make payments. ⚡️ [log] - [CdvPurchase.Adapters] INFO: AppStore initialized. ⚡️ [log] - [CdvPurchase.Adapters] INFO: AppStore products: [] ⚡️ [log] - [CdvPurchase.AdapterListener] DEBUG: setSupportedPlatforms: ios-appstore ⚡️ [log] - @@@ IAP store.isReady @@@ true To Native Cordova -> InAppPurchase processPendingTransactions InAppPurchase856714938 ["options": []] ⚡️ [log] - [CdvPurchase.AppleAppStore.Bridge] DEBUG: processing pending transactions 2023-09-26 13:25:57.422989+0800 App[8380:5315324] [CdvPurchase.AppleAppStore.objc] processPendingTransactionUpdates

Expected behavior

I have IAP product added in app store and it should show in app, but it is empty as see in logs. image (4)

System Info

Output of cordova info. Ionic: Ionic CLI : 7.1.1 Ionic Framework : @ionic/angular 7.2.0 @angular-devkit/build-angular : 16.1.5 @angular-devkit/schematics : 16.1.5 @angular/cli : 16.1.5 @ionic/angular-toolkit : 9.0.0

Capacitor:

Capacitor CLI : 5.2.2 @capacitor/android : 5.2.2 @capacitor/core : 5.2.2 @capacitor/ios : 5.2.2

univalchemist commented 7 months ago

Nevermind, it is resolved. I had to register product first.

orhan-swe commented 4 months ago

I had the same issue: It seems one needs to do the following:

store.register(myProdList);
store.initialize(platformList)
      .then(e => {
        // store callback events, check prod list from store etc
        ...
      })
      .catch(e => console.error("error: ", e))
})
danieldanielecki commented 4 months ago

I forgot to put the entire com.mybrand.myproject.myID in store.register({ ... }), because iOS required the full path (as opposite to Android, for which just myID is enough).