diff --git a/plugin.xml b/plugin.xml index 12d5ef2..190e4b0 100644 --- a/plugin.xml +++ b/plugin.xml @@ -197,7 +197,7 @@ - + diff --git a/src/android/org/sunbird/deeplinks/DeepLinkNavigation.java b/src/android/org/sunbird/deeplinks/DeepLinkNavigation.java index b0e306f..daad931 100644 --- a/src/android/org/sunbird/deeplinks/DeepLinkNavigation.java +++ b/src/android/org/sunbird/deeplinks/DeepLinkNavigation.java @@ -63,7 +63,7 @@ public void validateAndHandleDeepLink(Intent intent, IValidateDeepLink iValidate public void validateAndHandleDeepLink(Uri intentData, IValidateDeepLink iValidateDeepLink) { if (intentData != null) { - if (DeepLinkUtility.isDeepLink(intentData)) { // If deeplink clicked from content's last page. + if (DeepLinkUtility.isDeepLink(mActivity,intentData)) { // If deeplink clicked from content's last page. if (iValidateDeepLink != null) { iValidateDeepLink.validLocalDeepLink(); } diff --git a/src/android/org/sunbird/deeplinks/DeepLinkUtility.java b/src/android/org/sunbird/deeplinks/DeepLinkUtility.java index 16a4b13..84b93d8 100644 --- a/src/android/org/sunbird/deeplinks/DeepLinkUtility.java +++ b/src/android/org/sunbird/deeplinks/DeepLinkUtility.java @@ -1,11 +1,12 @@ package org.sunbird.deeplinks; +import android.content.Context; import android.net.Uri; public class DeepLinkUtility { - public static boolean isDeepLink(Uri intentData){ - if (intentData.getScheme().equalsIgnoreCase("ekstep") || intentData.getScheme().equalsIgnoreCase("sunbird")) { + public static boolean isDeepLink(Context context, Uri intentData) { + if (intentData.getScheme().equalsIgnoreCase(getStringResourceByName(context, "deeplink_base_url"))) { return true; } @@ -35,4 +36,14 @@ public static boolean isDeepLinkHttps(Uri intentData) { return false; } + + private static String getStringResourceByName(Context context, String string) { + if (context == null) { + return null; + } else { + String packageName = context.getPackageName(); + int resId = context.getResources().getIdentifier(string, "string", packageName); + return context.getString(resId); + } + } } \ No newline at end of file