Skip to content

Commit dd15aec

Browse files
authored
Merge pull request #10 from getyoti/YD-881
[YD-881][TASK] Small fixes and amends
2 parents bd06830 + 8e8c389 commit dd15aec

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ Please start by adding dependencies in the "build.grade" file inside your applic
5252

5353
```gradle
5454
dependencies {
55-
compile(com.yoti.mobile.android.sdk:yoti-button-sdk:1.0.0)
55+
compile(com.yoti.mobile.android.sdk:yoti-button-sdk:1.1.0)
5656
}
5757
```
58-
OR if you are using a recent version of gradle (>= 3.x):
58+
OR if you are using a more recent version of gradle (>= 3.x):
5959
```gradle
6060
dependencies {
61-
implementation(com.yoti.mobile.android.sdk:yoti-button-sdk:1.0.0)
61+
implementation(com.yoti.mobile.android.sdk:yoti-button-sdk:1.1.0)
6262
}
6363
```
6464

@@ -84,7 +84,7 @@ The client end of the integration is now complete.
8484
Add the below configuration to your manifest:
8585

8686
```xml
87-
<receiver android:name=".MyBroadcastReceiver">
87+
<receiver android:name=".MyBroadcastReceiver" android:exported="false">
8888
<intent-filter>
8989
<action android:name="YOUR_CALLBACK_ACTION"/>
9090
<action android:name="YOUR_BACKEND_CALLBACK_ACTION"/>
@@ -93,7 +93,11 @@ Add the below configuration to your manifest:
9393
```
9494
[See this code in one of our sample apps](./sample-app/src/main/AndroidManifest.xml)
9595

96-
Adding this broadcast receiver class, this acts as a listener for Yoti to get the callback URL from the Yoti app. Please note there are two call back options:
96+
This broadcast receiver was used to receive the communication back from the Yoti App. That's not
97+
the case in recent versions of the SDK and it is only used internally within your app. Therefore we
98+
strongly recommend you to declare your receiver with the option exported="false".
99+
100+
Please note there are two call back options:
97101

98102
1) You handle the callback to your backend
99103
2) Let the SDK manage this for you

sample-app-2/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</intent-filter>
2424
</activity>
2525

26-
<receiver android:name="com.yoti.mobile.android.sampleapp2.recievers.ShareAttributesResultBroadcastReceiver">
26+
<receiver android:name="com.yoti.mobile.android.sampleapp2.recievers.ShareAttributesResultBroadcastReceiver" android:exported="false">
2727
<intent-filter>
2828
<action android:name="com.yoti.services.CALLBACK" />
2929
</intent-filter>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public void onReceive(Context context, Intent intent) {
2525
//Start our activity so the app comes back to the foreground
2626
Intent myActivityIntent = new Intent(mContext, MainActivity.class);
2727
myActivityIntent.putExtra(MainActivity.LOADING_STATUS, true);
28+
myActivityIntent.addFlags(FLAG_ACTIVITY_NEW_TASK);
2829
mContext.startActivity(myActivityIntent);
2930
}
3031

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import javax.net.ssl.HttpsURLConnection;
1919

20+
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
2021
import static com.yoti.mobile.android.sampleapp2.ProfileActivity.ADDRESS_EXTRA;
2122
import static com.yoti.mobile.android.sampleapp2.ProfileActivity.BACKEND_DATA_ERROR_EXTRA;
2223
import static com.yoti.mobile.android.sampleapp2.ProfileActivity.DOB_EXTRA;
@@ -105,10 +106,12 @@ private void handleActionRetrieveProfile(String callbackUrl, String token, Strin
105106
intent.putExtra(MOBILE_EXTRA, profile.getMobNum());
106107
intent.putExtra(GENDER_EXTRA, profile.getGender());
107108
intent.putExtra(PROFILE_EXTRA, true);
109+
intent.addFlags(FLAG_ACTIVITY_NEW_TASK);
108110
startActivity(intent);
109111
} catch (Exception e) {
110112
Intent intent = new Intent(this, MainActivity.class);
111113
intent.putExtra(BACKEND_DATA_ERROR_EXTRA, true);
114+
intent.addFlags(FLAG_ACTIVITY_NEW_TASK);
112115
startActivity(intent);
113116
}
114117

sample-app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</intent-filter>
2222
</activity>
2323

24-
<receiver android:name=".ShareAttributesResultBroadcastReceiver">
24+
<receiver android:name=".ShareAttributesResultBroadcastReceiver" android:exported="false">
2525
<intent-filter>
2626
<action android:name="com.test.app.YOTI_CALLBACK" />
2727
<action android:name="com.test.app.BACKEND_CALLBACK" />

0 commit comments

Comments
 (0)