-
Notifications
You must be signed in to change notification settings - Fork 219
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
setNotificationOpenedHandler does not executes when app is terminated/not opened at all #540
Comments
yes, I'm also having this issue. Is there any solution for this? |
Same error i am getting. |
We all get errors like that. |
Any solution for this |
Same issue here, any update on this ? |
Hi all, Thank you for reporting this issue. Can you share the device information for this? Is it on Android and/or iOS? Type of phone, for example Huawei, etc. |
Thanks for replay @nan-li. I got this issue on iOS iPhone XR. |
For me it was on Android, although I don't think this is a device specific issue and believe that this feature has not even been implemented in the SDK for flutter. |
Any updates? |
@marcorubagotti We are still investigating the issue and working on a fix. I apologize for the delay and thank you for your patience |
Any updates? |
Any updates on this? |
To workaround:
After the app is loaded, the handler will run as expected. |
I also have this issue and the workaround above does not work, as the notification handler (passed to Device: Poco X3 NFC, Android 11 (MIUI 12.5.8) Did this ever work? Is this a bug or just missing functionality? |
Not sure what to tell you, mine works doing exactly what I said.
Whether it's a cold boot from a notification, where the app starts from
zero, or whether it's already in memory, I get my data through in the
handler and everything is working as expected.
Can paste some code this week if that'd give an indication of how mine
works?
…On Sat, 30 Jul 2022, 09:09 Alex Baker, ***@***.***> wrote:
I also have this issue and the workaround above does not work, as the
notification handler (passed to setNotificationOpenedHandler is never
called if the app is opened from a notification.
Did this ever work? Surely this is core functionality?
—
Reply to this email directly, view it on GitHub
<#540 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADM6KXTTN3ENX7IN3OL5KJTVWUSPLANCNFSM5P73X63A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Just thought, you're not running AdBlock or anything similar on the device?
I've had issues before when that was enabled.
Also, are you setting up the handler in main.dart before MaterialApp gets
executed?
…On Sat, 30 Jul 2022, 11:09 Dave Shirman, ***@***.***> wrote:
Not sure what to tell you, mine works doing exactly what I said.
Whether it's a cold boot from a notification, where the app starts from
zero, or whether it's already in memory, I get my data through in the
handler and everything is working as expected.
Can paste some code this week if that'd give an indication of how mine
works?
On Sat, 30 Jul 2022, 09:09 Alex Baker, ***@***.***> wrote:
> I also have this issue and the workaround above does not work, as the
> notification handler (passed to setNotificationOpenedHandler is never
> called if the app is opened from a notification.
>
> Did this ever work? Surely this is core functionality?
>
> —
> Reply to this email directly, view it on GitHub
> <#540 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ADM6KXTTN3ENX7IN3OL5KJTVWUSPLANCNFSM5P73X63A>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
|
Yeah I have all the onesignal initialisation stuff before Nothing like AdBlock running (though that is an interesting idea). @daveshirman if you do have code you could share it would be very much appreciated (no rush!), maybe I've missed something. |
@alexobviously To keep this ticket cleaner, I moved my workaround over to my site, in case you still wanted it: https://www.codingandclimbing.co.uk/blog/flutter-onesignal-additionaldata-on-app-start |
@daveshirman i have follow your workaround as explained in your site. Like @alexobviously the handler works in all cases except when the app is closed. |
Not sure what to tell you. It works for me on both iOS and Android.
Without being able to see your code compared to mine, I couldn't possibly
help.
…On Mon, 5 Sept 2022, 04:16 marcorubagotti, ***@***.***> wrote:
@daveshirman <https://github.com/daveshirman> i have follow your
workaround as explained in your site. Like @alexobviously
<https://github.com/alexobviously> the handler works in all cases except
when the app is closed.
May can depend on how I have configured the routes and home settings in
MaterialApp() ?
—
Reply to this email directly, view it on GitHub
<#540 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADM6KXXX4G5QB6JTRXMTVETV4WT4DANCNFSM5P73X63A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Thanks for your code by the way @daveshirman. I tried exactly your example with my own onesignal config and it didn't work. So that confirms that there's some very mysterious, potentially device-specific bug (although we have tested on a fairly wide range of devices and none of them worked). |
So strange. I've tested this on a range of physical devices, iOS and
Android, from IPhone 6s through to 11 on the latest iOS and Android 13
even. No problems. Cold boot works as described on my post. I'm literally
using in production and all is well with several apps.
There must be something different in the setup between our code bases or
package versions maybe?
When you say you tried my example, did you literally just take my code
including the App() wrapper widget class and add some test pages instead of
PageCalendar etc?
…On Mon, 5 Sept 2022, 08:51 Alex Baker, ***@***.***> wrote:
Thanks for your code by the way @daveshirman
<https://github.com/daveshirman>. I tried exactly your example with my
own onesignal config and it didn't work. So that confirms that there's some
very mysterious, potentially device-specific bug (although we have tested
on a fairly wide range of devices and none of them worked).
The only other possibility is that we have miscommunicated at some point
so I'll just clarify for anyone who comes after this (hopefully someone
from onesignal):
The issue is that when apps are cold booted from a notification, i.e. they
are opened from a completely closed state by tapping a onesignal
notification, the handler is not called when the app opens.
—
Reply to this email directly, view it on GitHub
<#540 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADM6KXWQTKE4FCBFWBBOOADV4XUGRANCNFSM5P73X63A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@daveshirman i have reviewed your workaround and the logic work but on app closed, when i tap the notification the context or navigationKey.currentState return null when try to navigate on a simple page. I have implemented the navigationKey and onGenerateRoute logic but not work |
Just for anyone who thinks my workaround doesn't work at all, here's a video of it literally working. This behaviour is identical on Android and this is a production app from TestFlight. What's happening:
|
I noticed this problem on Xiaomi Note 10s (Android 11 MIUI 12.5.9), but on another device Xiaomi Note Pro 8 (Android 10 MIUI 12.0.5) everything works fine. I also checked on emulator (Android 11 ) and everything works |
@daveshirman I am also work pretty well in the same condition like you. But when I swipe and remove this notification message and didn't get this data anymore. Do u have any solution for this case. |
I'm sorry, I don't understand your question. Could you rephrase or give an
example please, so I can try to help?
…On Fri, Nov 18, 2022 at 5:41 AM Thet Paing ***@***.***> wrote:
@daveshirman <https://github.com/daveshirman> I am also work pretty well
in the same condition like you. But when I swipe and remove this
notification message and didn't get this data anymore. Do u have any
solution for this case.
—
Reply to this email directly, view it on GitHub
<#540 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADM6KXUP4GTAHFR7LYOL6LTWI5MNZANCNFSM5P73X63A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Please, someone responsible for the project, pay attention to this issue. It is very important that it is possible to execute commands when ANY notification is received, regardless of whether the application is in foreground or background or even closed. On Android I have this option. But I'm migrating my app to Flutter and I'm missing that option. Flutter is becoming too relevant for the OneSignal package to be ignored. cc: |
Hello! Do I need to use another push service to route to a specific page while clicking on a push message in Terminated state? Or has anyone else solved it? |
Closing issue as stale. If this is still happening in 2024 feel free to tag me to reopen |
setNotificationOpenedHandler works very well when app is in background or in focus, but when app is swiped away i.e terminated by the user, This listener is not being called so I'm not able to access notification additional data.
I'm testing this with Flutter 2.10.1 and Onesginal SDK 3.2.8
I hope I'm clear, please help!
The text was updated successfully, but these errors were encountered: