google-cloud-messaging

WakefulBroadcastReceiver onReceive not triggering android GCM

十年热恋 提交于 2019-12-20 06:07:10
问题 I implemented GCM notifications in Android and everything was working fine. I'm sending Notifications to the phone via a PHP server using the Google Cloud Messaging Service. After a week or so I installed that app again on my phone and send a test notification onto my phone but I got nothing. The PHP script runs without any error with success=1 and no cononical id's in the GCM response. WakufulBroadcastReceiver isn't triggered in the android app. Here is the complete code that I am using:

Android GCM: not sending notification when device is idle.

眉间皱痕 提交于 2019-12-20 06:07:09
问题 GCM notifications are not being received when my device is idle. They all come through at once when the device is woken up. Here is the code that sends the message to GCM: Sender sender = new Sender(API_KEY); Message message = new Message.Builder().addData("type","newRequest").delayWhileIdle(false).build(); MulticastResult results = sender.send(message, devices, 5); Here is my GCMIntentService class: public class GCMIntentService extends GCMBaseIntentService{ public static final String SENDER

Android GCM: not sending notification when device is idle.

半城伤御伤魂 提交于 2019-12-20 06:06:56
问题 GCM notifications are not being received when my device is idle. They all come through at once when the device is woken up. Here is the code that sends the message to GCM: Sender sender = new Sender(API_KEY); Message message = new Message.Builder().addData("type","newRequest").delayWhileIdle(false).build(); MulticastResult results = sender.send(message, devices, 5); Here is my GCMIntentService class: public class GCMIntentService extends GCMBaseIntentService{ public static final String SENDER

WakefulBroadcastReceiver onReceive not triggering android GCM

为君一笑 提交于 2019-12-20 06:06:51
问题 I implemented GCM notifications in Android and everything was working fine. I'm sending Notifications to the phone via a PHP server using the Google Cloud Messaging Service. After a week or so I installed that app again on my phone and send a test notification onto my phone but I got nothing. The PHP script runs without any error with success=1 and no cononical id's in the GCM response. WakufulBroadcastReceiver isn't triggered in the android app. Here is the complete code that I am using:

Do Android GCM registration ids always start with “APA”?

心不动则不痛 提交于 2019-12-20 05:57:20
问题 In my app I have different devices registered and for the Android ones I am storing the GCM Registration Id and for the iOS I am storing the device token (push notifications). I want to distinguish when a device is iOS or Android. What is the easiest way to do it? Do Android GCM RegIds start always with string "APA"? 回答1: In short no. If you need to distinguish between Android and iOS clients, include a platform identifier (eg: platform: Android) along with the InstanceID token when sending

Android GCM send and MismatchSenderId

為{幸葍}努か 提交于 2019-12-20 05:13:08
问题 The odd thing is that notifications were working before. So I'm not sure what happened. I tried reinstalling my app to the device, but nothing changed. {"multicast_id":xxxxxxxxxxxxxxxxxxx,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"MismatchSenderId"}]} Because this was working at one point, I know I am using the correct keys. I even triple checked based on other SOF threads I came across. What could be the potential problem now? I've looked around for a few days now and I'm

FIrebase Cloud Messaging, cannot resolve dependency com.google.firebase:firebase-core:9.0.2

若如初见. 提交于 2019-12-20 05:12:08
问题 I was trying to write an application using Firebase Cloud Messaging as per the guidelines given here, but I'm struck in adding the dependency for implementing FCM (com.google.firebase:firebase-core:9.0.2). Every time I try to add it via project structure, it won't list the dependency in the search results. When I try to add it in app level gradle, it gives me an error that the dependency cannot be resolved. I don't know where I'm going wrong but please help me out with this. 回答1: Download

Server side GCM returns error 400

荒凉一梦 提交于 2019-12-20 04:23:36
问题 I am tring to implement GCM. I wrote a test code to understand how it works, but I keep getting error 400 in the response. I'm writing in Java (JDK 7). I followed this toturial on the subject. I modified the given code there, and changed the use of ObjectMapper to Gson. This is my code for the Data object: public class Data { private ArrayList<String> registration_ids; public Data() { this.registration_ids = new ArrayList<String>(); this.registration_ids.add("APA91..."); // There is the real

GCM push notification for background app causes crash

微笑、不失礼 提交于 2019-12-20 04:15:28
问题 I stumbled about a problem to receive GCM messages if my app runs in background (Service). In my scenario, I don't receive the GCM message (please notice it is not about how to receive GCM in general like here) and the ActivityManager kills the app. So I wonder if I have a conceptual misunderstanding or if it is a general problem. Background I have an Android application that runs in foreground (Activity) and background (Service). The application is attached to a persistent notification to

Android GCM server sent but GCM not pushing to device

允我心安 提交于 2019-12-20 02:52:19
问题 I am testing GCM on my cell phone. (2.3.6 android). Manifest file (MainActivity, First and Second activity do not do anything, they are there for some other testing purpose, not interfering with GCM). <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.testconnectionapp" android:versionCode="1" android:versionName="1.0" > <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name=