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
{{ message }}
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
[in_app_purchase] Rename iOS implementation to _storekit (#4518)
Renames the iOS implementation package to `in_app_purchase_storekit`, and renames it types and files accordingly, to allow for adding a symlink-based macOS implementation to this package in the future.
Temporarily marks `in_app_purchase` as unpublishable so that this can be a move, rather than a copy-and-delete-later, which makes for difficult reviews and destroys git blame.
Part of flutter/flutter#86076
Supports flutter/flutter#84391
and [billing_client_wrappers](https://pub.dev/documentation/in_app_purchase_android/latest/billing_client_wrappers/billing_client_wrappers-library.html).
46
46
These APIs expose platform-specific behavior and allow for more fine-tuned
47
47
control when needed. However, if you use one of these APIs, your
@@ -70,7 +70,7 @@ This section has examples of code for the following tasks:
70
70
The following initialization code is required for Google Play:
71
71
72
72
```dart
73
-
// Import `in_app_purchase_android.dart` to be able to access the
73
+
// Import `in_app_purchase_android.dart` to be able to access the
Restored purchases will be emitted on the `InAppPurchase.purchaseStream`, make
178
-
sure to validate restored purchases following the best practices for each
178
+
sure to validate restored purchases following the best practices for each
179
179
underlying store:
180
180
181
181
*[Verifying App Store purchases](https://developer.apple.com/documentation/storekit/in-app_purchase/validating_receipts_with_the_app_store)
@@ -213,8 +213,8 @@ if (_isConsumable(productDetails)) {
213
213
### Completing a purchase
214
214
215
215
The `InAppPurchase.purchaseStream` will send purchase updates after
216
-
you initiate the purchase flow using `InAppPurchase.buyConsumable`
217
-
or `InAppPurchase.buyNonConsumable`. After delivering the content to
216
+
you initiate the purchase flow using `InAppPurchase.buyConsumable`
217
+
or `InAppPurchase.buyNonConsumable`. After delivering the content to
218
218
the user, call `InAppPurchase.completePurchase` to tell the App Store
219
219
and Google Play that the purchase has been finished.
220
220
@@ -249,18 +249,18 @@ InAppPurchase.instance
249
249
250
250
### Confirming subscription price changes
251
251
252
-
When the price of a subscription is changed the consumer will need to confirm that price change. If the consumer does not
253
-
confirm the price change the subscription will not be auto-renewed. By default on both iOS and Android the consumer will
252
+
When the price of a subscription is changed the consumer will need to confirm that price change. If the consumer does not
253
+
confirm the price change the subscription will not be auto-renewed. By default on both iOS and Android the consumer will
254
254
automatically get a popup to confirm the price change, but App developers can override this mechanism and show the popup on a later moment so it doesn't interrupt the critical flow of the App. This works different on the Apple App Store and on the Google Play Store.
255
255
256
256
#### Google Play Store (Android)
257
-
When the subscription price is raised, the consumer should approve the price change within 7 days. The official
257
+
When the subscription price is raised, the consumer should approve the price change within 7 days. The official
258
258
documentation can be found [here](https://support.google.com/googleplay/android-developer/answer/140504?hl=en#zippy=%2Cprice-changes).
259
259
When the price is lowered the consumer will automatically receive the lower price and does not have to approve the price change.
260
260
261
261
After 7 days the consumer will be notified through email and notifications on Google Play to agree with the new price. App developers have 7 days to explain the consumer that the price is going to change and ask them to accept this change. App developers have to keep track of whether or not the price change is already accepted within the app or in the backend. The [Google Play API](https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptions) can be used to check whether or not the price change is accepted by the consumer by reading the `priceChange` property on a subscription object.
262
262
263
-
The `InAppPurchaseAndroidPlatformAddition` can be used to show the price change confirmation flow. The additions contain the function `launchPriceChangeConfirmationFlow` which needs the SKU code of the subscription.
263
+
The `InAppPurchaseAndroidPlatformAddition` can be used to show the price change confirmation flow. The additions contain the function `launchPriceChangeConfirmationFlow` which needs the SKU code of the subscription.
264
264
265
265
```dart
266
266
//import for InAppPurchaseAndroidPlatformAddition
@@ -272,7 +272,7 @@ if (Platform.isAndroid) {
272
272
final InAppPurchaseAndroidPlatformAddition androidAddition =
### Accessing platform specific product or purchase properties
352
352
353
-
The function `_inAppPurchase.queryProductDetails(productIds);` provides a `ProductDetailsResponse` with a
354
-
list of purchasable products of type `List<ProductDetails>`. This `ProductDetails` class is a platform independent class
353
+
The function `_inAppPurchase.queryProductDetails(productIds);` provides a `ProductDetailsResponse` with a
354
+
list of purchasable products of type `List<ProductDetails>`. This `ProductDetails` class is a platform independent class
355
355
containing properties only available on all endorsed platforms. However, in some cases it is necessary to access platform specific properties. The `ProductDetails` instance is of subtype `GooglePlayProductDetails`
356
356
when the platform is Android and `AppStoreProductDetails` on iOS. Accessing the skuDetails (on Android) or the skProduct (on iOS) provides all the information that is available in the original platform objects.
357
357
@@ -371,20 +371,20 @@ if (productDetails is GooglePlayProductDetails) {
371
371
And this is the way to get the subscriptionGroupIdentifier of a subscription on iOS:
SKPaymentTransactionWrapper skProduct = (purchaseDetails as AppStorePurchaseDetails).skPaymentTransaction;
412
412
print(skProduct.transactionState);
413
413
}
414
414
```
415
415
416
-
Please note that it is required to import `in_app_purchase_android` and/or `in_app_purchase_ios`.
416
+
Please note that it is required to import `in_app_purchase_android` and/or `in_app_purchase_storekit`.
417
417
418
418
### Presenting a code redemption sheet (iOS 14)
419
419
@@ -422,15 +422,15 @@ codes that you've set up in App Store Connect. For more information on
422
422
redeeming offer codes, see [Implementing Offer Codes in Your App](https://developer.apple.com/documentation/storekit/in-app_purchase/subscriptions_and_offers/implementing_offer_codes_in_your_app).
0 commit comments