Code Monkey home page Code Monkey logo

Comments (4)

DFoxinator avatar DFoxinator commented on July 21, 2024

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

from gcmpush.

morinel avatar morinel commented on July 21, 2024

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.

from gcmpush.

DFoxinator avatar DFoxinator commented on July 21, 2024

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

from gcmpush.

morinel avatar morinel commented on July 21, 2024

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.

from gcmpush.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.