Skip to content
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

fix cancelAlarm on android #957

Merged
merged 1 commit into from
Apr 10, 2018
Merged

fix cancelAlarm on android #957

merged 1 commit into from
Apr 10, 2018

Conversation

matttti
Copy link
Contributor

@matttti matttti commented Apr 10, 2018

I noticed that firebase.notifications().cancelAllNotifications() has no effect on android phones. All scheduled notifications still appear. The propsed change fixes this. It was "inspired" by https://stackoverflow.com/questions/35341682/cancel-the-scheduled-android-notification/35342066#35342066

I noticed that firebase.notifications().cancelAllNotifications() has no effect on android phones. All scheduled notifications still appear. The propsed change fixes this. It was "inspired" by https://stackoverflow.com/questions/35341682/cancel-the-scheduled-android-notification/35342066#35342066
@chrisbianca chrisbianca merged commit 6edb37b into invertase:master Apr 10, 2018
@chrisbianca
Copy link
Contributor

Great catch! Thanks for highlighting and submitting the PR - we'll get this into the 4.0.1 release

@matttti matttti deleted the patch-1 branch April 10, 2018 14:16
@ghost
Copy link

ghost commented Apr 11, 2018

@chrisbianca - I am not able to remove delivered notification with notificationId also. I am using this for Android OS. I have updated the react-native-firebase to 4.0.1 The code flow that I am using -

const notificationOpen: NotificationOpen = await firebase.notifications().getInitialNotification();
await firebase.notifications().removeDeliveredNotification(notificationOpen.notification._notificationId);
const notificationOpenAgain: NotificationOpen = await firebase.notifications().getInitialNotification();

I am still able to access notification from notificationOpenAgain.notification with the same notification ID. Not sure, if this is an expected behaviour, or a bug, since documentation doesn't explicitly states that. Please let me know if you need any more information from me. Thanks!

@chrisbianca
Copy link
Contributor

@credifiable removeDeliveredNotification will prevent the notification from showing in the native device tray any more. getInitialNotification will always be populated with the notification that was used to start the app - there is no way to clear this by design.

@hanzoow
Copy link

hanzoow commented Jul 9, 2020

hi @matttti , can you show me how to save your changes into this repo and make sure that after npm install i still got my own changed codes back ? ex i call removeDeliveredNotificationsByTag function from native in dist folder in node_modules after npm install. I did fork this repo and try to find the function that i can make some changes into but i can't. So how we can save changes in react-native-firebase in node_modules and then if another devices use npm install, there will be my changes ? Plz help i need it really bad !

@mikehardy
Copy link
Collaborator

@hanzoow patch-package https://github.com/ds300/patch-package - it's fantastic

@hanzoow
Copy link

hanzoow commented Jul 9, 2020

@hanzoow patch-package https://github.com/ds300/patch-package - it's fantastic

hi ! after generate react-native-firebase+5.6.0 file, what should i do next with this file ? Please guide me

@mikehardy
Copy link
Collaborator

I will not guide you. You will read the patch-package documentation.

@hanzoow
Copy link

hanzoow commented Jul 9, 2020

I will not guide you. You will read the patch-package documentation.

yeah thank you for the recommend ! i did it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants