Skip to content

Commit

Permalink
Merge 3bbbaec into fcfa00d
Browse files Browse the repository at this point in the history
  • Loading branch information
hyochan committed Sep 16, 2019
2 parents fcfa00d + 3bbbaec commit 50766c9
Show file tree
Hide file tree
Showing 20 changed files with 1,472 additions and 849 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ build/
.idea/
flutter_inapp.iml
flutter_inapp_android.iml
flutter_export_environment*
launch.json
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ matrix:
- ubuntu-toolchain-r-test # if we don't specify this, the libstdc++6 we get is the wrong version
packages:
- libstdc++6
- fonts-droid
before_script:
- git clone https://github.com/flutter/flutter.git -b beta
- gem install coveralls-lcov
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 2.0.0
+ Renamed `buyProduct` to `requestPurchase` and `buySubscription` to `requestSubscription`. This only invokes method and receive results in `purchaseUpdated` or `purchaseError` listener.
+ Completely remove depreacted method `prepare`.
[Android]
+ Upgrade billingclient to `2.0.3 which is currently recent in Sep 15 2019.
+ Remove [IInAppBillingService] binding since billingClient has its own functionalities.
+ Add [DoobooUtils] and add `getBillingResponseData` that visualizes erorr codes better.
+ `buyProduct` no more return asyn result. It rather relies on the `purchaseUpdatedListener`.
+ Add more attributes in android when fetching iaps (`isAcknowledgedAndroid`, `originalJsonAndroid`, `orderId`).

## 1.0.0
+ Add `DEPRECATION` note. Please use [in_app_purchase](https://pub.dev/packages/in_app_purchase).

Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
[![Coverage Status](https://coveralls.io/repos/github/dooboolab/flutter_inapp_purchase/badge.svg?branch=master)](https://coveralls.io/github/dooboolab/flutter_inapp_purchase?branch=master)


## Deprecated
## Sun Rise :sunrise:
Since many one of you wanted me to keep working on this plugin in [#93](https://github.com/dooboolab/flutter_inapp_purchase/issues/93), I've decided to keep working on current project. I hope many one of you can help me maintain this. Thank you for all your supports in advance :tada:.

~~## Deprecated
I've been maintaining this plugin since there wasn't an official plugin out when I implemented it. I saw in `flutter` github [issue #9591](https://github.com/flutter/flutter/issues/9591) that many people have been waiting for this plugin for more than a year before I've thought of building one. However, there has been an official `Google` plugin rised today which is [in_app_purchase](https://pub.dev/packages/in_app_purchase). Please try to use an official one because you might want to get much prompt support from giant `Google`.
Also, thanks for all your supports that made me stubborn to work hard on this plugin. I've had great experience with all of you and hope we can meet someday with other projects.
I'll leave this project as live for those who need time. I'll also try to merge the new `PR`'s and publish to `pub` if there's any further work given to this repo.
I'll leave this project as live for those who need time. I'll also try to merge the new `PR`'s and publish to `pub` if there's any further work given to this repo.~~

# Last Readme
In App Purchase plugin for flutter. This project has been `forked` from [react-native-iap](https://github.com/dooboolab/react-native-iap). We are trying to share same experience of `in-app-purchase` in `flutter` as in `react-native`.
Expand All @@ -35,18 +38,17 @@ For help on editing plugin code, view the [documentation](https://flutter.io/dev
## Methods
| Func | Param | Return | Description |
| :------------ |:---------------:| :---------------:| :-----|
| ~prepare~ | | `String` | *Deprecated* Use initConnection instead. |
| initConnection | | `String` | Prepare IAP module. Must be called on Android before any other purchase flow methods. In ios, it will simply call `canMakePayments` method and return value.|
| getProducts | `List<String>` Product IDs/skus | `List<IAPItem>` | Get a list of products (consumable and non-consumable items, but not subscriptions). Note: On iOS versions earlier than 11.2 this method _will_ return subscriptions if they are included in your list of SKUs. This is because we cannot differentiate between IAP products and subscriptions prior to 11.2. |
| getSubscriptions | `List<String>` Subscription IDs/skus | `List<IAPItem>` | Get a list of subscriptions. Note: On iOS this method has the same output as `getProducts`. Because iOS does not differentiate between IAP products and subscriptions. |
| getPurchaseHistory | | `List<IAPItem>` | Gets an invetory of purchases made by the user regardless of consumption status (where possible) |
| getAvailablePurchases | | `List<PurchasedItem>` | (aka restore purchase) Get all purchases made by the user (either non-consumable, or haven't been consumed yet)
| getAppStoreInitiatedProducts | | `List<IAPItem>` | If the user has initiated a purchase directly on the App Store, the products that the user is attempting to purchase will be returned here. (iOS only) Note: On iOS versions earlier than 11.0 this method will always return an empty list, as the functionality was introduced in v11.0. [See Apple Docs for more info](https://developer.apple.com/documentation/storekit/skpaymenttransactionobserver/2877502-paymentqueue) Always returns an empty list on Android.
| buySubscription | `string` Subscription ID/sku, `string` Old Subscription ID/sku (on Android) | `PurchasedItem` | Create (buy) a subscription to a sku. For upgrading/downgrading subscription on Android pass second parameter with current subscription ID, on iOS this is handled automatically by store. |
| buyProduct | `string` Product ID/sku | `PurchasedItem` | Buy a product |
| ~~buyProductWithoutFinishTransaction~~ | `string` Product ID/sku | `PurchasedItem` | Buy a product without finish transaction call (iOS only) |
| requestSubscription | `string` Subscription ID/sku, `string` Old Subscription ID/sku (on Android) | `PurchasedItem` | Create (request) a subscription to a sku. For upgrading/downgrading subscription on Android pass second parameter with current subscription ID, on iOS this is handled automatically by store. `purchaseUpdatedListener` will receive the result. |
| requestPurchase | `string` Product ID/sku | `PurchasedItem` | Request a purchase. `purchaseUpdatedListener` will receive the result. |
| finishTransaction | `void` | `String` | Send finishTransaction call to Apple IAP server. Call this function after receipt validation process |
| consumePurchase | `String` Purchase token | `String` | Consume a product (on Android.) No-op on iOS. |
| acknowledgePurchaseAndroid | `String` Purchase token, `String` developerPayload? | `String` | Consume a product (on Android.) No-op on iOS. |
| consumePurchaseAndroid | `String` Purchase token, `String` developerPayload? | `String` | Consume a product (on Android.) No-op on iOS. |
| endConnection | | `String` | End billing connection (on Android.) No-op on iOS. |
| consumeAllItems | | `String` | Manually consume all items in android. Do NOT call if you have any non-consumables (one time purchase items). No-op on iOS. |
| validateReceiptIos | `Map<String,String>` receiptBody, `bool` isTest | `http.Response` | Validate receipt for ios. |
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ android {
}

dependencies {
implementation 'com.android.billingclient:billing:1.1'
implementation 'com.android.billingclient:billing:2.0.3'
implementation files('jars/in-app-purchasing-2.0.76.jar')
}

Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ public void onMethodCall(final MethodCall call, final Result result) {
} catch(IllegalStateException e){
e.printStackTrace();
}
} else if (call.method.equals("prepare")) {
Log.d(TAG, "prepare");
} else if (call.method.equals("initConnection")) {
PurchasingService.getUserData();
result.success("Billing client ready");
} else if (call.method.equals("endConnection")) {
Expand Down

0 comments on commit 50766c9

Please sign in to comment.