google-cloud-messaging

App crashes on received gcm message when it's closed

可紊 提交于 2020-01-07 07:13:46
问题 When my app is closed (i.e swiped off by the user from the App Switching menu), it crashes in onMessageReceived() . Here's onMessageReceived() : @Override public void onMessageReceived(String from, Bundle data) { String message = data.getString("message"); from = data.getString("sender"); File notificationsFile = Constants.getNotificationsFlagFile(); ... } It crashes on that last line, giving a null pointer exception : 08-13 21:15:25.535 23201-23216/com.example.myapp E/AndroidRuntime﹕ FATAL

GCM messages not getting delivered to Chrome Packaged Apps(offline mode)

本秂侑毒 提交于 2020-01-07 04:32:05
问题 I am using https://github.com/ToothlessGear/node-gcm to send message using GCM to chrome packaged apps. Everything works fine if chrome app is running When I am sending the message while chrome app is closed, those messages are not delivered after starting the app. I do get the message_id in the result at server. I also tried using command line, facing the same problem in command line too. Code at server side(nodejs) var GCM = require('node-gcm'); var gcmSender = new GCM.Sender(apiKey); var

Unable to receive messages from GCM

不羁的心 提交于 2020-01-07 03:05:36
问题 am developing an android app that uses GCM to send and receive messages. am able ro register my app with GCM and receive GCM Registration Token. but am not being notified upon receiving new messages.(seems like nothing is hapenning in my MyGcmListenerService class.) i can only see my new messages upon reloading my chat user Interface(that is clicking the back button and then clicking again my chat button. nothing is taking place in my MyGcmListenerService.java !!!!) below are my classes and

Unable to receive messages from GCM

自古美人都是妖i 提交于 2020-01-07 03:05:15
问题 am developing an android app that uses GCM to send and receive messages. am able ro register my app with GCM and receive GCM Registration Token. but am not being notified upon receiving new messages.(seems like nothing is hapenning in my MyGcmListenerService class.) i can only see my new messages upon reloading my chat user Interface(that is clicking the back button and then clicking again my chat button. nothing is taking place in my MyGcmListenerService.java !!!!) below are my classes and

IO Exception while accessing Google Cloud message?

℡╲_俬逩灬. 提交于 2020-01-07 02:28:25
问题 I have written the code for GCM both in server and Android. I am getting the Registration ID successfully.But I am not able to register to GCM,while making a post to register it shows an IO exception.I have used Android hive tutorial for this.I have gmail id and registration id with me and also created a Url to post.Any idea please share with me.Thanks in advance 回答1: These are the line of code that creates the exception: int status = conn.getResponseCode(); if (status != 200) { throw new

GCM registrationId is not received on phonegap push plugin

孤街醉人 提交于 2020-01-07 02:22:16
问题 Couple days ago I had an issue with getting APNS token instead of GCM token while using phonegap push plugin. Well, I changed setup, I've put senderID in [ios] block, recompiled the app. Now I dont get ANY regustrationId at all on Iphone. It still works fine on Android. Can anyone tell me what can be a problem? Here is setup of plugin: var push = PushNotification.init({ android: { senderID: "8225....8910" }, ios: { senderID: "8225....8910", alert: "true", badge: "true", sound: "false" },

GCM registrationId is not received on phonegap push plugin

半世苍凉 提交于 2020-01-07 02:22:14
问题 Couple days ago I had an issue with getting APNS token instead of GCM token while using phonegap push plugin. Well, I changed setup, I've put senderID in [ios] block, recompiled the app. Now I dont get ANY regustrationId at all on Iphone. It still works fine on Android. Can anyone tell me what can be a problem? Here is setup of plugin: var push = PushNotification.init({ android: { senderID: "8225....8910" }, ios: { senderID: "8225....8910", alert: "true", badge: "true", sound: "false" },

How to use generated API key in GCM code android

你说的曾经没有我的故事 提交于 2020-01-06 20:05:47
问题 I want to integrate GCM in android application for which I have registered my application and enabled GCM service on google developer console also created the API key. Where to put this API key in android code ? Any help appreciated. 回答1: You don't have to use api key in android code. You have to use this api key at server side to send notifications and use project number in android code to register device for GCM and obtain unique device id for receiving notifications. STEPS TO USE GCM

ios pod install gcm

荒凉一梦 提交于 2020-01-06 19:31:35
问题 Can't install google gcm with pod. Getting this error: [!] The 'Pods-project' target has transitive dependencies that include static binaries: (/Users/mirzadelic/Projekti/project/Pods/GGLInstanceID/Libraries/libGGLInstanceIDLib.a, /Users/mirzadelic/Projekti/project/Pods/Google/Libraries/libGGLCloudMessaging.a, /Users/mirzadelic/Projekti/project/Pods/Google/Libraries/libGGLCore.a, /Users/mirzadelic/Projekti/project/Pods/GoogleCloudMessaging/Libraries/libGcmLib.a, /Users/mirzadelic/Projekti

ios pod install gcm

给你一囗甜甜゛ 提交于 2020-01-06 19:31:21
问题 Can't install google gcm with pod. Getting this error: [!] The 'Pods-project' target has transitive dependencies that include static binaries: (/Users/mirzadelic/Projekti/project/Pods/GGLInstanceID/Libraries/libGGLInstanceIDLib.a, /Users/mirzadelic/Projekti/project/Pods/Google/Libraries/libGGLCloudMessaging.a, /Users/mirzadelic/Projekti/project/Pods/Google/Libraries/libGGLCore.a, /Users/mirzadelic/Projekti/project/Pods/GoogleCloudMessaging/Libraries/libGcmLib.a, /Users/mirzadelic/Projekti