Skip to content

Commit

Permalink
Add deep-link to manage subscription
Browse files Browse the repository at this point in the history
Fix indonesian translation.
  • Loading branch information
pranavpandey committed Jan 12, 2025
1 parent 519e193 commit 2b4c402
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Pranav Pandey
* Copyright 2022-2025 Pranav Pandey
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -61,6 +61,12 @@ public class DynamicBilling {
public static final String URL_GOOGLE_PLAY =
"http://play.google.com/store/account/subscriptions?package=%1$s";

/**
* URL constant to manage subscription inside Google Play.
*/
public static final String URL_GOOGLE_PLAY_SUB =
"http://play.google.com/store/account/subscriptions?sku=%1$s&package=%2$s";

/**
* Singleton instance of {@link DynamicBilling}.
*/
Expand Down Expand Up @@ -572,4 +578,20 @@ public void manageGooglePlay() {
DynamicLinkUtils.viewUrl(getContext(), String.format(
URL_GOOGLE_PLAY, getContext().getPackageName()));
}

/**
* Try to launch manage subscription flow for Google Play.
*
* @param productId The product id for the subscription.
*/
public void manageGooglePlaySubscription(@Nullable String productId) {
if (productId == null) {
manageGooglePlay();

return;
}

DynamicLinkUtils.viewUrl(getContext(), String.format(
URL_GOOGLE_PLAY_SUB, productId, getContext().getPackageName()));
}
}
2 changes: 1 addition & 1 deletion dynamic-billing/src/main/res/values-in/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<string name="adb_price_years">per %1$d tahun</string>

<!-- Offers -->
<string name="adb_offer_free_trial_day">Uji coba gratis %1$hari</string>
<string name="adb_offer_free_trial_day">Uji coba gratis %1$d&#8211;hari</string>
<string name="adb_offer_free_trial_week">Uji coba gratis %1$d&#8211;minggu</string>
<string name="adb_offer_free_trial_month">Uji coba gratis %1$d&#8211;bulan</string>
<string name="adb_offer_free_trial_year">Uji coba gratis %1$d&#8211;tahun</string>
Expand Down

0 comments on commit 2b4c402

Please sign in to comment.