Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local Notification is not working #19

Open
atifaziz1 opened this issue Jan 5, 2019 · 10 comments
Open

Local Notification is not working #19

atifaziz1 opened this issue Jan 5, 2019 · 10 comments

Comments

@atifaziz1
Copy link

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.

@wumke
Copy link
Owner

wumke commented Jan 7, 2019

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

@atifaziz1
Copy link
Author

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.

@wumke
Copy link
Owner

wumke commented Jan 9, 2019

Does #17 solve your issue?

@wumke
Copy link
Owner

wumke commented Jan 25, 2019

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

@VitalieStirbu
Copy link

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

@ithustle
Copy link

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

@wumke
Copy link
Owner

wumke commented Feb 11, 2019

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

@rashidul-hasan
Copy link

@wumke Thanks for this nice package. can you plz add an example project?

@wumke
Copy link
Owner

wumke commented Aug 21, 2019

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

@maikvinicius
Copy link

Please, see your code in:

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants