google-cloud-messaging

What is multicast_id in GCM response?

不想你离开。 提交于 2019-12-12 12:31:51
问题 Example scenario: I'm sending message to several devices using GCM. The response contains "multicast_id"? How can I use this value? Thanks. 回答1: It's just an identifier. multicast_id Unique ID (number) identifying the multicast message. There is no use for that ID, unless you wish to save it in your DB as a kind of "receipt" from Google, but the individual message_id s returned for each message that wasn't rejected by Google are much better as a receipt (since they indicate Google actually

Does Google Cloud Messaging send messages to devices that are in standby mode?

随声附和 提交于 2019-12-12 12:07:37
问题 If an Android device is in standby mode, in which the screen is off, can Google Cloud Messaging send a message to that device? Or does GCM have to wait until the device comes out of standby mode in order to receive messages? In the docs it states: Google enqueues and stores the message in case the device is offline. When the device is online, Google sends the message to the device. There is no indication however what is meant by offline or online . Is a device still online even though its

How to handle GCM Notifications when different GCM notifications receive

自作多情 提交于 2019-12-12 10:23:33
问题 I am using GCM Notification in my app.I parse the data in " onMessageReceived " method where i get some unique "URL" corresponding to GCM Message.When I receive single notification Every thing is fine,But when i receive multiple notifications problem occurs when i tap any notification last received notification url loads. public void onMessageReceived(String from, Bundle data) { String message = data.getString("message"); String country = data.getString("country"); String url = data.getString

Google Cloud Messaging: How to use SHA1 certificate?

流过昼夜 提交于 2019-12-12 10:06:56
问题 I have a doubt. I developed an Android App which receives push notifications via Google Cloud Messaging. Here are the steps I took: Creation of new Project on Google Developer console and copy/paste my Project Number in my android app. Registration of my App through RegID previously received by Google Cloud Messaging. Result: Ok! My App appears in database on my server. Copying/paste Api Key in my Server. I obtained my Api Key from Google Developer Console (Projcet/API/Credential/New API Key)

Mobile Backend handle continuous queries in background

こ雲淡風輕ζ 提交于 2019-12-12 10:04:39
问题 I'm using Mobile Backend Starter in my app, and I'm able to continuously receive data using this code: CloudCallbackHandler<List<CloudEntity>> handler = new CloudCallbackHandler<List<CloudEntity>>() { @Override public void onComplete(List<CloudEntity> results) { Logger.log(MainActivity.this, "onComplete"); } @Override public void onError(IOException e) { Logger.log(MainActivity.this, e); } }; CloudQuery cq = new CloudQuery("Test"); cq.setLimit(50); cq.setSort(CloudEntity.PROP_UPDATED_AT,

GcmBroadcastReceiver onReceive method not fired on Android 4.0.3

这一生的挚爱 提交于 2019-12-12 09:54:17
问题 I am writing an Android 4.0.3 program with GCM support. The app registers fine and sending a message from the server also seems to work (getting "success" from Google with a message id), however the onReceive method on my BroadcastReceiver doesn't get fired for some reason. Here is the manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.jlieberman.nightwatch" android:versionCode="1" android:versionName="1.0" >

Using GCM on both Android and iOS without a notification payload

无人久伴 提交于 2019-12-12 09:35:31
问题 I want to implement push notifications on both Android and iOS with Google Cloud Messaging. I don't want to use the notification key in my payload because the Android behavior is not ideal. On Android, I would prefer my receiver to always get triggered with the data payload, and I can construct the Notification myself using NotificationCompat . If you use the notification payload on Android, you have no control over the notification style, for example. However, if I only send a data payload,

Can I use both GCM and FCM in my app?

荒凉一梦 提交于 2019-12-12 08:57:48
问题 I have an android project in which GCM is implemented. Back-end (server) is already coded suitably with GCM. Now is it possible to add firebase (FCM) in my project and work in parallel with GCM? I cant migrate to FCM because it is impossible to change my back-end code as it is a big project and too much code is there. Has anyone done something like this? Please help. Thanks in advance. 回答1: No, you can not use both FCM and GCM at same time. GCM is the old version and that it is strongly

Vibrate on push notification

空扰寡人 提交于 2019-12-12 08:38:47
问题 First of all I've checked all those links: How to Call Vibrator inside a Service in android Android notifications and vibrate from service Android GCM turn on Lights But I can't achieve my phone vibrating when I receive a push notification. Here goes my code: PushReceiver public class PushReceiver extends FirebaseMessagingService { public PushReceiver() { } @Override public void onMessageReceived(RemoteMessage remoteMessage) { if(remoteMessage.getData() != null){ Map<String, String> data =

Android SDK manager GCM library

跟風遠走 提交于 2019-12-12 07:56:57
问题 I just saw that google deprecated the C2DM and replace it by GCM. On their website they describe us, step by step, the way to follow to install the GCM library required to start implementing the new android push notification (or Cloud Messaging, as they name it). On the "Install the Helper Libraries" is written: To perform the steps described in the following sections, you must first install the helper libraries (reference: client and server). From the SDK Manager, install Extras > Google