Skip to content

Commit

Permalink
Merge 6376878 into ca88fda
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeardsmore committed Jun 8, 2019
2 parents ca88fda + 6376878 commit f379cbd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ For help on adding as a dependency, view the [documentation](https://flutter.io/
## Usage Guide
#### Android `connect` and `endConnection`
* You should start the billing service in android to use its funtionalities. We recommend you to use `initConnection` getter method in `initState()`.

```dart
/// start connection for android
@override
Expand All @@ -115,7 +116,8 @@ For help on adding as a dependency, view the [documentation](https://flutter.io/
}
```
* You should end the billing service in android when you are done with it. Otherwise it will be keep running in background. We recommend to use this feature in `dispose()`.
```

```dart
/// start connection for android
@override
void dispose() async{
Expand All @@ -138,7 +140,7 @@ For help on adding as a dependency, view the [documentation](https://flutter.io/
```dart
void purchase() async {
PurchasedItem purchased = await FlutterInappPurchase.buyProduct(item.productId);
print('purcuased - ${purchased.toString()}');
print('purchased - ${purchased.toString()}');
}
```

Expand Down Expand Up @@ -231,7 +233,7 @@ class _MyAppState extends State<MyApp> {
Future<Null> _buyProduct(IAPItem item) async {
try {
PurchasedItem purchased= await FlutterInappPurchase.buyProduct(item.productId);
print('purcuased - ${purchased.toString()}');
print('purchased - ${purchased.toString()}');
} catch (error) {
print('$error');
}
Expand Down

0 comments on commit f379cbd

Please sign in to comment.