-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Hide foreground notification with --variable on iOS #913
base: master
Are you sure you want to change the base?
Conversation
… foreground on iOS Also add a foreground variable to true in the payload when the notification is received in the foreground
… iOS platform only
Looking at the comments on #835 it looks like using |
@wildhart |
What's your iOS device version ? I'm testing on a iPad 4 mini, iOS 12.0.1
Did you put a breakpoint in the function in XCode ? Does it go through ? I can't easily do that - I'm actually compiling the iOS app on a VM. I can get the app to run on the iOS simulator but notifications don't really work on the simulator, but I do get the callback when the app comes into the foreground. However, when I upload to TestFlight, then on my iPad Mini the notifications come through whether the app is open or not. With or without changing Sorry, my setup is not very typical, but other commentators on #835 report the same problem. |
This definitely works as expected - good work 👍 |
Any update on this please? |
Yo @XavierBesnault ! FYI, I opened a new PR that covers this as well. I took your idea one step further and made it configurable via API method instead of using config.xml setting. We should only merge one of these, either yours or mine. Take a look and let me know what you think! |
Was inspired by #835
Install the plugin with
cordova plugin add cordova-plugin-firebase --variable IOS_HIDE_FOREGROUND_NOTIFICATION="true"
to hide notifications on iOS when foreground.Also added a value
foreground: "true"
in the notification payload for both Android and iOS when the notification is received in foreground to be able to manage this specific case in the Javascript side, especially useful when the notification is hidden.