google-cloud-messaging

Unauthorized error 401 GCM error

╄→гoц情女王★ 提交于 2020-01-01 18:51:49
问题 Note, this question should be materially different from other questions with a similar name because of the fact that the API seems to have changed significantly over the past few years. I am trying to send a push notification to an iOS device using GCM. I have (I think) mostly set it up correctly. I have an API key from GCM, I've setup my SSL certificate on Apple Developer and I have my device correctly getting a registration id. I've got a little test script written up to try to test it and

Unauthorized error 401 GCM error

天涯浪子 提交于 2020-01-01 18:51:05
问题 Note, this question should be materially different from other questions with a similar name because of the fact that the API seems to have changed significantly over the past few years. I am trying to send a push notification to an iOS device using GCM. I have (I think) mostly set it up correctly. I have an API key from GCM, I've setup my SSL certificate on Apple Developer and I have my device correctly getting a registration id. I've got a little test script written up to try to test it and

How to refresh registration token in GCM that expired after a while?

半世苍凉 提交于 2020-01-01 18:17:33
问题 this is my first question in here, sorry in advance if something is not ok in my question! I'm currently using Xamarin in Visual Studio 2013 on a MacBook, I created a PCL project and I created all the things necessary to make the push notifications work for iOS and Android . Using a simulator and also a real device I can achieve both with a server side program where I use the device token created from the client side. Everything worked fine for a couple of hours but after a while both the

Cannot resolve com.google.android.gcm.GCMBaseIntentService; Android studio

风流意气都作罢 提交于 2020-01-01 16:39:13
问题 Edit: I solved this problem:) Cause of this error : In the tutorial Implementing GCM Client , there was link to download full source code for demo. Downloaded for reference , added google_play_service library in build.gradle. Did some recommended changes like SENDER_ID,SERVER_URL,.. etc Synch the project with gradle and got this error. How I solved! After lot of google I found that this class is not in google_play_service library but it is in gcm.jar which is deprecated now. I dont know why

Cannot resolve com.google.android.gcm.GCMBaseIntentService; Android studio

拟墨画扇 提交于 2020-01-01 16:38:13
问题 Edit: I solved this problem:) Cause of this error : In the tutorial Implementing GCM Client , there was link to download full source code for demo. Downloaded for reference , added google_play_service library in build.gradle. Did some recommended changes like SENDER_ID,SERVER_URL,.. etc Synch the project with gradle and got this error. How I solved! After lot of google I found that this class is not in google_play_service library but it is in gcm.jar which is deprecated now. I dont know why

Launch application when GCM notification received

旧巷老猫 提交于 2020-01-01 11:33:08
问题 I have GCM notification implementation. I know that the client application receives the notification whether it is in the foreground, background or killed state. What I would like to know is, how can I launch my application on notification received, when the application is in the killed state? 回答1: In the message receiver, I do the following: final Intent notificationIntent = new Intent(context, YourActivity.class); notificationIntent.setAction(Intent.ACTION_MAIN); notificationIntent

Should I use GCM for real time communication between devices?

假装没事ソ 提交于 2020-01-01 09:42:36
问题 I am making a chat application for android. For that, I decided to use GCM (Google Cloud Messaging). But having researched a bit about it,I have read that it shouldnt be used for something like chat. I will be implementing Upstream messaging (sending data from the device to the GCM directly, without a send-to-sync). Here are my concerns: Will the messages transfer instantly? (will be fast enough that the user can see 'typing'/seen) If all devices are online, what is the guarantee of the

Unregister on new Google Cloud Messaging

浪尽此生 提交于 2020-01-01 09:09:11
问题 I'm using the new google cloud messaging (GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance (context);) I am following this example, which is very good and works perfectly: https://github.com/commonsguy/cw-omnibus/tree/master/Push/GCMClient2 With this example I can register in the GCM, but I tried unsuccessfully to unregister. in the documentation indicates that you should use the following intent: com.google.android.c2dm.intent.UNREGISTER And use it as follows: Intent unregIntent =

Android GCM time_to_live issue

六月ゝ 毕业季﹏ 提交于 2020-01-01 08:51:43
问题 I have a problem related to time_to_live . I get messages when the device is on, but when it is offline I don't get the message or at least it is not sent in the first 15 minutes. I'm sending the message with delay while idle true and time_to_live 2419200. Any ideas what is happening, maybe I misread the documentation. 回答1: From the documentation : delay_while_idle : If included, indicates that the message should not be sent immediately if the device is idle. The server will wait for the

Android GCM time_to_live issue

人盡茶涼 提交于 2020-01-01 08:50:55
问题 I have a problem related to time_to_live . I get messages when the device is on, but when it is offline I don't get the message or at least it is not sent in the first 15 minutes. I'm sending the message with delay while idle true and time_to_live 2419200. Any ideas what is happening, maybe I misread the documentation. 回答1: From the documentation : delay_while_idle : If included, indicates that the message should not be sent immediately if the device is idle. The server will wait for the