eggheadgames / android-in-app-payments

Support Android Google Play and Amazon in-app billing (IAP) payments with one API
MIT License
58 stars 14 forks source link

Use new Google Subscription deep link #15

Closed mikemee closed 4 years ago

mikemee commented 6 years ago

We should update the library to use this new link from Google:

On Android, open the Google Play Store, then tap Menu > Subscriptions. On a computer, go to play.google.com, then in the left menu click My subscriptions. On either Android or a computer, use the URL http://play.google.com/store/account/subscriptions to open the user's list of subscriptions. For active subscriptions, use the deep-link http://play.google.com/store/account/subscriptions?package=samplePackage&sku=sampleSKU with your package and SKU name to directly open the page to manage the user's specific subscription. Learn more about the manage subscription deep-link by checking out our documentation for subscription-specific features.

Action required

Please update the instructions in your app or website to reflect this change. If you are currently deep-linking to http://play.google.com/store/account/ to manage subscriptions, please be sure to update your instructions to one of the recommended options listed above.

Ah, it looks like this is in the IAP library, here:

https://github.com/eggheadgames/android-in-app-payments/blob/d1a623a1b84abf1083335c815f693c95de39fa5a/library/src/main/java/com/billing/google/GoogleBillingService.java#L91

I.e. this code:

  @Override
    public void unsubscribe(Activity activity, String sku, int id) {
        try {
            Intent intent = new Intent();
            intent.setAction(Intent.ACTION_VIEW);
            intent.setData(Uri.parse("https://play.google.com/store/account"));
            activity.startActivity(intent);
            activity.finish();
        } catch (Exception e) {
            e.printStackTrace();
        }
}

So we need to replace the URL there I think...