From 9d78338ab9bf7f59ca359e1d6698648fd2e864ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=97=D0=B0=D1=86=D0=B5=D0=BF=D0=B8=D0=BD?= Date: Wed, 27 Nov 2019 16:11:08 +0300 Subject: [PATCH] [android] Changed parameter name in subscription deeplink --- android/src/com/mapswithme/maps/intent/Factory.java | 3 ++- .../mapswithme/maps/purchase/BookmarkPaymentDataParser.java | 1 - android/src/com/mapswithme/maps/purchase/PurchaseUtils.java | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/android/src/com/mapswithme/maps/intent/Factory.java b/android/src/com/mapswithme/maps/intent/Factory.java index 26fe56b759..d84a9e2c3c 100644 --- a/android/src/com/mapswithme/maps/intent/Factory.java +++ b/android/src/com/mapswithme/maps/intent/Factory.java @@ -32,6 +32,7 @@ import com.mapswithme.maps.location.LocationHelper; import com.mapswithme.maps.onboarding.IntroductionScreenFactory; import com.mapswithme.maps.purchase.BookmarksAllSubscriptionActivity; import com.mapswithme.maps.purchase.BookmarksSightsSubscriptionActivity; +import com.mapswithme.maps.purchase.PurchaseUtils; import com.mapswithme.maps.purchase.SubscriptionType; import com.mapswithme.maps.routing.RoutingController; import com.mapswithme.maps.search.SearchActivity; @@ -733,7 +734,7 @@ public class Factory public boolean run(@NonNull MwmActivity target) { Uri uri = Uri.parse(mUrl); - String serverId = uri.getQueryParameter("deliverable"); + String serverId = uri.getQueryParameter(PurchaseUtils.GROUPS); if (TextUtils.isEmpty(serverId)) return false; diff --git a/android/src/com/mapswithme/maps/purchase/BookmarkPaymentDataParser.java b/android/src/com/mapswithme/maps/purchase/BookmarkPaymentDataParser.java index 7a5db2b71e..e0893c5aca 100644 --- a/android/src/com/mapswithme/maps/purchase/BookmarkPaymentDataParser.java +++ b/android/src/com/mapswithme/maps/purchase/BookmarkPaymentDataParser.java @@ -20,7 +20,6 @@ public class BookmarkPaymentDataParser implements PaymentDataParser public final static String NAME = "name"; public final static String IMG_URL = "img"; public final static String AUTHOR_NAME = "author_name"; - public final static String GROUPS = "groups"; @NonNull @Override diff --git a/android/src/com/mapswithme/maps/purchase/PurchaseUtils.java b/android/src/com/mapswithme/maps/purchase/PurchaseUtils.java index 3626590716..5f4ea8569b 100644 --- a/android/src/com/mapswithme/maps/purchase/PurchaseUtils.java +++ b/android/src/com/mapswithme/maps/purchase/PurchaseUtils.java @@ -22,6 +22,7 @@ import java.util.List; public class PurchaseUtils { + public final static String GROUPS = "groups"; final static int REQ_CODE_PRODUCT_DETAILS_FAILURE = 1; final static int REQ_CODE_PAYMENT_FAILURE = 2; final static int REQ_CODE_VALIDATION_SERVER_ERROR = 3; @@ -183,11 +184,11 @@ public class PurchaseUtils @NonNull public static String getTargetBookmarkGroupFromUri(@NonNull Uri uri) { - List uriGroups = uri.getQueryParameters(BookmarkPaymentDataParser.GROUPS); + List uriGroups = uri.getQueryParameters(GROUPS); if (uriGroups == null || uriGroups.isEmpty()) { CrashlyticsUtils.logException( - new IllegalArgumentException("'" + BookmarkPaymentDataParser.GROUPS + new IllegalArgumentException("'" + GROUPS + "' parameter is required! URI: " + uri)); return SubscriptionType.BOOKMARKS_ALL.getServerId(); }