React-native-push-notification: Background functions (when app terminated-kill) + push notifications

Created on 7 Jun 2020  ·  13Comments  ·  Source: zo0r/react-native-push-notification

Hi @jgarber @jgarber @idris @peterp @cancan101 ,
I need your help, my mission is to create push notifications and also the ability to perform functions using those push notifications.
That means even when the app is in kill or terminated or reboot mode it can always get the functions fired.
Like, for example, if I want to update data on the local database or perform any operations without involving the user.
So in summary: the task is to also receive push notifications and to perform functions in the background even if the app is not open -kill or even after reboot .
it's very important to me

All 13 comments

Hi, I also have the same issue(Android). The method onNotification didn't fired after remove/kill the app from recent stack.

Hi,
Did you out the .configure() outside of a component ?
This is the main reason of not getting onNotifiaction fired.
Look at the example folder.

Same here with IOS. Everything works on the first run, but when killed the app process, everything stop working on the foreground.

Hi @willnaoosmit for iOS, there is other issue with partial solution.
But this is not the right repository:
https://github.com/react-native-community/push-notification-ios

@Dallas62 Can you send me a link of the issue? Thanks for the help!

@Dallas62 Can you send me a link of the issue? Thanks for the help!

1453

@roei133 did you find the solution / set up?

@Dallas62 it is not specifically stated in the Readme and doc of the library or maybe I missed out on reading. Does this library support local notifications / scheduled local notification when the app is in terminated mode / background mode?

Asking because currently I am using RNFirebase-v5 for now and trying to find out the capabilities of this library first :D Thanks!

I find my solution, i moved on to react native cli. Unfotunatly expo cant
do much as cli so i got my solution with this step.

בתאריך יום ג׳, 16 ביוני 2020, 18:18, מאת Aung Myint Thein ‏<
[email protected]>:

@roei133 https://github.com/roei133 did you find the solution / set up?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/zo0r/react-native-push-notification/issues/1468#issuecomment-644831567,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABTRHTQNJXRQJRVGPJ5C6GLRW6ENBANCNFSM4NW6YAEQ
.

I do my service with push notifications from firebase.

בתאריך יום ג׳, 16 ביוני 2020, 19:37, מאת Roei It ‏roei133@gmail.com:

I find my solution, i moved on to react native cli. Unfotunatly expo cant
do much as cli so i got my solution with this step.

בתאריך יום ג׳, 16 ביוני 2020, 18:18, מאת Aung Myint Thein ‏<
[email protected]>:

@roei133 https://github.com/roei133 did you find the solution / set up?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/zo0r/react-native-push-notification/issues/1468#issuecomment-644831567,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABTRHTQNJXRQJRVGPJ5C6GLRW6ENBANCNFSM4NW6YAEQ
.

@roei133 did you find the solution / set up?

@Dallas62 it is not specifically stated in the Readme and doc of the library or maybe I missed out on reading. Does this library support local notifications / scheduled local notification when the app is in terminated mode / background mode?

Asking because currently I am using RNFirebase-v5 for now and trying to find out the capabilities of this library first :D Thanks!

Hi @Aung-Myint-Thein

I'm not sure to understand your needs ?
This library allow you to trigger local and scheduled notifications. If you have a task like the Background Handler from RNFirebase V5, you can trigger notification into it.

Thanks for replies. My question is if this library can trigger local
notifications after the app is killed by some schedule 🙂 Thanks.

On Tue, 16 Jun 2020 at 11:36 PM, Boris Tacyniak notifications@github.com
wrote:

@roei133 https://github.com/roei133 did you find the solution / set up?

@Dallas62 https://github.com/Dallas62 it is not specifically stated in
the Readme and doc of the library or maybe I missed out on reading. Does
this library support local notifications / scheduled local notification
when the app is in terminated mode / background mode?

Asking because currently I am using RNFirebase-v5 for now and trying to
find out the capabilities of this library first :D Thanks!

Hi @Aung-Myint-Thein https://github.com/Aung-Myint-Thein

I'm not sure to understand your needs ?
This library allow you to trigger local and scheduled notifications. If
you have a task like the Background Handler from RNFirebase V5, you can
trigger notification into it.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/zo0r/react-native-push-notification/issues/1468#issuecomment-644893502,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAEVQDQHW7VM4EBJUOTPXBTRW6RBJANCNFSM4NW6YAEQ
.

>

Sent from Gmail Mobile

@Dallas62 Could you reply on the question by @Aung-Myint-Thein please ? For our project it would be crucial to always receive local scheduled notifications - regardless of a reboot.

I tried to test this by checking out the example project, tabbed on "Schedule Notification in 30s" and switched off the device immediately. After reboot I did not receive the scheduled message. But maybe it is possible and I didnt configure it the right way? I used the default configuration and removed the RNPushNotificationListenerService from Manifest and set requestPermission to false (cause I think is has to do with remote notifications).

Thank you!

Hi @raphaelrupprecht

Has you probably notice during your test, the answer is: no

On iOS I think there is no way to achieve this since there is no boot event trigger in the Application.
On Android a workaround could be implemented if you search on stackoverflow for boot event, but will be platform specific and not implemented in this library.

If you need consistent notifications, I suggest you remote notifications.
An hybrid approach would be to use a data notification to plan scheduled notifications every x hours. This could lead to undelivered notifications but could work in many cases.

Was this page helpful?
0 / 5 - 0 ratings