Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amazon billing: Trigger purchaseUpdated callback when iap purchased #165

Merged
merged 5 commits into from
Mar 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ public class AmazonInappPurchasePlugin implements MethodCallHandler {
public static Registrar reg;
private final String TAG = "InappPurchasePlugin";
private Result result = null;
private static MethodChannel channel;

/** Plugin registration. */
public static void registerWith(Registrar registrar) {
final MethodChannel channel = new MethodChannel(registrar.messenger(), "flutter_inapp");
channel = new MethodChannel(registrar.messenger(), "flutter_inapp");
channel.setMethodCallHandler(new FlutterInappPurchasePlugin());
reg = registrar;
}
Expand Down Expand Up @@ -208,6 +209,7 @@ public void onPurchaseResponse(PurchaseResponse response) {
transactionDate.doubleValue());
Log.d(TAG, "opr Putting "+item.toString());
result.success(item.toString());
channel.invokeMethod("purchase-updated", item.toString());
} catch (JSONException e) {
result.error(TAG, "E_BILLING_RESPONSE_JSON_PARSE_ERROR", e.getMessage());
}
Expand Down