emekalites / react-native-alarm-notification

schedule alarm and local notification in react-native
https://www.npmjs.com/package/react-native-alarm-notification
MIT License
225 stars 95 forks source link

keeps ringing when App is close #82

Closed Zeroxys closed 2 years ago

Zeroxys commented 4 years ago

Hello @emekalites thanks for this amazing package you save my life :) I encounter a issue when the app is closed :

When the app is running in the background (minimized) and I swipe the message it stops ringing.

When The app is completely closed however, I receive the alarm, the phone starts ringing but it continues ringing after I swip the message away. Only solution is to open the app and close it completely otherwise the phone continues ringing.

otherwise if I press the notification and the app is completely closed this listener never fired it

DeviceEventEmitter.addListener("OnNotificationOpened", async function (e) {
        console.log(e)      
});

I'm doing something wrong ?

emekalites commented 4 years ago

Hi @Zeroxys I would like to know if you updated your AndroidManifest.xml. The plugin is designed to stop alarm from ringing after dismissing the notification.

stale[bot] commented 3 years ago

Hola! So here's the deal, between open source and my day job and life and what not, I have a lot to manage, so I use a GitHub bot to automate a few things here and there. This particular GitHub bot is going to mark this as stale because it has not had recent activity for a while. It will be closed if no further activity occurs in a few days. Do not take this personally--seriously--this is a completely automated action. If this is a mistake, just make a comment, DM me, send a carrier pidgeon, or a smoke signal.

laurent22 commented 3 years ago

@Zeroxys, did you find a fix for this? Several users of my apps have also reported this issue (for example here). My AndroidManifest.xml is the same as in the doc. Any idea what could be the issue?

laurent22 commented 3 years ago

@emekalites, I can replicate this bug consistently on emulator too using these steps:

My AndroidManifest.xml is exactly as described in the installation section. Do you know by any chance what might be the issue? Is there perhaps some code that should also be added to MainApplication.java to make the alarm stop?

For reference, this is the bug report from one of our users: https://github.com/laurent22/joplin/issues/4086

nguyenxuankiet262 commented 3 years ago

I have same issue. I think the issue was caused when you press on the notification but don't press dismiss button

stale[bot] commented 3 years ago

Hola! So here's the deal, between open source and my day job and life and what not, I have a lot to manage, so I use a GitHub bot to automate a few things here and there. This particular GitHub bot is going to mark this as stale because it has not had recent activity for a while. It will be closed if no further activity occurs in a few days. Do not take this personally--seriously--this is a completely automated action. If this is a mistake, just make a comment, DM me, send a carrier pidgeon, or a smoke signal.

laurent22 commented 3 years ago

still a major issue

vishva-shukla commented 3 years ago

I'm facing the same issue any solution?

easiestripes commented 3 years ago

any updates on this? because this is still a big problem for users

roman-r-m commented 3 years ago

The problem is here: https://github.com/emekalites/react-native-alarm-notification/blob/a1d30361db60a82b97279a583540f4f08cf4948a/android/src/main/java/com/emekalites/react/alarm/notification/AlarmDismissReceiver.java#L15

If the app is not running there's no react context so the alarm is not cancelled because there's no else for this if

@emekalites are you accepting pull requests? I can fix this and 2 or 3 other issues I've found,

MohammedMaaz commented 3 years ago

Hi @roman-r-m Were you able to fix this issue by modifying the above code accordingly?

roman-r-m commented 3 years ago

Well, I ended up rewriting a significant part of Android code because there were several bugs in there, not just this one. I'm not going to bother submitting a PR as this repo seems abandoned and my PR will be closed by the bot.

The code is here: https://github.com/roman-r-m/joplin-rn-alarm-notification

Note that I have only looked at functions that are needed to the app I'm working on (Joplin), some parts of the code aren't tested and may not work properly.

MohammedMaaz commented 3 years ago

Thanks for this @roman-r-m

roman-r-m commented 3 years ago

Just to be clear - I am not going to support this package for general usage, so if you decide to use it, be aware of this.

MohammedMaaz commented 3 years ago

No problem. Thanks for informing though.

stale[bot] commented 3 years ago

Hola! So here's the deal, between open source and my day job and life and what not, I have a lot to manage, so I use a GitHub bot to automate a few things here and there. This particular GitHub bot is going to mark this as stale because it has not had recent activity for a while. It will be closed if no further activity occurs in a few days. Do not take this personally--seriously--this is a completely automated action. If this is a mistake, just make a comment, DM me, send a carrier pidgeon, or a smoke signal.

laurent22 commented 3 years ago

Still there

stale[bot] commented 2 years ago

Hola! So here's the deal, between open source and my day job and life and what not, I have a lot to manage, so I use a GitHub bot to automate a few things here and there. This particular GitHub bot is going to mark this as stale because it has not had recent activity for a while. It will be closed if no further activity occurs in a few days. Do not take this personally--seriously--this is a completely automated action. If this is a mistake, just make a comment, DM me, send a carrier pidgeon, or a smoke signal.

stale[bot] commented 2 years ago

Closed due to inactivity. Holler if this is a mistake, and we'll re-open it.

yoursinger commented 2 years ago

Just to be clear - I am not going to support this package for general usage, so if you decide to use it, be aware of this.

thank u,yours is work for me!