google-cloud-messaging

android GCM get original id of canonical id

六月ゝ 毕业季﹏ 提交于 2019-12-17 16:14:51
问题 I am trying to send a push update to some android devices. Some of them have got a new id in the mean time, so I Google tells me there are canonical ids. From the documentation I read: If message_id is set, check for registration_id: If registration_id is set, replace the original ID with the new value (canonical ID) in your server database. Note that the original ID is not part of the result, so you need to obtain it from the list of registration_ids passed in the request (using the same

How can I receive notifications from GCM when application is stopped

时光怂恿深爱的人放手 提交于 2019-12-17 15:52:01
问题 GCMIntentService (extends GCMBaseIntentService) doesn't receive notifications if the application is not running. From : http://developer.android.com/about/versions/android-3.1.html Launch controls on stopped applications Note that the system adds FLAG_EXCLUDE_STOPPED_PACKAGES to all broadcast intents. It does this to prevent broadcasts from background services from inadvertently or unnecessarily launching components of stoppped applications. A background service or application can override

AWS SDK for PHP: Error retrieving credentials from the instance profile metadata server

◇◆丶佛笑我妖孽 提交于 2019-12-17 15:33:03
问题 I am trying to send SNS messeges to android through web api. Downloaded and installed the SDK from http://aws.amazon.com/developers/getting-started/php/ Got following error while running sample.php: Fatal error: Uncaught exception 'Aws\Common\Exception\InstanceProfileCredentialsException' with message 'Error retrieving credentials from the instance profile metadata server. When you are not running inside of Amazon EC2, you must provide your AWS access key ID and secret access key in the "key"

How to add custom notification sound in Android [duplicate]

浪尽此生 提交于 2019-12-17 12:37:06
问题 This question already has answers here : How to set notification with custom sound in android (6 answers) Closed 4 years ago . I have to manage notification and for that I need to manage custom sound when it comes. So do you have any idea how we can do this? I already copied sound file to my raw folder, so anyone have any ideas how I can implement it to my project. Thanks in advance. 回答1: Firstly make the folder in Resource (res) name it raw and put the file (YOUR_SOUND_FILE.MP3) in it and

What happens to older clients when you migrate an app server from GCM to FCM?

泪湿孤枕 提交于 2019-12-17 07:52:17
问题 I'm considering migration to FCM. The client side of things is rather simple, you move some code around and get it done. However, on the app server, I'd need to support older clients as well, for obvious reasons. I need to know what happens when I migrate a GCM project to FCM. Does FCM automatically forward messages to older GCM-based clients as well? Or would I need to send each message twice, once to FCM and once to GCM? How will this impact implementation-specific stuff such as messages

Clicking on Notification is not starting intended activity?

依然范特西╮ 提交于 2019-12-17 07:30:20
问题 I am using GCM in my application and also using NotificationManager to Create a Notification whenever GCM message is received.Till now everything is working perfectly and GCM message is showing correctly in Notification area, but when I click on the notification it should start an activity of my application which will display the message detail which is not happening. Every-time I click on notification it does not start any activity and it remains as is.My code for creating Notification is :

GCM Registration ID changed

坚强是说给别人听的谎言 提交于 2019-12-17 07:28:55
问题 I developed an application which used GCM technology and everything is OK. I observed that the registration ID of the device changes after a period of time and this has caused a problem in my app because my app is dependent on the Reg ID. So how I can get a fixed Reg ID for clients? 回答1: I read the 2 reasons over here when you GCM Registration Id might change: You’ll need to re-register every device each time you update your app. You’ll also need to re-register a device if the version of

getting null device id while registering to gcm

爱⌒轻易说出口 提交于 2019-12-17 06:54:16
问题 GCMRegistrar.checkDevice(this); GCMRegistrar.unregister(this); GCMRegistrar.checkManifest(this); if (GCMRegistrar.isRegistered(this)) { GCMRegistrar.getRegistrationId(this)); } regId = GCMRegistrar.getRegistrationId(this); l.setText(regId); if (regId.equals("")) { GCMRegistrar.register(this, "187805647345"); GCMRegistrar.getRegistrationId(this)); l.setText(regId); } else { GCMRegistrar.getRegistrationId(this)); } Toast.makeText(RegisterHalf.this,""+regId,2000).show(); When running the app I

How to implement a GCM Hello World for Android using Android Studio

风格不统一 提交于 2019-12-17 06:49:16
问题 I have been searching for some days now how to implement Google Cloud Messaging for Android, but I'm with some serious doubts about it. I mean, apparently Google put some good informations online, like here and here, but I'm confused about all the logic. One page talks about the client side, and another about the server side. Great, but how do I bind all of it together? How do I implement HTTP and/or XMPP protocol to communicate with the GCM connection server(s)? I would like implement a

Adding Google Cloud Messagin (GCM) for Android - Registration process

▼魔方 西西 提交于 2019-12-17 06:49:15
问题 I have been struggling with GCM implementation for some weeks now, but how I really want to get to understand how it works I decided to take 'baby steps'. First of all, as mentioned here, I understood that the first thing to do is register my device/app must first register with GCM. To verify that they can send and receive messages, client apps must register with GCM. In this process, the client obtains a unique registration token. I'd like to know if the procedure and code below represent