Code Monkey home page Code Monkey logo

Comments (8)

morinel avatar morinel commented on July 21, 2024

Sure, use gcm.getLastData() when the app starts or resumes to retrieve the data from the last push notification and act accordingly in your app. See the example for how this could work.

from gcmpush.

lawjeremy avatar lawjeremy commented on July 21, 2024

What I'd like to do is pop up a notification while the app is still closed, prompting them to open it. Is this possible?

from gcmpush.

morinel avatar morinel commented on July 21, 2024

Well, the notification will be shown in the normal way (either at the top, or as a alertbox you have to click to open the app / dismiss it) If you click it, the app will open / resume and then you should use gcm.getLastData() to do anything specific to process the data in the notification itself.

from gcmpush.

lawjeremy avatar lawjeremy commented on July 21, 2024

The problem I'm having is that I don't get anything on my device (in the tray or an alert) from the push until I open the app.

from gcmpush.

morinel avatar morinel commented on July 21, 2024

Do you see the notification being received by the app in logcat?

from gcmpush.

lawjeremy avatar lawjeremy commented on July 21, 2024

My app is allowed to show notifications. I don't see anything in logcat that looks like a notification, what should I be looking for?

from gcmpush.

morinel avatar morinel commented on July 21, 2024

Search for "Push notification received" for log category GCMIntentService.

from gcmpush.

lawjeremy avatar lawjeremy commented on July 21, 2024

Digging through logcat helped me find the problem

[ 07-02 20:52:56.441 25483:25502 D/GCMIntentService ]
(IntentService[GCMIntentService--1]) [5,647] Message received but no message so will make this silent

I had my message key in the payload capitalized

"Message": "Hello World"

There's half a day I'll never get back. Thanks for all your help!

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.