react-native-local-notifications icon indicating copy to clipboard operation
react-native-local-notifications copied to clipboard

Local Notifications not working

Open ronastlelobo opened this issue 6 years ago • 21 comments

I used RNLocalNotifications.createNotification(1, 'Some text', '2017-01-02 12:30', 'default'); in my componentwillmount component. Local notifications are not triggering.

ronastlelobo avatar Oct 12 '18 09:10 ronastlelobo

This might be related to: https://github.com/wumke/react-native-local-notifications/issues/17#issuecomment-429258405

wumke avatar Oct 12 '18 11:10 wumke

i have the same problem

Noor0 avatar Dec 18 '18 08:12 Noor0

Have you made the changes suggested in the issue that i mentioned above?

wumke avatar Jan 09 '19 07:01 wumke

readme is updated... is your problem solved? what was the issue?

wumke avatar Jan 25 '19 15:01 wumke

I have the same...

ithustle avatar Feb 11 '19 12:02 ithustle

I've tested the latest release available on npm in a fresh RN project, should work...

wumke avatar Feb 11 '19 12:02 wumke

@wumke , can you provide a functional example?

ithustle avatar Feb 11 '19 12:02 ithustle

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

ithustle avatar Feb 11 '19 12:02 ithustle

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.").

wumke avatar Feb 11 '19 12:02 wumke

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 ..

ithustle avatar Feb 11 '19 13:02 ithustle

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.

wumke avatar Feb 11 '19 13:02 wumke

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...

ithustle avatar Feb 11 '19 15:02 ithustle

After strugglying for couple hours and nothing, I decide to switch to react-native-push-notification, its working perfectly.

@wumke thanks for your time.

ithustle avatar Feb 11 '19 16:02 ithustle

Is this problem solved? I'm having the same issue too. I'm adding 3 minutes from the current time but nothing happen.

TerrerSandman avatar Feb 18 '19 13:02 TerrerSandman

@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 avatar Feb 18 '19 13:02 wumke

@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.

testProject.zip

TerrerSandman avatar Feb 18 '19 14:02 TerrerSandman

any news?

I see the alarm icon, but the notification does not appear and there is no sound. (Android 5.1)

Ilario17 avatar Mar 05 '19 11:03 Ilario17

@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?

wumke avatar Mar 06 '19 10:03 wumke

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.

Screenshot_1557137764

Do anyone have any workaround to solve this issue?

Thanks

akhilsanker avatar May 06 '19 10:05 akhilsanker

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.

wumke avatar May 10 '19 08:05 wumke

Please, see your code in:

RNLocalNotifications.setAndroidIcons("ic_launcher", "mipmap", "ic_launcher", "mipmap");

Your code can be searching an image that do not exist.

maikvinicius avatar Aug 28 '19 17:08 maikvinicius