-
Notifications
You must be signed in to change notification settings - Fork 212
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
First notification comes from the wrong side (doesn't go to setNotificationWillShowInForegroundHandler) #509
Comments
UPDATE ::: |
I have the same problem like you, I posted before but I couldn´t explain it well, thank you, I hope some one can help us. |
@massimilianochiodi @hugoyair Thanks for reporting! Could you provide the following details.
|
log says that my app is in backgroud, show notification, but I´m focus into of the app. 2- Huawei p40 lite, android 10 3- I don´t know exactly, I don´t have a iphone or ipad to tested it. But only first time.
|
Mine is a particular situation. Problem only occurs with the first foreground notification. However, I can also send a log.
(Normally ask 5-6 seconds for receive OneSignal Player Id, This is important because I have to put the player id in the header of webapp)
In initstate have function 'configuraonesignal();'
With 'setNotificationWillShowInForegroundHandler' receive foreground notification ad show alert with title, body and take payload for make an action ( url redirect in webview ) With 'setNotificationOpenedHandler' ( notification when app closed or app in background ) only take 'payload' for make redirect.
An Observatory debugger and profiler on SM A325F is available at: http://127.0.0.1:53246/jb-UiywBzHc=/ ^^^^^^ famous 6 seconds to wait to receive the playerid D/OneSignal(12382): UserStateSynchronizer internalSyncUserState from session call: true jsonBody: {"app_id":"94f0852d-50d9-40dd-986d-c63b800ab731","device_os":"11","timezone":3600,"timezone_id":"Europe/Rome","language":"it","sdk":"040603","sdk_type":"flutter","android_package":"com.fairfieldmarketplace.app_dev","device_model":"SM-A325F","game_version":11,"net_type":0,"carrier":"Iliad","rooted":false,"identifier":"do-Tm1RmQb-ypAzBaUvmdJ:APA91bFePQ6ZVMDQdQllteAGDOO08b-bKP3zb940cQ-nbA4USLZ1WNCV4b-9VCPfhlmTGjeBusrBPKV6Oz8TYSkKSbeZboHmcRH9-JFt_-WlcTSpuxSnokE5rCufizTfoKx2o7l6u5hU","device_type":1} ^^^^^^^ first notification received just after installing the app for the first time D/OneSignal(12382): Running destroyTimeout with runnable: com.onesignal.OSNotificationReceivedEvent$1@452777e ^^^^^^^ Clicked the notification (in the notification area of the phone) I/WM-WorkerWrapper(12382): Worker result SUCCESS for Work [ id=e0f2a3de-3df1-46d3-b271-0b9417657d3c, tags={ com.onesignal.OSNotificationRestoreWorkManager$NotificationRestoreWorker } ] ^^^^^^^^ after the first notification received with the app in the foreground all the others (even when you have closed the application), all come from setNotificationWillShowInForegroundHandler I/flutter (12382): OSNotificationReceivedEvent complete with notification: null |
I avoid sending you the flutter doctor log. I still don't have chance to try app on IOS yet. I hope in next few days. |
problem is reproduced on all these android models Android 11 Moto Moto g 10 |
So, android version is not the problem, maybe It´s about lifecycle :/ |
From @marcoberetta96:
|
if some have the solution please can you provide it to me same issue is happening with me. |
I´m waiting for a solution, but I have been using it and It doesn´t go to the setNotificationWillShowInForegroundHandler, I thought It was only first time, but now sometimes It´s wrong. |
I personally don't see where the problem is. only the first notification received when you install the app has this defect, all subsequent ones are handled correctly. Obviously, when you do tests, maybe starting debug for app is always the first notification received, so it seems that behavior is always wrong. |
Same issue, notification is not being received by the setNotificationWillShowInForegroundHandler, only after setNotificationOpenedHandler is initialized, setNotificationWillShowInForegroundHandleris being triggered. Thank you |
Steps to reproduce the problem:
(Only after triggering setNotificationOpenedHandler, setNotificationWillShowInForegroundHandler is being triggered) Device- realme |
flutter doctor |
In which version is it stable, in which version none of these problems occur ? |
I have the same problem with |
no idea, I think in does not work in any version, the problem/bug is in the code of @OneSignal package itself cause in other three different android devices same problem occurred. |
Developers any updates?? |
This is critical. Version 3.2.7 is not working. |
I have the same problem with setNotificationWillShowInForegroundHandler , any updates?? |
I have the same problem |
Just use firebase messaging that is not solved yet
…On Sun, 30 Jan, 2022, 5:45 pm Buğra, ***@***.***> wrote:
I have the same problem
—
Reply to this email directly, view it on GitHub
<#509 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQ664NR3IQZ6HNGKMW4WHCDUYUTXRANCNFSM5IDVA77A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
Is there any updates related to this problem? I am facing the same problem with one signal flutter sdk. Did someone find a temporary workaround to this issue? |
Everything seems to work now. For all of those who might need this, you should pull the one signal package from github repo. Thanks for the support |
Sure ?
Nooo. Have a little problem only with first notification received ( after
app is installed for first time, or cancel and reinstall) app receive how
app is closed. Isn’t a problem… U can work with notifications anyway …
If not receive any please verify in log if receive firebase token and
receive firebase notification… or re-control your onesignal settings
Il giorno mar 15 feb 2022 alle 19:19 Marlen ***@***.***> ha
scritto:
Still not working for me . . .
—
Reply to this email directly, view it on GitHub
<#509 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALAHUG2JTVBCHWSZEKNLZTTU3KKMRANCNFSM5IDVA77A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Massimiliano Chiodi
<https://nexid.it/>
Nexid srl <https://nexid.it/>
Via Fabio Filzi 27, 20124 - Milano - MI
tel: 02 2666 490
ATTENZIONE: Le informazioni trasmesse sono da intendere solo per la persona
e/o ente a cui sono indirizzate, possono contenere documenti confidenziali
e/o materiale riservato. Qualsiasi modifica, inoltro, diffusione o altro
utilizzo, relativo alle informazioni trasmesse, da parte di persone e/o
enti, diversi dai destinatari indicati, è proibito ai sensi del D.Lgs
196/03. Se lei ha ricevuto questa mail per errore, per favore contatti il
mittente e cancelli queste informazioni da ogni computer.
DISCLAIMER: The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential and/or
privileged material. Any review, retransmission, dissemination or other use
of, or taking of any action in reliance upon, this information by persons
or entities other than the intended recipient is prohibited (D.Lgs 196/03).
If you received this in error, please contact the sender and delete the
material from any computer.
|
Hi everyone, there is a fix for this in #534 but there has been no If you are trying the GitHub repo directly to test, please let us know if the issue is not fixed for you. |
@nan-li any idea when can we have this as an OneSignal-Flutter-SDK release? thanks |
@nan-li i tried it and it worked with Huawei |
@nan-li I also tried with the GitHub repo and the problem was solved! Thanks! P.S. Small bug: the subtitle of the notification even if set is always null. |
@nan-li Thanks ! Tried with github repo and it works! Below is what I did on the my app pubspec.yaml |
This has been released in OneSignal-Flutter-SDK 3.3.0. |
I think some developers surrounded together and said, guys what can we do to pester other developers and then create this plugin. Actually, after I see I can't change and set the sound of the notification I decided to play a sound when I got a notification manually, but guess what? Yes, we can't find when we get a notification when we are in the background. :D |
@alirezat66 iOS is very limited in what you can do in the background, especially if you are trying to modify a notification before it display with app code. Apple only allow modifying a notification if you setup a Notification Service Extension target, this code can only be written in Swift or Objective-C. For you custom sound use case you can configure it before you send notification with this guide: |
This worked for me |
Description:
In Android, first notification get (application in FOREGROUND) is as if the app is in 'Background' or 'Closed', the first notification comes via 'OneSignal.shared.setNotificationOpenedHandler(OSNotificationOpenedResult result) {' ...
The next ones arrive in the right place: 'OneSignal.shared.setNotificationWillShowInForegroundHandler (OSNotificationReceivedEvent event) {'
Luckily, when app is in background or app is closed, notification arrives at right place...
Environment
Flutter (Channel stable, 2.5.3, on macOS 12.0.1 21A559 darwin-x64, locale it-IT)
Android toolchain - develop for Android devices (Android SDK version 31.0.0)
Android Studio (version 2020.3)
OneSignal Flutter ^3.2.6
Steps to Reproduce Issue:
Anything else:
(crash stacktraces, as well as any other information here)
No crash, only firt notification comes from the wrong side
The text was updated successfully, but these errors were encountered: