wumke / react-native-local-notifications

Manageable local notifications for React Native on iOS and Android.
MIT License
84 stars 33 forks source link

Local Notifications not working #18

Open ronastlelobo opened 5 years ago

ronastlelobo commented 5 years ago

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

wumke commented 5 years ago

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

Noor0 commented 5 years ago

i have the same problem

wumke commented 5 years ago

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

wumke commented 5 years ago

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

ithustle commented 5 years ago

I have the same...

wumke commented 5 years ago

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

ithustle commented 5 years ago

@wumke , can you provide a functional example?

ithustle commented 5 years ago

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

wumke commented 5 years ago

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

ithustle commented 5 years ago

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

wumke commented 5 years ago

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.

ithustle commented 5 years ago

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 commented 5 years ago

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

@wumke thanks for your time.

TerrerSandman commented 5 years ago

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

wumke commented 5 years ago

@TerrerSandman : Platform? react native version? library version? Can you make a zip file of your project with only the relevant code? any error logs?

TerrerSandman commented 5 years ago

@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

Ilario17 commented 5 years ago

any news?

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

wumke commented 5 years ago

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

akhilsanker commented 5 years ago

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

wumke commented 5 years ago

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.

maikvinicius commented 4 years ago

Please, see your code in:

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

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