-
Notifications
You must be signed in to change notification settings - Fork 565
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
Avoid taking control of UNUserNotificationCenter (Closes #206, closes #256) #268
Avoid taking control of UNUserNotificationCenter (Closes #206, closes #256) #268
Conversation
I see the motivation and agree those referenced issues should be resolved. But removing notification management it's not best way to do, because it will stop displaying debug notifications when app is in foreground. You can argue, "hey who is needing those", but my reply would be, we need a fix that target both issues. |
Maybe we can enable those in debug mode only |
d9370e9
to
6df9a81
Compare
Okay so I've changed it to be enabled in debug mode only - and also then - give FCM a chance. It keeps the previous delegate pointer. |
Merged. Thank you! |
Backport from react-native Origin-PR: mauron85/react-native-background-geolocation#268 Contributed-By: @danielgindi
@mauron85, has this been made available in an official version on npmjs for cordova-plugin-mauron85-background-geolocation? |
yes, not remember which version exactly, but check changelog
…On Fri, Sep 14, 2018 at 5:06 PM rudiminty ***@***.***> wrote:
@mauron85 <https://github.com/mauron85>, has this been made available in
an official version on npmjs for
cordova-plugin-mauron85-background-geolocation?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#268 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAV8GtEnUttrmyonYq_RJvO_2j3z9wG7ks5ua8X2gaJpZM4WDnI6>
.
|
The reason why I ask is that I used 3.0.0 alpha 42 but still find that on iOS push notifications in the foreground are not handled correctly. Could this issue be responsible for such behaviour? |
There's a problem with the iOS >= 10 condition to set the delegate of the
UNUserNotificationCenter
.What it does is take control of the
UNUserNotificationCenter
, and the user has no chance to change it back.The effect is that every push notification also shows when the app is in foreground, which is undesired in most case.
This should be left to the user to define a
delegate
if he desires, and send the notifications to the foreground (and the logic in the delegate is defaulted anyway.)Edit:
This also fixes Firebase notifications, as Firebase also registers for the delegate and take control from there.