google-cloud-messaging

Android GCM sent successfully but not received on some devices

匆匆过客 提交于 2019-12-17 06:36:08
问题 On the server side, I am using GCM server 1.0.2 library provided by Google. On the client side, I set up GCM as provided on the official documentation. My problem is that everything works fine on most devices, but on few devices, push is not recieved. if (case1) message = new Message.Builder() .timeToLive(0) .collapseKey("0") .delayWhileIdle(false) .addData("msg", msg).build(); else if (case2) message = new Message.Builder() .collapseKey("2") .addData("msg", msg).build(); else message = new

Send push notifications from server with FCM

我的梦境 提交于 2019-12-17 04:55:15
问题 Recently I asked a question on sending push notifications using GCM: Send push notifications to Android. Now that there is FCM, I am wondering how different it would be from the server side development. Coding wise, are they the same? Where can I find example FCM codes showing sending push notifications from server to Android device? Do I need to download any JAR library for sending notifications to FCM using Java codes? The example codes in Send push notifications to Android shows sending

Error broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE pkg=com.flagg327.guicomaipu (has extras) }

↘锁芯ラ 提交于 2019-12-17 04:32:19
问题 I'm receiving that error from Android Studio's Android Monitor. This error appears when I send a push notification through GCM, in a real device, and the app has not been started yet or has been forced to stop. Yesterday all works fine, today is not working at all (works only if the app is running in background or foreground). I think this may be an AndroidManifest error, but I'm tired of looking for the problem and can not find anything. Manifest <manifest xmlns:android="http://schemas

Firebase FCM Usage Limits [closed]

断了今生、忘了曾经 提交于 2019-12-17 02:47:51
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 10 months ago . I was wondering if there is a comprehensive list that privides details of the various Firebase FCM usage limits. I knew of the Data message payload limit of 4KB maximum. and then recently I got some issue with my app and then figured it was due to another limit - "maximum of 4 different collapse keys per

API key for GCM is suddenly invalid? Unauthorized (401) error

不问归期 提交于 2019-12-16 20:14:19
问题 I created an Android API key for GCM Push Notification for my Android application.From the last two days, GCM server returns Unauthorized (401) response in PHP. Is there any reason for Android API key invalid/expire? Or Is Android API key deprecated by GCM? Still I'm not getting proper explanation regarding Why Android API key is invalid? Most of them prefer Server key instead of Android API key for GCM but not mentioning as to why not use Android API key. Why do not use Android API Key in

Is it possible to send PushNotifications, using Firebase Cloud Messaging (FCM) to special UDID, directly from device?

夙愿已清 提交于 2019-12-16 19:55:31
问题 I am thinking about keeping all registration ids(push token) in DB and sending notifications to user from iPhone. I tried something like this but did not get any notification. func sendPNMessage() { FIRMessaging.messaging().sendMessage( ["body": "hey"], to: TOKEN_ID, withMessageID: "1", timeToLive: 108) } What I am doing wrong or maybe it is impossible at all? 回答1: Currently it's not possible to send messages from the application itself. You can send messages from the Firebase Web Console, or

GCM Chrome: Empty Data Response

筅森魡賤 提交于 2019-12-14 04:26:00
问题 i am currently integrating gcm in my web application, the subscription and the registration_id saving working, i get on the client also the response, when i trigger a message from Postman. So now i need to transfer the title and the message. i am triggering the gcm api with this parameter: http://i.imgur.com/MkrIAzF.png and thats the received from the client: http://i.imgur.com/gSZtEiY.png The Field "data" is everytime empty, 回答1: Despite using GCM as its push service, Chrome doesn't support

how can we get device token for android for push notification?

ⅰ亾dé卋堺 提交于 2019-12-14 04:16:59
问题 i want to implement push notification in my application.i want to know,how we get the device token for push notification in android after enabling the google cloud messaging API.How can we get a device token for a particular device?? 回答1: try { InstanceID instanceID = InstanceID.getInstance(this); String token = instanceID.getToken(getString(R.string.gcm_defaultSenderId), GoogleCloudMessaging.INSTANCE_ID_SCOPE, null); Log.i(TAG, "GCM Registration Token: " + token); }catch (Exception e) { Log

Android - Device ID from GCM return empty

送分小仙女□ 提交于 2019-12-14 04:01:26
问题 I have to get only device id from GCM for further use. I try all but result is negative, Device id I get is empty. Please help Here is code: GCMRegistrar.checkDevice(this); GCMRegistrar.checkManifest(this); setContentView(R.layout.cmain); mDisplay = (TextView) findViewById(R.id.display); final String regId = GCMRegistrar.getRegistrationId(this); Log.i(TAG, "registration id ===== " + regId); if (regId.equals("")) { GCMRegistrar.register(this, CommonUtilities.SENDER_ID); } else { Log.v(TAG,

Android GCM instanceID.getToken() throws TIMEOUT exception on Gingerbread

牧云@^-^@ 提交于 2019-12-14 04:01:08
问题 As the title indicates I get a TIMEOUT exception when trying to get token using Google Cloud Messaging on API 10 emulator. I have added my google account on the device, checked that "Sync" is ON, also added the <action android:name="com.google.android.c2dm.intent.REGISTRATION"/> in the manifest in the receiver and still cannot find out what is causing this: 11-25 17:35:00.896 29750-29774/com.example.alexis.myapplication W/InstanceID/Rpc: No response android.os.ConditionVariable@b667bc18 11-25