NativeScript / payments

In-App Purchase, Subscriptions, Google Pay, Apple Pay for NativeScript
Apache License 2.0
33 stars 10 forks source link

Payments made in Background #12

Open benedictstrube opened 2 years ago

benedictstrube commented 2 years ago

First of all: awesome job to have an official payment library, much needed, thank you for that!

First question: does the plugin supports purchases made in background? E.g. it is possible to redeem offer codes in the respective stores what triggers a purchase event as soon as the app starts. Is it sufficient to connect to the observable right after app start to retrieve those events triggered in background opposed to those triggered in the app by a user?

Second: Also I would highly appreciate some documentation on the purpose of the different values of PaymentEvent.Context (especially FINALIZING_ORDER and CONNECTING_STORE).

Third: How would you rate the state of development of the plugin regarding test coverage and open (internal) issues? We currently use the ProPlugin purchase plugin and consider switching to this one since it is more up to date and we have ongoing issues with the ProPlugin implementation.

Thank you so much for the effort put into this!

edusperoni commented 2 years ago
  1. should work on android (it restores purchases during the CONNECTING_STORE flow) , not 100% sure on iOS. Best approach is to, after init, call restoreOrders in both cases.
  2. You need to finalize orders (hence FINALIZING_ORDER) so that the stores know that the product is consumed (Android automatically refunds non-finalized orders). CONNECTING_STORE is the flow called after you init the library (success means it successfully bound the delegates and connected to the stores)
  3. I'm currently using it in production apps, and I know others are too.
benedictstrube commented 2 years ago

Thank you very much for your detailed reply, very much appreciated! Is consuming the product also a thing for auto-renewable subscriptions or only for one time purchases?