• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Amazon In-App Purchase Question

Engaged ,
Mar 31, 2019 Mar 31, 2019

Copy link to clipboard

Copied

On both Android and iOS, if a user buys a subscription and then tries to buy it again, both the Google Play Store or Apple App Store will post a warning that the user already owns the subscription.

For Amazon Fire, I am using the In-App Purchase ANE for Amazon, and because you use the App Tester on a Fire device instead of talking directly to the AppStore, it is a little confusing as to what will actually happen in production.  Debugging from my device using the App Tester on a Fire device, I can purchase the subscription as often as I like without getting any warning that I already own the subscription.  Do I need to poll the user's past purchases and and handle creating this warning myself, or will it actually stop me from making a repeat subscription purchase in production???

Thanks for any insights

TOPICS
Development

Views

484

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 31, 2019 Mar 31, 2019

Copy link to clipboard

Copied

I don't know for sure if subscriptions work the same as in app purchases. But for those, as soon as the SDK is available I check if I know they bought the product already (I use shareobjects to know that), and if they might not have bought it, I ask Amazon. The code looks like this:

AmazonPurchase.amazonPurchase.addEventListener(AmazonPurchaseEvent.SDK_AVAILABLE, onSdkAvailable);

private static function onSdkAvailable(e: AmazonPurchaseEvent): void {

  insandbox = e.isSandboxMode;

  log("SDK loaded, sandbox=" + e.isSandboxMode);

  if(!bought("myiapproduct1") || !bought("myiapproduct2")){

      trace("not bought");

      AmazonPurchase.amazonPurchase.restoreTransactions();

  }

}

I use an insandbox variable to know whether to just give the product permission to be active. Like:

public static function restoreTransactions(): void {

     if(insandbox){

       didbuy("myiapproduct1");

       didbuy("myiapproduct2");

     }

     log("Restoring transactions...");

    AmazonPurchase.amazonPurchase.restoreTransactions();

    log("transactions restored.");

}

It's years since I wrote that code, but the basics seemed to that if it's a sandbox test, I don't attempt to restore the purchases, and if it's live, I restore the purchases on startup, if I think the products have not been bought.

Just thinking about it, with a subscription you might need to check every time, and not use a sharedobject, because the user might have closed their subscription.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 31, 2019 Mar 31, 2019

Copy link to clipboard

Copied

Thanks for the reply Colin.  So, the long and short of it is, Amazon does not alert you that you already own the product when you try to purchase it in production, it is up to the developer to manually check and alert the users ourselves??

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 31, 2019 Mar 31, 2019

Copy link to clipboard

Copied

LATEST

I'm not sure, because I wouldn't be showing a button for the user to buy something they already bought. You would hope that Amazon won't charge them again for something they already bought. You also could do a check whether they have bought it already, before sending in the purchase request. Then you would be the one to say: "you already bought that, it's restored now."

The problem case I guess is a user who doesn't use a Restore Purchase button before using a Buy button, for something they have previously bought.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines