22
22
23
23
import java .util .HashMap ;
24
24
25
+ import static com .yoti .mobile .android .sdk .ButtonTheme .THEME_PARTNERSHIP ;
25
26
import static com .yoti .mobile .android .sdk .ButtonTheme .THEME_YOTI ;
26
27
import static com .yoti .mobile .android .sdk .exceptions .AppNotInstalledErrorCode .EASY_ID_APP_NOT_INSTALLED ;
27
28
import static com .yoti .mobile .android .sdk .exceptions .AppNotInstalledErrorCode .PARTNERSHIP_APP_NOT_INSTALLED ;
@@ -143,7 +144,7 @@ static void startScenario(final Context context, final String useCaseId,
143
144
}
144
145
145
146
YotiSDKLogger .debug ("Started scenario " + useCaseId );
146
- KernelSDKIntentService .startActionStartScenario (context , useCaseId , onYotiCalledResultReceiver , getLaunchingAppScheme (appPackageInfo ));
147
+ KernelSDKIntentService .startActionStartScenario (context , useCaseId , onYotiCalledResultReceiver , getLaunchingAppScheme (sdkButtonTheme , appPackageInfo ));
147
148
}
148
149
149
150
private static PackageInfo getAppPackageInfoBasedOnTheme (PackageManager packageManager , ButtonTheme buttonTheme ) throws YotiSDKAppNotInstalledException {
@@ -154,8 +155,7 @@ private static PackageInfo getAppPackageInfoBasedOnTheme(PackageManager packageM
154
155
case THEME_PARTNERSHIP :
155
156
if (checkAppInstalled (packageManager , YotiAppDefs .YOTI_APP_PACKAGE )) {
156
157
packageInfo = packageManager .getPackageInfo (YotiAppDefs .YOTI_APP_PACKAGE , 0 );
157
- } else if (checkAppInstalled (packageManager , YotiAppDefs .EASY_ID_APP_PACKAGE )
158
- && checkEasyAppWithSchemeAvailable (packageManager )) {
158
+ } else if (checkAppInstalled (packageManager , YotiAppDefs .EASY_ID_APP_PACKAGE )) {
159
159
packageInfo = packageManager .getPackageInfo (YotiAppDefs .EASY_ID_APP_PACKAGE , 0 );
160
160
} else {
161
161
AppNotInstalledErrorCode errorCode = buttonTheme == THEME_YOTI ? YOTI_APP_NOT_INSTALLED : PARTNERSHIP_APP_NOT_INSTALLED ;
@@ -193,9 +193,21 @@ private static boolean checkEasyAppWithSchemeAvailable(@NonNull PackageManager p
193
193
return intent .resolveActivity (packageManager ) != null ;
194
194
}
195
195
196
- private static String getLaunchingAppScheme (PackageInfo packageInfo ) {
196
+ /**
197
+ * For EasyId theme, we are supporting launching EasyId app from v3.30.0 so for Partnership
198
+ * or Yoti theme we will use yoti:// scheme to launch EasyId app
199
+ *
200
+ * @param buttonTheme applied button theme
201
+ * @param packageInfo installed app's package info
202
+ * @return resolved scheme Ex. yoti:// or easyid://
203
+ */
204
+ private static String getLaunchingAppScheme (ButtonTheme buttonTheme , PackageInfo packageInfo ) {
197
205
if (packageInfo != null && packageInfo .packageName .equals (YotiAppDefs .EASY_ID_APP_PACKAGE )) {
198
- return YotiAppDefs .EASY_ID_APP_SCHEME ;
206
+ if (buttonTheme == THEME_PARTNERSHIP || buttonTheme == THEME_YOTI ) {
207
+ return YotiAppDefs .YOTI_APP_SCHEME ;
208
+ } else {
209
+ return YotiAppDefs .EASY_ID_APP_SCHEME ;
210
+ }
199
211
}
200
212
else {
201
213
return YotiAppDefs .YOTI_APP_SCHEME ;
0 commit comments