Skip to content
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

Exposes finishTransactions to flutter code #45

Merged
merged 3 commits into from
Jun 16, 2020
Merged

Conversation

loregr
Copy link
Contributor

@loregr loregr commented May 12, 2020

I've implemented a method to be able to use setFinishTransactions from Dart.

@vegaro
Copy link
Contributor

vegaro commented May 13, 2020

Thanks for opening this @loregr

I have one question though. Are you trying to set the SDK in observer mode? Why do you need to set finishTransactions?

There's already a parameter in the setup call https://github.com/RevenueCat/purchases-flutter/blob/master/lib/purchases_flutter.dart#L34 that will let you set the SDK in observer mode in case you already have other iap system in place and you don't want our SDK to finish/consume any transaction. SetFinishTransactions is kinda the legacy way of setting the SDK in observer mode.

@loregr
Copy link
Contributor Author

loregr commented May 13, 2020

@vegaro thanks for your feedback. In my understanding (and I may be wrong) observer mode is to be used when I want only to get access to the advanced charting, webhooks, and attribution while I manage purchases and restores in a native way (or without going through revenueCat SDK).
In may case, I still handle the whole in-app purchase process using RevenueCat SDK, the only thing that I needed (and it was missing) was the possibility to don't consume the purchase because I want the user to be able to restore the purchase (no-subscription) if he uninstalls and reinstalls the app, or simply changes his device. So setting finishTransactions to false was exactly what I needed. Also, it looks like that if I want to use observer mode I must pass an appUserId, otherwise the value will be ignored, by setting finishTransactions to false instead, I don't need any additional info.

@vegaro
Copy link
Contributor

vegaro commented May 28, 2020

I see, that makes sense. Can't you get that functionality by using the information inside PurchaserInfo? Even if that transaction has been consumed it should appear after a restore in the allPurchasedProductIdentifiers or in the entitlements if you're using the entitlements system.

(sorry it took so long to reply 🤦)

@vegaro vegaro changed the base branch from master to develop June 16, 2020 01:39
Copy link
Member

@aboedo aboedo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@loregr
thanks so much for opening and for the feedback!
There are a couple of minor indentation issues that we should fix before merging, but we can take care of them if you don't have the time, just let us know.
Otherwise, this looks good to go.

ios/Classes/PurchasesFlutterPlugin.m Outdated Show resolved Hide resolved
ios/Classes/PurchasesFlutterPlugin.m Outdated Show resolved Hide resolved
vegaro and others added 2 commits June 16, 2020 15:31
Co-authored-by: aboedo <andresboedo@gmail.com>
Co-authored-by: aboedo <andresboedo@gmail.com>
@vegaro vegaro merged commit 8779a67 into RevenueCat:develop Jun 16, 2020
@vegaro vegaro mentioned this pull request Jun 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants