Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[in_app-purchase] Updated the ReadMe to remove the deprecated InAppPurchaseAndroidPlatformAddition.enablePendingPurchases method #4597

Merged
merged 8 commits into from
Dec 10, 2021
4 changes: 4 additions & 0 deletions packages/in_app_purchase/in_app_purchase/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.0.1

* Removes the instructions on initializing the plugin since this functionality is deprecated.

## 2.0.0

* **BREAKING CHANGES**:
Expand Down
22 changes: 0 additions & 22 deletions packages/in_app_purchase/in_app_purchase/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ See also the codelab for [in-app purchases in Flutter](https://codelabs.develope

This section has examples of code for the following tasks:

* [Initializing the plugin](#initializing-the-plugin)
* [Listening to purchase updates](#listening-to-purchase-updates)
* [Connecting to the underlying store](#connecting-to-the-underlying-store)
* [Loading products for sale](#loading-products-for-sale)
Expand All @@ -65,27 +64,6 @@ This section has examples of code for the following tasks:
* [Accessing platform specific product or purchase properties](#accessing-platform-specific-product-or-purchase-properties)
* [Presenting a code redemption sheet (iOS 14)](#presenting-a-code-redemption-sheet-ios-14)

### Initializing the plugin

The following initialization code is required for Google Play:

```dart
// Import `in_app_purchase_android.dart` to be able to access the
// `InAppPurchaseAndroidPlatformAddition` class.
import 'package:in_app_purchase_android/in_app_purchase_android.dart';
import 'package:flutter/foundation.dart';

void main() {
// Inform the plugin that this app supports pending purchases on Android.
// An error will occur on Android if you access the plugin `instance`
// without this call.
if (defaultTargetPlatform == TargetPlatform.android) {
InAppPurchaseAndroidPlatformAddition.enablePendingPurchases();
}
runApp(MyApp());
}
```

**Note:** It is not necessary to depend on `com.android.billingclient:billing` in your own app's `android/app/build.gradle` file. If you choose to do so know that conflicts might occur.

### Listening to purchase updates
Expand Down
2 changes: 1 addition & 1 deletion packages/in_app_purchase/in_app_purchase/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: in_app_purchase
description: A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the App Store and Google Play.
repository: https://github.com/flutter/plugins/tree/master/packages/in_app_purchase/in_app_purchase
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
version: 2.0.0
version: 2.0.1

environment:
sdk: ">=2.12.0 <3.0.0"
Expand Down