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
Summary of issue: First time calling .connect() and fetchItems is fine. Subscriptions and IAPs (app store products) etc. load. Second time we call it in our app, it does not load at all. However, restarting the app seems to load the app store products again.
We used the code structure provided in this plugin documentation.
Workaround/fix for now:
Call teardown() before you leave the subscriptions/IAP page, etc.
eg.
import {
buyItem,
BuyItemOptions,
canMakePayments,
fetchItems,
finalizeOrder,
init as initPayments,
Item,
PaymentEvent,
paymentEvents,
toMainThread,
tearDown as cleanUp
} from '@nativescript/payments';
onClose() {
// Clean up what we've done here as otherwise subscriptions won't load on 2nd reload
cleanUp();
this.location.back();
}
Suggested course of action: Update the docs for this plugin to make it clear that tearDown should be called before leaving the page with the subscription / IAP options, etc.
Screenshots:
When everything is fine (1st call / call with the fix above):
When trying to call the .connect() and fetchItems a second time in an app session (without the fix above):
The text was updated successfully, but these errors were encountered:
Nativescript versions
@nativescript/payments 1.0.4
@nativescript/core: ~8.1.1
@nativescript/ios: 8.2.2
iOS Version: 15.1.1
Device: iPhone 13 Pro max
Summary of issue: First time calling .connect() and fetchItems is fine. Subscriptions and IAPs (app store products) etc. load. Second time we call it in our app, it does not load at all. However, restarting the app seems to load the app store products again.
We used the code structure provided in this plugin documentation.
Related issues: https://stackoverflow.com/questions/25426564/completion-handler-causing-exc-bad-access-when-same-method-is-called-twice
Workaround/fix for now:
Call
teardown()
before you leave the subscriptions/IAP page, etc.eg.
Suggested course of action: Update the docs for this plugin to make it clear that tearDown should be called before leaving the page with the subscription / IAP options, etc.
Screenshots:
When everything is fine (1st call / call with the fix above):
When trying to call the .connect() and fetchItems a second time in an app session (without the fix above):
The text was updated successfully, but these errors were encountered: