Code Monkey home page Code Monkey logo

Comments (9)

morinel avatar morinel commented on July 21, 2024

Do you see the notification being delivered to the device or simulator? Check with adb logcat and grep for GCM

from gcmpush.

m1ga avatar m1ga commented on July 21, 2024

I'm testing on device but I don't see anything when I try the broadcast.
When I use just the registrationID its working and I get:

[TRACE] GCMBroadcastReceiver: onReceive: com.google.android.c2dm.intent.RECEIVE
[TRACE] GCMBroadcastReceiver: GCM IntentService class: nl.vanvianen.android.gcm.GCMIntentService
[TRACE] GCMBaseIntentService: Intent service name: GCMIntentService--3
[DEBUG] GCMIntentService: (IntentService[GCMIntentService--3]) [2342648,2343767] Push notification received
[DEBUG] GCMIntentService: (IntentService[GCMIntentService--3]) [1,2343768] Message key: from value: xxx
[DEBUG] GCMIntentService: (IntentService[GCMIntentService--3]) [0,2343768] Message key: collapse_key value: do_not_collapse
[ERROR] GCMIntentService: (IntentService[GCMIntentService--3]) [23,2343791] drawable.notification_icon not found; make sure it's in platform/android/res/drawable
[ERROR] GCMIntentService: (IntentService[GCMIntentService--3]) [0,2343791] Invalid setting priority, should be int, between PRIORITY_MIN (-2) and PRIORITY_MAX (2)
[DEBUG] GCMIntentService: (IntentService[GCMIntentService--3]) [5,2343796] Message received but no message so will make this silent
[INFO]  Push callback = {"data":{"from":"xxx","collapse_key":"do_not_collapse"}}
[INFO]  AppCompatDelegate: The Activity's LayoutInflater already has a Factory installed so we can not install AppCompat's
[TRACE] GCMBroadcastReceiver: onReceive: com.google.android.c2dm.intent.RECEIVE
[TRACE] GCMBroadcastReceiver: GCM IntentService class: nl.vanvianen.android.gcm.GCMIntentService
[TRACE] GCMBaseIntentService: Intent service name: GCMIntentService--4
[DEBUG] GCMIntentService: (IntentService[GCMIntentService--4]) [68213,2412009] Push notification received
[DEBUG] GCMIntentService: (IntentService[GCMIntentService--4]) [0,2412009] Message key: from value: xxx
[DEBUG] GCMIntentService: (IntentService[GCMIntentService--4]) [0,2412009] Message key: title value: The title to send
[DEBUG] GCMIntentService: (IntentService[GCMIntentService--4]) [0,2412009] Message key: message value: The message to send
[DEBUG] GCMIntentService: (IntentService[GCMIntentService--4]) [0,2412009] Message key: collapse_key value: do_not_collapse
[ERROR] GCMIntentService: (IntentService[GCMIntentService--4]) [63,2412072] Invalid setting priority, should be int, between PRIORITY_MIN (-2) and PRIORITY_MAX (2)
[DEBUG] GCMIntentService: (IntentService[GCMIntentService--4]) [8,2412080] Creating notification...
[INFO]  GCMIntentService: (IntentService[GCMIntentService--4]) [10,2412090] Group: MyNotificationGroup
[INFO]  GCMIntentService: (IntentService[GCMIntentService--4]) [1,2412091] LocalOnly: false
[INFO]  GCMIntentService: (IntentService[GCMIntentService--4]) [0,2412091] Priority: 0
[INFO]  GCMIntentService: (IntentService[GCMIntentService--4]) [6,2412097] Vibrate: true
[INFO]  GCMIntentService: (IntentService[GCMIntentService--4]) [1,2412098] Insistent: true
[INFO]  Push callback = {"data":{"message":"The message to send","from":"xxx","collapse_key":"do_not_collapse","title":"The title to send"}}

it won't stop vibrating until I click the message, if I set vibrate to false it won't vibrate once.

So I guess the problem is the php script, not your module

from gcmpush.

morinel avatar morinel commented on July 21, 2024

Set insistent: false (the default), that will stop the vibrating

from gcmpush.

morinel avatar morinel commented on July 21, 2024

The last line of your log file shows the code that will be triggered when the notification is delivered while the app is in the foreground. Please add e.g. an AlertDialog to show something on the screen.

from gcmpush.

morinel avatar morinel commented on July 21, 2024

Oh, and also note the line:

Message received but no message so will make this silent

Add a message to your server-sent notification data (instead of title)

from gcmpush.

m1ga avatar m1ga commented on July 21, 2024

I have a title:

[DEBUG] GCMIntentService: (IntentService[GCMIntentService--4]) [0,2412009] Message key: title value: The title to send
[DEBUG] GCMIntentService: (IntentService[GCMIntentService--4]) [0,2412009] Message key: message value: The message to send

and it was displayed in the notification. Dialog is working, too.

But only when I send it to the ID directly. But as I said, that might be the problem of the php script since this is working now

from gcmpush.

m1ga avatar m1ga commented on July 21, 2024

my bad!

I thought the "group" was the gcm subscriber (https://developers.google.com/android/reference/com/google/android/gms/gcm/GcmPubSub). That is the group the php script uses but it's not implemented in your plugin. Would be a nice feature!

from gcmpush.

m1ga avatar m1ga commented on July 21, 2024

#8
need to make some adjustments but it will subscribe to a group and you can send push messages to a group now

from gcmpush.

morinel avatar morinel commented on July 21, 2024

Thanks, I've incorporated your changes, edited them and changed some of the callbacks slightly. I also trimmed down the Google Play JAR file to prevent incompatibilities with e.g. ti.maps.

Version 1.2 has been released.

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.