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

Push Notification Does Not Alert When Meteor App Is Active #12

Closed
panw opened this issue Dec 29, 2014 · 7 comments
Closed

Push Notification Does Not Alert When Meteor App Is Active #12

panw opened this issue Dec 29, 2014 · 7 comments

Comments

@panw
Copy link

panw commented Dec 29, 2014

Hi Morten,

I finally got the bar notification working for Android. However, I notice that when I am on the Meteor app the notification does not trigger until I am on a different app or the phone is locked.

Is this an intended behavior?

@raix
Copy link
Collaborator

raix commented Dec 29, 2014

Push.addListener('message', function(msg) {}); will fire when the app is open - msg is still dependent on platform - I would rather like a uniform consistent behaviour.

Push.addListener('startup', function(msg) {}); will fire if app is opened via a click on notification.

So I've been using different techniques to do this in some of the production apps we've made - but I would like the api to be unified.

@panw
Copy link
Author

panw commented Dec 30, 2014

Sorry, I'm not certain how to use the listeners to enable notifications while active on the app. Could you please shed some light on this?

I added the listener for messages and startup and they trigger properly based on the event, but the parameter passed in seems to be empty.

Thanks

@ndevr
Copy link

ndevr commented Jan 7, 2015

BTW: Notifications (alerts) for iOS also not work.

@dennisharrison
Copy link
Collaborator

@ndevr Do you mean when the app is open? They aren't supposed to.

Are the listeners not working? I haven't tested them yet - will be there later this week though.

@ndevr
Copy link

ndevr commented Jan 8, 2015

@dennisharrison Yes, when die app is open.

There are no listeners registered. I thought there are pre-registered some.

https://github.com/raix/push/blob/master/docs/ADVANCED.md

@panw
Copy link
Author

panw commented Jan 17, 2015

According to thread #13 @raix mentions that this is expected behavior

@panw panw closed this as completed Jan 17, 2015
@omsharma007
Copy link

use this

Push.addListener('alert', function(notification) `{`
     alert( 'App is running in foreground' );
    });

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

5 participants