-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[in_app_purchase] Implementation of the app facing package #3877
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code mostly looks good. Also since there are API changes, don't we need to update README and example/README?
As part of implementing federated architecture and making the interface compatible for other platform this version contains the following **breaking changes**: | ||
|
||
* Changes to the platform agnostic interface: | ||
* The `InAppPurchaseConnection` class has been renamed to `InAppPurchase`. To access the generic InApp Purchase API use `InAppPurchase.instance`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits: maybe we can make this clearer such as
If you used inAppPurchaseConnection.instance
to access generic In App Purchase APIs, please use InAppPurchase.instance
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
* Changes to the platform agnostic interface: | ||
* The `InAppPurchaseConnection` class has been renamed to `InAppPurchase`. To access the generic InApp Purchase API use `InAppPurchase.instance`; | ||
* The `purchaseUpdatedStream` has been renamed to `purchaseStream`. Restored purchases are now also emitted on this stream and are marked with a `status` of `PurchaseStatus.restored`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have to mention "restored purchases are now also emitted on this stream and are marked with a status
of PurchaseStatus.restored
;"
Instead, we should give more details in the item below:
The InAppPurchaseConnection.queryPurchases
method has been removed. Instead, you should use InAppPurchase.restorePurchases
. This method emits each restored purchase on the InAppPurchase.purchaseStream
, the purchase object will be marked with a status
of PurchaseStatus.restored
Also, for each API, mention its class, for example, InAppPurchaseConnection.purchaseUpdatedStream
, and InAppPurchase.purchaseStream
Ditto below for all the other items.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -21,6 +21,7 @@ dependencies: | |||
flutter: | |||
sdk: flutter | |||
|
|||
json_annotation: ^4.0.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the changes in in_app_purchase_android and in_app_purchase_ios here intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, they have been solved with PR #3879 which wasn't merge at that time. Now that it is merged and I rebased the changes have been removed from this PR.
Yes that is why this PR is still in draft (also see checklist in the description) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This pull request is not suitable for automatic merging in its current state.
|
Tree went red because the Xcode project (part of the I have removed these tests as they don't belong here. |
) * Start with app-facing package * Update to pub version of platform interface * Update CHANGELOG with feedback from PR * Fix some spelling mistakes * Update CHANGELOG with feedback from PR * Update README with new features * Update dependencies and links in documentation * Remove iOS test from example project * Remove test target from Podfile * Remove test from Xcode scheme
Implementation of the app facing package. This is the last part of the migration to the federated plugin architecture.
This PR is marked as draft and needs the following tasks to be completed:
Related issues:
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
dart format
. See plugin_tool format)[shared_preferences]
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.