google-cloud-messaging

java.lang.NoClassDefFoundError: com.google.android.gms.gcm.GoogleCloudMessaging using java.lang.NoClassDefFoundError:

拥有回忆 提交于 2020-01-06 16:11:43
问题 This is really annoying. I've wasted a whole day but haven't received any proper result. I'm trying to add Google Cloud Messages into my app. I'm using Eclipse last version. ADT last version. I've added google-play-services_lib as Library, added the jar file in Build path but my app drops at the code line below: GoogleCloudMessaging regId = GoogleCloudMessaging.getInstance(_.appContext); java.lang.NoClassDefFoundError! How to solve this problem? 回答1: The problem is the bug of SDK and Eclipse.

How to get test GCM tokens?

纵饮孤独 提交于 2020-01-06 15:49:49
问题 We have implemented a gateway service and push manager services to send push messages to GCM. Now we want to do some automated testing. How we can test GCM tokens? We can get some tokens from real devices and after sometime they might expire and tests will fail. To test positive and negative scenarios we need known valid and invalid GCM tokens. Any help guys? Thanks. 回答1: Okay, so I may have misunderstood the question, thinking that you were asking how to test registration tokens. If by test

How to get test GCM tokens?

假如想象 提交于 2020-01-06 15:49:07
问题 We have implemented a gateway service and push manager services to send push messages to GCM. Now we want to do some automated testing. How we can test GCM tokens? We can get some tokens from real devices and after sometime they might expire and tests will fail. To test positive and negative scenarios we need known valid and invalid GCM tokens. Any help guys? Thanks. 回答1: Okay, so I may have misunderstood the question, thinking that you were asking how to test registration tokens. If by test

GCM push & application process

旧城冷巷雨未停 提交于 2020-01-06 13:15:10
问题 I wondered what happens when GCM push has arrived and there is no process alive bound to the application. As you know, a process can be killed from the task manager and also by the system to free-up space. Actually, I tested the case of killing it manually from the task manager and saw no incoming pushes. What about if the system kills the process then ? Thx in advance. 回答1: Referring following table we can say that, App will not get Push notification if Forced closed by user manually.

Trying to HTTP-POST to GCM from Java

纵饮孤独 提交于 2020-01-06 12:45:35
问题 I'm trying to send a HTTP-POST to the Google Cloud Messaging service. I have setup the correct keys, and everything is working when I use a php script for sending push notifications to my cellphone. But my Java httpPost only returns a 401 response. I have followed the instructions given at Android Developers but I'm still getting the annoying 401. Am I assigning the header fields wrong? My Code : import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader;

Trying to HTTP-POST to GCM from Java

人走茶凉 提交于 2020-01-06 12:43:05
问题 I'm trying to send a HTTP-POST to the Google Cloud Messaging service. I have setup the correct keys, and everything is working when I use a php script for sending push notifications to my cellphone. But my Java httpPost only returns a 401 response. I have followed the instructions given at Android Developers but I'm still getting the annoying 401. Am I assigning the header fields wrong? My Code : import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader;

Sending notifications to specific device using PHP?

自古美人都是妖i 提交于 2020-01-06 03:41:28
问题 I'm trying send notifications to specific device using PHP. I created the project in google console and start GCM service. I can send notifications to all devices but I want send to specific device for example: 26093d6bbddgggg, 26093d6bbddzzzz How can i do it ? I'm trying this PHP script <?php define("GOOGLE_API_KEY", "AIzaSyCJiVkatisdQ44rEM353PFGbia29mBVscA"); define("GOOGLE_GCM_URL", "https://android.googleapis.com/gcm/send"); function send_gcm_notify($reg_id, $message) { $fields = array(

can't import import com.google.android.gcm.GCMBaseIntentService

大憨熊 提交于 2020-01-05 14:12:54
问题 guys i have a huge problem here. i have a project that uses gcm but the import can't be resolved. I've tried all other suggestion on this site and others but nothing seems to work. please help I've downloaded the library copied the jar into my /libs folder and added it to build path but i still got an error on the import what can be the problem? 回答1: first delete google play services from eclipse and clean project For google play services first install Google play Services SDK Manager ->

can't import import com.google.android.gcm.GCMBaseIntentService

亡梦爱人 提交于 2020-01-05 14:12:05
问题 guys i have a huge problem here. i have a project that uses gcm but the import can't be resolved. I've tried all other suggestion on this site and others but nothing seems to work. please help I've downloaded the library copied the jar into my /libs folder and added it to build path but i still got an error on the import what can be the problem? 回答1: first delete google play services from eclipse and clean project For google play services first install Google play Services SDK Manager ->

firebase set background message handler

血红的双手。 提交于 2020-01-05 13:30:12
问题 I have been trying to customise notification message in front end, i.e if a field is not set send in notification, I am trying to add it. importScripts('https://www.gstatic.com/firebasejs/5.0.4/firebase-app.js'); importScripts('https://www.gstatic.com/firebasejs/5.0.4/firebase-messaging.js'); var config = { apiKey: "x", authDomain: "y", databaseURL: "z", projectId: "a", storageBucket: "b", messagingSenderId: "1" }; firebase.initializeApp(config); const messaging = firebase.messaging();