Skip to content

Commit

Permalink
Released to 0.5.8
Browse files Browse the repository at this point in the history
- Try handling IllegalStateException on android.
  • Loading branch information
hyochan committed Aug 19, 2018
1 parent 3e1ff72 commit 0afa99d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.5.8
* Avoid crashing on android caused by IllegalStateException.

## 0.5.7
* Avoid possible memory leak in android by deleting static declaration of activity and context.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ public static void registerWith(Registrar registrar) {
@Override
public void onMethodCall(final MethodCall call, final Result result) {
if (call.method.equals("getPlatformVersion")) {
result.success("Android " + android.os.Build.VERSION.RELEASE);
try {
result.success("Android " + android.os.Build.VERSION.RELEASE);
} catch(IllegalStateException e){
e.printStackTrace();
}
}

/*
Expand All @@ -78,7 +82,11 @@ else if (call.method.equals("prepare")) {
intent.setPackage("com.android.vending");

if (mBillingClient != null) {
result.success("Already started. Call endConnection method if you want to start over.");
try{
result.success("Already started. Call endConnection method if you want to start over.");
} catch(IllegalStateException e){
e.printStackTrace();
}
return;
}

Expand All @@ -90,9 +98,17 @@ else if (call.method.equals("prepare")) {
public void onBillingSetupFinished(@BillingClient.BillingResponse int responseCode) {
if (responseCode == BillingClient.BillingResponse.OK) {
// The billing client is ready.
result.success("Billing client ready");
try {
result.success("Billing client ready");
} catch(IllegalStateException e){
e.printStackTrace();
}
} else {
result.error(call.method, "responseCode: " + responseCode, "");
try {
result.error(call.method, "responseCode: " + responseCode, "");
} catch(IllegalStateException e){
e.printStackTrace();
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_inapp_purchase
description: In App Purchase plugin for flutter. This project has been forked by react-native-iap and we are willing to share same experience with that on react-native.
version: 0.5.7
version: 0.5.8
author: dooboolab<dooboolab@gmail.com>
homepage: https://github.com/dooboolab/flutter_inapp_purchase/blob/master/pubspec.yaml
environment:
Expand Down

0 comments on commit 0afa99d

Please sign in to comment.