Skip to content

Commit f71c3db

Browse files
committed
#Updated sample apps, avoided deprecated calls
#YM-23299
1 parent 32d9f57 commit f71c3db

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

sample-app-2/src/main/java/com/yoti/mobile/android/sampleapp2/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected void onCreate(Bundle savedInstanceState) {
3333

3434
processExtraData(getIntent());
3535

36-
yotiSDKButton.setOnYotiScenarioListener(new YotiSDKButton.OnYotiButtonClickListener() {
36+
yotiSDKButton.setOnYotiButtonClickListener(new YotiSDKButton.OnYotiButtonClickListener() {
3737
@Override
3838
public void onStartScenario() {
3939
yotiSDKButton.setVisibility(View.GONE);

sample-app/src/main/java/com/yoti/mobile/android/sdk/sampleapp/MainActivity.java

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import com.yoti.mobile.android.sdk.YotiSDKButton;
1313
import com.yoti.mobile.android.sdk.exceptions.YotiSDKException;
14-
import com.yoti.mobile.android.sdk.exceptions.YotiSDKNoYotiAppException;
1514

1615
public class MainActivity extends AppCompatActivity {
1716

@@ -47,14 +46,11 @@ public void onStartScenarioError(YotiSDKException cause) {
4746
}
4847
});
4948

50-
mYotiSDKButton.setOnYotiAppNotInstalledListener(new YotiSDKButton.OnYotiAppNotInstalledListener() {
51-
@Override
52-
public void onYotiAppNotInstalledError(YotiSDKNoYotiAppException cause) {
53-
//The Yoti app is not installed, let's deal with it
54-
mYotiSDKButton.setVisibility(View.VISIBLE);
55-
mProgress.setVisibility(View.GONE);
56-
mMessage.setText(R.string.loc_no_yoti_app_error);
57-
}
49+
mYotiSDKButton.setOnAppNotInstalledListener((cause, appURL) -> {
50+
// App is not installed, need to call browser intent with app download link
51+
mYotiSDKButton.setVisibility(View.VISIBLE);
52+
mProgress.setVisibility(View.GONE);
53+
launchAppUrl(appURL);
5854
});
5955

6056
mYotiSDKButton.setOnAppCalledListener(new YotiSDKButton.OnAppCalledListener() {
@@ -65,13 +61,6 @@ public void onAppCalled() {
6561
mProgress.setVisibility(View.GONE);
6662
}
6763
});
68-
69-
mYotiSDKButton.setOnAppNotInstalledListener((cause, appURL) -> {
70-
// App is not installed, need to call browser intent with app download link
71-
mYotiSDKButton.setVisibility(View.VISIBLE);
72-
mProgress.setVisibility(View.GONE);
73-
launchAppUrl(appURL);
74-
});
7564
}
7665

7766
// required app is not installed, launch app url to download the app

0 commit comments

Comments
 (0)