Open ilyasarafathemvigo opened 10 months ago
@Nightsd01 @Jeasmine please go through the bug. I have the same issue
@ilyasarafathemvigo Thank you for reporting we are investigating
@ilyasarafathemvigo @EM-Sabeel I am not able to reproduce this issue, but I did notice some incorrect behavior when using "hot reload". It seemed that when I changed the behavior in the foreground display listener it wasn't being respected unless I did a full app reload instead of a hot reload. Are you not able to get preventDefault() to work even on full reloads? Also ensure that you aren't calling notification.display() after preventDefault()
Without hot reload am getting this error @emawby
Hi @ilyasarafathemvigo, We haven't been able to reproduce, can you answer some additional questions?
addForegroundWillDisplayListener
?I have the same problem when preventDefault is called after an async time gap. Is this a bug or intended behaviour?
Hi @christofkost,
You must call preventDefault
by the time the callback returns. This is intended behavior as the listener cannot know about the async logic you plan to do later.
Same issue here, I want receive notification but not to show that notification so i must use event.preventDefault(); but even after this i am still getting notification . This is the code that i am using: OneSignal.Notifications.addForegroundWillDisplayListener((event) async { event.preventDefault(); final jsonrep = event.notification.jsonRepresentation(); final json = jsonDecode(jsonrep); print(json); //awesome_notifications await NotificationUtils().createLocalInstantNotification(json); }); @emawby , If you got some solution please inform @nan-li @christofkost @ilyasarafathemvigo @EM-Sabeel .
What happened?
onesignal_flutter 5.0.4 using this SDK version after calling this preventDefault() function still notification is showing
Steps to reproduce?
What did you expect to happen?
No need to show the particular notification after calling this function (preventDefault(+)
OneSignal Flutter SDK version
5.0.4
Which platform(s) are affected?
Relevant log output
No response
Code of Conduct