google-cloud-messaging

How to get gcm.notification.body field in gcm push notification payload

这一生的挚爱 提交于 2019-12-13 04:23:06
问题 I'm making set of scripts in kotlin for testing push notifications in order to refactor notification-related legacy code. I need to send post request to gcm server with such payload that would result in notification that arrives at my phone containing field "gcm.notification.body" and I cant seem to be able to do it. Currently I'm trying to figure out the payload by using Postman. "Closest" I got is "gcm.notification.data" and "fcm.notification.body". First with this request body: { "to":

When I click on notification in status bar, application is not launching

北慕城南 提交于 2019-12-13 04:22:31
问题 I try to develop an application which use GCM library, but when I click on notification in status bar, application is not launching... Here is my source code in my GCMIntentService class: private static void generateNotification(Context context, String message) { int icon = R.drawable.ic_launcher; long when = System.currentTimeMillis(); NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); Notification notification = new

Use notification ID to change logo & text

懵懂的女人 提交于 2019-12-13 04:21:06
问题 I'd like to know how applications like Facebook change their notification title & logo depending on the content. For example, in Facebook, if you get tagged you get another title & another logo. I assume it should be possible with notify to create a unique notification. Though I can't find any clear examples for this. My GenerateNotification: private static void generateNotification(Context context, String message, String url) { int icon = R.drawable.ic_launcher; long when = System

GCM - multiple notifications

人走茶凉 提交于 2019-12-13 04:15:11
问题 I am using Google Cloud Messaging (one way only, i.e. server to client) to receive Push-notifications. I am receiving these, and at first everything was fine, but now, after a bit over a week, I get multiple notifications; 3 on one device, and 7 on the other. My theory is that the devices register with different ids, and thus get multiple notifications. But why can that be? I am using Googles sample Android project, adapted it to mine, but can't see what would cause these multiple

GoogleCloudMessaging Unauthorized Error 401

非 Y 不嫁゛ 提交于 2019-12-13 03:56:17
问题 I try to create project with use GoogleCloudMessaging to recieve push - notifications from my remote server. For client i use google tutorial Implementing GCM Client. For server i use this realization on php, but after i started php script, i got an error: Unauthorized Error 401 Here is my php code: $url = 'https://android.googleapis.com/gcm/send'; $serverApiKey = "778688687533"; // sender id (Project Number) $reg = "APA91bFFWLYsX8TK_XiGQJeUkHb_7FJZwZBSdnNEdxzQEQ-ijpmVvwBPxaz3wQPmWy_K6YAIYt1x

GCM Invalid JSON Missing Payload

ぃ、小莉子 提交于 2019-12-13 03:38:25
问题 I am trying to send messages through Google Cloud Messaging, using Python sleekXMPP. I tried to follow the sample in the GCM docs. However, I am getting an "InvalidJson : MissingPayload" error response (400) when I call send_command . What am I missing here? The following is the code that I use. def random_id(): return ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(8)) class GcmNotifier(sleekxmpp.ClientXMPP): def __init__(self, jid, password): super(GcmNotifier,

Error receiving BroadcastReceiver messages

送分小仙女□ 提交于 2019-12-13 03:37:57
问题 I have a BroadcastReceiver, implemented in an Activity Class, which accepts incoming messages via Google Cloud Message. I want to use this class as a chat, so after i have incoming messages, I use a void: public void Chatpat(String name, String message){ chatinput.add(name); chatinput.add(message); Chat chat_data[] = new Chat[chatinput.size()]; chatinput.toArray(); ChatAdapter adapter = new ChatAdapter(this, R.layout.listview_item_row, chat_data); chatList = (ListView) findViewById(R.id

gcm push messages are not received

放肆的年华 提交于 2019-12-13 03:18:55
问题 I am using GCM for android, a sample code given on androidhive.com.I am able to store data in a database but it is not not able to push data. I am new to this code. so please help me the same. My connection java file and corresponding php file along with the logcat messages is shown below--- Error log- 11-07 16:55:42.306: E/Trace(1025): error opening trace file: No such file or directory (2) 11-07 16:55:43.146: D/libEGL(1025): loaded /system/lib/egl/libEGL_emulation.so 11-07 16:55:43.166: D/

Android phonegap send push notification using Google Cloud Messaging using php

给你一囗甜甜゛ 提交于 2019-12-13 02:56:16
问题 I have developed the android application in cordova 3.4 now I want to get the automatic notification to their mobile. For this I refer websites as below http://devgirl.org/2013/07/17/tutorial-implement-push-notifications-in-your-phonegap-application/ http://devgirl.org/2012/10/25/tutorial-android-push-notifications-with-phonegap/ https://github.com/hollyschinsky/PushNotificationSample30/tree/master/platforms/android I read all above links then did all stuff they told like create project on

How do I perform a large query in google app engine?

风流意气都作罢 提交于 2019-12-13 02:39:16
问题 I have collection of apps that total almost 1 million users. I am now adding a push notification system using Google cloud messaging to create alerts. My database contains an entity with the GcmId and app name (ex. "myApp1"). Now, I want to send a GCM message to all users of "myApp1". The objectify documents do not describe the .limit function well though. For example, from the GCM demo app: List<RegistrationRecord> records = ofy().load().type(RegistrationRecord.class).limit(10).list(); will