Skip to content
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

Merged
merged 1 commit into from
May 9, 2022
Merged

Conversation

rodrigoareis
Copy link
Contributor

@rodrigoareis rodrigoareis commented Apr 22, 2022

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

@rodrigoareis rodrigoareis self-assigned this Apr 22, 2022
@rodrigoareis rodrigoareis changed the base branch from master to develop April 22, 2022 01:26
spetrov
spetrov previously approved these changes Apr 27, 2022
Copy link
Contributor

@spetrov spetrov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

spetrov
spetrov previously approved these changes Apr 29, 2022
Copy link
Contributor

@spetrov spetrov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏻

Copy link
Contributor

@jeyanthanperiyasamy jeyanthanperiyasamy left a 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 @@
/*
Copy link
Contributor

@jeyanthanperiyasamy jeyanthanperiyasamy May 3, 2022

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 .

Copy link
Contributor Author

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.

Copy link
Contributor

@spetrov spetrov left a 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.

forgerock-authenticator/build.gradle Show resolved Hide resolved
PushNotificationActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(thisActivity, R.string.notification_error_network_failure_message, Toast.LENGTH_LONG).show();
Copy link
Contributor

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();
Copy link
Contributor

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();
Copy link
Contributor

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();
Copy link
Contributor

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) {
Copy link
Contributor

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

witrisna
witrisna previously approved these changes May 6, 2022
spetrov
spetrov previously approved these changes May 9, 2022
@rodrigoareis rodrigoareis force-pushed the SDKS-1666 branch 2 times, most recently from ca6a252 to 6d95680 Compare May 9, 2022 22:34
SDKS-1776 Add new custom payload in the Push Notification
@spetrov spetrov merged commit 98c405c into develop May 9, 2022
@spetrov spetrov deleted the SDKS-1666 branch May 9, 2022 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants