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

Send push notification for every new statement of account generated via the auto generated feature #35

Closed
RoiJS opened this issue May 2, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request technical task regular instructions
Projects

Comments

@RoiJS
Copy link
Owner

RoiJS commented May 2, 2021

On issue #34, a pre-study of how to implement push notification for android has been done. Now, this issue dedicates for the actual implementation of the push notification feature to Reserbiz Mobile application. Based on the pre-study, there is a bit of problem because the plugin does not support click event on the received notification at the time of this writing. So the goal of this issue is to at least implement the notification. The user should at least receive push notification (mobile app is in background) for each and every new statement of account generated.

TODO:

Part 1 - Set up firebase plugin

Part 2 - Modifications on Generating Statement of account

  • Introduce new service called "FireBasePushNotificationService". This service will be responsible for sending notification.
  • Use this newly created service on AccountStatementRepository and called it every after new statement of account has been generated.
  • Introduce new angular service named push-notification.service.ts.
  • Use this newly added service inside auth.component and app.component
  • Test and verify
@RoiJS RoiJS self-assigned this May 2, 2021
@RoiJS RoiJS added enhancement New feature or request technical task regular instructions labels May 2, 2021
@RoiJS RoiJS added this to To Do in Reserbiz via automation May 2, 2021
@RoiJS
Copy link
Owner Author

RoiJS commented May 2, 2021

Setup development branch: Features/pre-study-push-notifications

Done implementing the functionality.

During the development, spent additional time to do further research/investigation about opening specific page after tapping the notification however, there is still no solution yet so I skipped this functionality for now.

@RoiJS RoiJS closed this as completed May 2, 2021
Reserbiz automation moved this from To Do to Done May 2, 2021
@RoiJS RoiJS reopened this May 5, 2021
Reserbiz automation moved this from Done to Ready for Development May 5, 2021
@RoiJS
Copy link
Owner Author

RoiJS commented May 5, 2021

While trying to figure out issue related with opening the app by tapping the notification, I came across a solution on the previous problem where I thought opening a specific page by tapping a notification is not supported on android, in fact this can be done by simply using router extension service inside addOnMessagedReceivedCallback() function. This was actually mentioned on this github project https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/master/docs/MESSAGING.md

image

I used RouterExtensions navigate function and this works.

@RoiJS
Copy link
Owner Author

RoiJS commented May 5, 2021

I have encountered another issue when receiving notification after the device has been disconnected from the network. Turned out to be that when there are multiple pending notifications while the device is disconnected from the network, it will only received single notification (which is the latest one) once the device has been reconnected to the network. I found this informative discussion on stackoverflow which explains why this is happening https://stackoverflow.com/questions/59765657/fcm-device-receives-only-one-of-multiple-notification-messages

This is the expected behavior by the firebase cloud messaging push notification feature and there is no way to configure this behaviour. However, I found an alternative solution to this, by using the local-notification plugin https://github.com/NativeScript/plugins/tree/master/packages/local-notifications. By using this plugin, the app can programmatically create a notifications out of the messages payload sent from the firebase server and this perfectly works. Below is the actual code on this project.

https://github.com/RoiJS/ReSerBiz/blob/9f9ddb67f18947c7d7a1ef60226da272a9438b4b/ReserbizAPP/src/app/_services/push-notification.service.ts#L23-L58

@RoiJS RoiJS closed this as completed May 5, 2021
Reserbiz automation moved this from Ready for Development to Done May 5, 2021
@RoiJS RoiJS mentioned this issue Aug 23, 2021
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request technical task regular instructions
Projects
Development

No branches or pull requests

1 participant