-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fetchSubscriptions
and startSubscription
not defined for iOS
#14
Comments
Also in this context: what is |
I also tried to use it on iOS and gave me an error. I'm not sure whether or not I'm supposed to use it for subscriptions rather than fetchItems. |
I confirmed that you can use Also, for App Store subscription products, Apple provides |
@mreall Thank you for looking into this. |
@mreall I just came across this issue. Can you still confirm that subscriptions work for iOS using this plugin?
But I only get an error message:
Do you (or anyone else) have any advice? |
Just for anyone else coming across this: you have to follow this guide and create a StoreKit configuration file: |
@felixkrautschuk I assume you got it working? I'm currently using this plugin for subscriptions using the |
@brianrclow yes, at least when creating the StoreKit config file in xcode and when running the app via xcode after that. However, it does not work when running thenapp via |
@felixkrautschuk Interesting, we were able to get up and running after following the steps listed here: https://github.com/NativeScript/payments/tree/main/packages/payments#readme Without any StoreKit config file, but we are using the |
@brianrclow thanks for your help, indeed the fetchItems/buyItem methods work on a physical device when creating a sandbox account (without StoreKit config file). Sometimes I am able to successfully buy a subscription, I get the sandbox-confirmation dialog from iOS, and then I see the FINALIZING_ORDER event being triggered with SUCCESS as expected. BUT when keeping the app open and unused for some time, suddenly the FINALIZING_ORDER event is being triggered another time with a different orderId and restored = false, so it looks like I was manually buying a new subscription, but I didn't do anything. In addition, when starting the app and fetching the subscription items, I am sometimes not able to buy a subscription, because of this line. pendingCount is greater than 0 (sometimes, 6, sometimes 24, ...), even though I just started the app and did not make any new subscriptions. Restarting the app and even reinstalling does not help, pendingCount still has the same value > 0 so I can't test any new subscriptions. Did you experience something like this before? |
@felixkrautschuk Good questions, the iOS sandbox environment and process for testing subscriptions can be tricky. There are lots of steps and if things are not unsubscribed or cleared properly you can run into issues where you can't purchase another subscription properly. I haven't ran into an issue where when I leave it open, FINALIZING_ORDER runs and subscribes to another subscription. I know that pendingCount is pretty important and it can get mixed up if your app or sandbox user hasn't been cleared since you last sandbox purchase. That is something I have ran into before. I can chat more about this over in the Official NativeScript Discord: https://discord.com/invite/RgmpGky9GR That is where most of the community is and it's easier to message back and forth without cluttering this GitHub issue. Join it and shoot a message in the #plugins channel 👍🏻 |
As I understand, for subscriptions we have to use
fetchSubscriptions
instead offetchItems
according to #13 (comment). However,fetchSubscriptions
is defined in the API but not implemented for iOS, therefore calling it leads to an error. Same forstartSubscription
. I suggest implementing it even though it seems not needed on iOS, but as it is part of the API, it should at least call thefetchItems
functions on iOS side internally.The text was updated successfully, but these errors were encountered: