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

App open from PushNotification click without payload #26

Open
cjadhav opened this issue Mar 5, 2016 · 4 comments
Open

App open from PushNotification click without payload #26

cjadhav opened this issue Mar 5, 2016 · 4 comments

Comments

@cjadhav
Copy link

cjadhav commented Mar 5, 2016

Hi,

Thanks a lot for the module.
It is working great.
I am facing 2 issues here,

  1. I am not getting the payload(method) on clicking on notification. Its just opens the application.
    Can you help to get the payload received in particular notification??
  2. I can see only last notification in notification tray, even though i sent 3. It receives all the time. But shows only the last..
    Is there any setting we have to while initialization??

Your help is highly appreciated.

@DFoxinator
Copy link

Did you ever find the answers to these questions? I have the same questions.

@morinel
Copy link
Owner

morinel commented Apr 30, 2016

If you specify a callback function when registering for push notifications, this method will be called. The single parameter it takes contains all payload data received from the notification. See the example for details.

@DFoxinator
Copy link

@morinel thanks for the response. I have tried the callback, but I'm confused about the actual flow/what it's supposed to do. In my app, the callback gets called right when the push notification arrives. But I want it to be called/something to be called when the actual notification is tapped from the notification list in the pull-down Android menu.

The actual problem I'm having is this - right now I'm relying on gcm.getLastData() on the resume event to try to make something happen when my app is opened/brought to the foreground via a notification tap. But I can't figure out how to differentiate that tap from just opening the app normally, where in that case gcm.getLastData should not be used since it wouldn't make sense to act on the notification contents.

Any help is greatly appreciated. I've been trying for a while to get a flow of notification tap opens content in my app, but I haven't had much luck (it works, but there's weirdness like when you receive a notification but then open the app through the icon instead of the notif, etc.).

@morinel
Copy link
Owner

morinel commented May 1, 2016

After gcm.getLastDate() returned any data you'd like to use in your app, use gcm.clearLastData() to remove it so it won't return any data the next time the app is resumed.

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