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

Local Notification is not working

Open atifaziz1 opened this issue 5 years ago • 10 comments

node version: 10:14:1 react-native version: 0.57.8 android version: lollipop 5.1

I am getting error in MainActivity.java when i run react-native run-android NotificationManager nMgr = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); error is in Context

then i remove Context, working fine but local notification is not triggering. I followed step by step procedure, everything is fine. Please let me know about this issue.

Thanks.

atifaziz1 avatar Jan 05 '19 17:01 atifaziz1

Did you also include import android.content.Context; at the top of your MainActivity file?

wumke avatar Jan 07 '19 09:01 wumke

Did you also include import android.content.Context; at the top of your MainActivity file?

i was missed this import , after import local notification is not triggering.

atifaziz1 avatar Jan 08 '19 17:01 atifaziz1

Does https://github.com/wumke/react-native-local-notifications/issues/17 solve your issue?

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 issue: {PATH}\testapp\android\app\src\main\java\com\testapp\MainActivity.java:19: error: cannot find symbol NotificationManager nMgr = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); ^ symbol: class NotificationManager location: class MainActivity

VitalieStirbu avatar Feb 08 '19 21:02 VitalieStirbu

@atifaziz1 and @VitalieStirbu add this import android.app.NotificationManager;.

By the way, notifications doesn't work. I'm using the sample code described on readme and got nothing.

Any help?

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 Thanks for this nice package. can you plz add an example project?

rashidul-hasan avatar Aug 21 '19 08:08 rashidul-hasan

@rashidul-hasan everything you need to configure is mentioned in the readme, usage examples are also included.

Full buildable example projects require updates for each RN version, which makes it a hell to maintain the repository! Also, I try to minimize the size of my repo's, that means not including things unless absolutely needed...

wumke avatar Aug 21 '19 09:08 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