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

[question][Android]: Kill app and reopen, setNotificationWillShowInForegroundHandler not called when has new notification #1450

Closed
1 task done
bakhiem opened this issue Nov 8, 2022 · 6 comments

Comments

@bakhiem
Copy link

bakhiem commented Nov 8, 2022

How can we help?

On android, when I kill app, and reopen it right away, setNotificationWillShowInForegroundHandler not called when has new notification. OneSignal log show:
Waiting for remote params. Moving onAppLostFocus() operation to a pending task queue.
And
App is in background, show notification

And after 2 min, it work again:
image

How can i make it run right after opening the app, without having to wait more than 2 minutes?

It happen on Onesignal ver 4.3.4 & RN 0.65.3

Code of Conduct

  • I agree to follow this project's Code of Conduct
@bakhiem bakhiem changed the title [question]: Kill app and reopen, setNotificationWillShowInForegroundHandler not called when has new notification [question][ANDROID]: Kill app and reopen, setNotificationWillShowInForegroundHandler not called when has new notification Nov 8, 2022
@bakhiem bakhiem changed the title [question][ANDROID]: Kill app and reopen, setNotificationWillShowInForegroundHandler not called when has new notification [question][Android]: Kill app and reopen, setNotificationWillShowInForegroundHandler not called when has new notification Nov 8, 2022
@adilkhan2163
Copy link

same here any solution?

@adilkhan2163
Copy link

i am facing almost same issue with setNotificationWillShowInForegroundHandler some time it fired and some time not,
but initially it is not working but when I restart the app then it is fired, but in both cases I got notification on notification bar, and no listener working even setNotificationOpenedHandler is also not working.
and I got this data from getdevicestate
{"hasNotificationPermission": true, "isEmailSubscribed": false, "isPushDisabled": false, "isSMSSubscribed": false, "isSubscribed": true, "pushToken": "my token show", "userId": "my id "}

@adilkhan2163
Copy link

adilkhan2163 commented Nov 16, 2022

i have tested it on latest and previous version above 4.+.+ and my react native version is 0.63.5

@jkasten2
Copy link
Member

jkasten2 commented Dec 1, 2022

@adilkhan2163 Can you share your code, where you setup OneSignal and your call to setNotificationWillShowInForegroundHandler, including your callback code.

Can you also enabled OneSignal VERBOSE logging and share your full logcat so all the events can be investigated?

@harshalrandhe
Copy link

harshalrandhe commented Sep 4, 2023

Same issue here : After the app was installed and opened for the first time setNotificationWillShowInForegroundHandler function is not working The notification is received in the notification bar instead of the handler, but when you kill the app and restart it it start working

@jennantilla
Copy link
Contributor

Hello everyone, since it has been quite some time since this issue has seen any responses, I'm going to close as stale. If anyone is still experiencing issues, please @ mention me and we will be happy to give it fresh eyes. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants