Comments (7)
yes i got the salution for this
Original comment by [email protected]
on 25 Jul 2013 at 1:57
from gcm.
Please, can you explain how did you resolve this issue?
Original comment by [email protected]
on 3 Jan 2014 at 6:50
from gcm.
MulticastResult result = sender.sendNoRetry(message, devicesList);
will not help you .you need send json parameter to gsm url.use http Post method
like
HttpClient httpClient = new DefaultHttpClient();
try{
String messsage="";
JSONObject js=new JSONObject();
JSONObject js1=new JSONObject();
js.put("delay_while_idle", false) ;
js.put("collapse_key","0") ;
js1.put("payload",msg1) ;
js.put("time_to_live",600) ;
js.put("data", js1) ;
js.put("registration_ids", arraylist) ;
String message=js.toJSONString();
HttpPost request = new HttpPost("https://android.googleapis.com/gcm/send");
StringEntity params =new StringEntity(message,"UTF-8");
request.addHeader("Authorization", "key=Your App RegistrationId");
request.addHeader("content-type", "application/json;charset=UTF-8");
request.setEntity(params);
HttpResponse response = httpClient.execute(request);
BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
String line = "";
while ((line = rd.readLine()) != null) {
//Parse our JSON response
System.out.println(line);
JSONParser j = new JSONParser();
JSONObject o = (JSONObject)j.parse(line);
//Map r = (Map)o.get("success");
//log.info("check sucsess value>>>>>>");
succ=(o.get("success")).toString();
}
} catch (Exception e) {
e.getMessage();
}
Then only u can send arabic text.
result whould be Json Formate:=
{"multicast_id":8676960544645135217,"success":736,"failure":264,"canonical_ids":
0,"results{"message_id":"0:1386053246577771%25796c8300000030"},{"message_id":"0:
1386053246575977%25796c8300000030"},{"error":"NotRegistered"}]}
Abhimanyu
Original comment by [email protected]
on 8 Jan 2014 at 1:35
from gcm.
[deleted comment]
from gcm.
thanx for nice help but just change byte[] bytes = body.getBytes("UTF-8"); in
post method .
Original comment by [email protected]
on 3 Apr 2014 at 2:32
from gcm.
You can find the fix for this bug in issue #17
Original comment by [email protected]
on 25 Aug 2014 at 9:15
from gcm.
You can find a repo with the fix of issue #17 here:
https://github.com/kurthuwig/gcm/commit/d37f4d1c37ed8deaf1a161ca7b881c1d843f80df
Original comment by [email protected]
on 25 Aug 2014 at 9:39
from gcm.
Related Issues (20)
- GCM with Play Services on Android on registration gets a SERVICE_NOT_AVAILABLE
- com.google.android.gcm.GCMRegistrar missing from the latest google_play_services.jar
- Patch for /gcm-client/src/com/google/android/gcm/demo/app/DemoActivity.java
- gcm push got success in server side but it is not delivered to android mobile HOT 3
- [Inquiry] In which cases do GCM server return 'NotRegistered'?
- In reality, android.permission.GET_ACCOUNTS is not needed on any OS version! HOT 1
- Unable to instantiate receiver GcmBroadcastReceiver HOT 4
- How can i get registration ID for my Nexsus?
- Missing Socket Timeout HOT 1
- support application specific GCM thottling threshold
- Cannot get registration id from GCM in restricted profile HOT 1
- message was not delivered into phone...
- Patch for /samples/gcm-demo-server/WebContent/WEB-INF/classes/api.key
- Spurious NotRegistered Error responses from GCM servers HOT 5
- Documentation for migration from C2DM needs updating for Android 5.0
- GCM not Registered Issue HOT 1
- Google Cloud Messaging (GCM) duplicates and loses some messages
- Patch for /samples/gcm-demo-client/src/com/google/android/gcm/demo/app/DemoActivity.java
- "Generate a Notification Key on the Client" results in HTTP 401 Unauthorized response HOT 3
- ANR keyDispatchingTimedOut
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gcm.