react-native-local-notifications
react-native-local-notifications copied to clipboard
Local Notifications not working
I used RNLocalNotifications.createNotification(1, 'Some text', '2017-01-02 12:30', 'default');
in my componentwillmount component. Local notifications are not triggering.
This might be related to: https://github.com/wumke/react-native-local-notifications/issues/17#issuecomment-429258405
i have the same problem
Have you made the changes suggested in the issue that i mentioned above?
readme is updated... is your problem solved? what was the issue?
I have the same...
I've tested the latest release available on npm in a fresh RN project, should work...
@wumke , can you provide a functional example?
Here is my code:
index.js
import RNLocalNotifications from 'react-native-local-notifications';
...
componentDidMount() {
RNLocalNotifications.createNotification(1, 'Some text', '2017-01-02 12:30', 'default');
}
I followed the doc installation ... Maybe I missed something... I don't know I'm testing on emulator
Notice that we are in the year 2019 by now... dates in the past are blocked!
Try current date, time and add 5 minutes.
Close your app or bring it to background (did you read: "NOTIFICATIONS WILL NOT BE SHOWN WHEN YOUR APP IS IN THE FOREGROUND.").
Does it will only works if I add 5 minutrd on time? Because I add 2 minutes and didn't work. Now I'm waiting for next 5 minutes added ..
Should work with any future datetime no 5 minute limit, can you check the log files in android studio, they should tell you what's wrong when the trigger gets set or arrives.
On emulator seems it doesn't trigger the notifications but in real device, the app crashs. I cannot to see logcat because my android studio is drives me crazy...
After strugglying for couple hours and nothing, I decide to switch to react-native-push-notification, its working perfectly.
@wumke thanks for your time.
Is this problem solved? I'm having the same issue too. I'm adding 3 minutes from the current time but nothing happen.
@TerrerSandman : Platform? react native version? library version? Can you make a zip file of your project with only the relevant code? any error logs?
@wumke
react-native v0.57.7 react-native-local-notifications v2.0.0
There is no error logs. See the sample zip I've reproduced.
any news?
I see the alarm icon, but the notification does not appear and there is no sound. (Android 5.1)
@TerrerSandman : sorry, but the coming months I dont have time to investigate things, just moved to a new house with a lot of things to fix...
@Ilario17 : What do you mean exactly by 'see the alarm icon'? Is this the icon in the status bar? Is your app on foreground when the notification triggers?
Tried in api 28 and in 26 (both tried with app in background). With api 28, nothing happens. But in api 26 at the notification time getting a alert as the stops working.
Do anyone have any workaround to solve this issue?
Thanks
Read your log files in android studio, they will show you exactly whats wrong. Also try latest version from git (which is often an improvement) instead of npm version.
Please, see your code in:
RNLocalNotifications.setAndroidIcons("ic_launcher", "mipmap", "ic_launcher", "mipmap");
Your code can be searching an image that do not exist.