-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDKS-1666, SDKS-1776 - Push Notification enhancements #155
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍🏻
forgerock-authenticator/src/main/java/org/forgerock/android/auth/PushNotification.java
Outdated
Show resolved
Hide resolved
forgerock-authenticator/src/main/java/org/forgerock/android/auth/biometric/BiometricAuth.java
Show resolved
Hide resolved
forgerock-authenticator/src/main/java/org/forgerock/android/auth/biometric/BiometricAuth.java
Show resolved
Hide resolved
forgerock-authenticator/src/main/java/org/forgerock/android/auth/biometric/BiometricAuth.java
Outdated
Show resolved
Hide resolved
forgerock-authenticator/src/main/java/org/forgerock/android/auth/biometric/BiometricAuth.java
Outdated
Show resolved
Hide resolved
forgerock-authenticator/src/main/java/org/forgerock/android/auth/biometric/BiometricAuth.java
Outdated
Show resolved
Hide resolved
forgerock-authenticator/src/main/java/org/forgerock/android/auth/PushNotification.java
Show resolved
Hide resolved
forgerock-authenticator/src/main/java/org/forgerock/android/auth/DefaultStorageClient.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor changes
@@ -0,0 +1,85 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as above, we can convert this whole Fragment class to regular class if we use registerForActivityResult. but its up to you if you wanna do it now or break it . i have a story for this in the backlog. https://bugster.forgerock.org/jira/browse/SDKS-1827 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer leave this change to be done with the ticket in the backlog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed and tested the changes. Looks good to me! 👍🏻
Please, update CHANGELOG.md with a summary of the changes.
PushNotificationActivity.this.runOnUiThread(new Runnable() { | ||
@Override | ||
public void run() { | ||
Toast.makeText(thisActivity, R.string.notification_error_network_failure_message, Toast.LENGTH_LONG).show(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the toast message to display the actual error - i.e. e.getLocalizedMessage()
PushNotificationActivity.this.runOnUiThread(new Runnable() { | ||
@Override | ||
public void run() { | ||
Toast.makeText(thisActivity, R.string.notification_error_network_failure_message, Toast.LENGTH_LONG).show(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the toast message to display the actual error - i.e. e.getLocalizedMessage()
@@ -64,7 +307,7 @@ public void onException(Exception e) { | |||
PushNotificationActivity.this.runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
Toast.makeText(thisActivity, R.string.notification_error_network_failure_message, Toast.LENGTH_SHORT).show(); | |||
Toast.makeText(thisActivity, R.string.notification_error_network_failure_message, Toast.LENGTH_LONG).show(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the toast message to display the actual error - i.e. e.getLocalizedMessage()
@@ -94,15 +337,53 @@ public void onException(Exception e) { | |||
PushNotificationActivity.this.runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
Toast.makeText(thisActivity, R.string.notification_error_network_failure_message, Toast.LENGTH_SHORT).show(); | |||
Toast.makeText(thisActivity, R.string.notification_error_network_failure_message, Toast.LENGTH_LONG).show(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the toast message to display the actual error - i.e. e.getLocalizedMessage()
public void onResponse(@NotNull Call call, @NotNull Response response) { | ||
Logger.debug(TAG, "Response from server: \n" + response.toString()); | ||
// Check if operation succeed | ||
if(response.code() == 200) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May consider to use java.net.HttpURLConnection#HTTP_OK
forgerock-authenticator/src/main/java/org/forgerock/android/auth/PushResponder.java
Show resolved
Hide resolved
forgerock-authenticator/src/main/java/org/forgerock/android/auth/PushResponder.java
Show resolved
Hide resolved
ca6a252
ca6a252
to
6d95680
Compare
SDKS-1776 Add new custom payload in the Push Notification
This PR consolidates the upcoming changes on the Push Sender node (SDKS-1472). All changes are backward compatible and Unit Tests and sample app were updated to validate the changes.
JIRA Tickets included in this PR:
[SDKS-1666] Obtain timestamp from new Push Notification payload
[SDKS-1776] Add new custom payload in the Push Notification
[SDKS-1454] Sample app crash after scan push mechanism