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

Get notifications in the status bar when the app is running #696

Open
mbachaalani opened this issue Sep 9, 2016 · 2 comments
Open

Get notifications in the status bar when the app is running #696

mbachaalani opened this issue Sep 9, 2016 · 2 comments

Comments

@mbachaalani
Copy link

Hello,

I am able only to receive a notification on the status bar when the app is in the background. In the old plugin there was a possibility to receive it in the background and foreground in the status bar by using the following:

if(!window.plugins) {
window.plugins = {};
}
if (!window.plugins.pushNotification) {
window.plugins.pushNotification = new PushNotification();
}
window.plugins.statusBarNotification.notify(data.tag,data.title,data.message);

But in the latest push plugin I cannot use the above because I have to pass a options parameter when I use new PushNotification() which I don't know what it should be. (I tried to pass android attribute with the project id as object but still it did not work).

Any help would be appreciated.
Thank you.

@alouane
Copy link

alouane commented Nov 3, 2016

I ended by doing a very dirty job, go to GCMintentService.java & add this line createNotification(context, extras); you will have something like this:
extras.putBoolean("foreground", true); PushPlugin.sendExtras(extras); createNotification(context, extras);

But right now I'm trying to fix notifications display when the app is not running , do you have a fix to this issue?

@coolvasanth
Copy link

If you're using ionic then below plugin will help you.
http://ionicframework.com/docs/native/local-notifications/

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

3 participants