android-c2dm

Display Alert when push arrives

泪湿孤枕 提交于 2020-01-02 05:46:06
问题 How Can I Display an alert when push notification arrives from C2DM or GCM. Right now I am displaying notifications on status bar. So How can I get a notification as an alert. 回答1: Popping a dialog in the middle of something a user is doing is a wildly user hostile thing to do. What if they're playing Angry Birds and you've just ruined their shot? Only the platform can and should get away with that. Use the notification area, like Google intended, UNLESS you app currently has control (your

Not allowed to start service Intent X without permission Y

天大地大妈咪最大 提交于 2020-01-02 01:12:12
问题 04-25 14:16:30.931: E/AndroidRuntime(6638): FATAL EXCEPTION: main 04-25 14:16:30.931: E/AndroidRuntime(6638): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { (has extras) }} to activity {com.exclusive26.igale/com.exclusive26.igale.Push_Activity}: java.lang.SecurityException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gsf (has extras) } without permission com.google

C2DM retry registration permission denial

女生的网名这么多〃 提交于 2020-01-01 14:49:11
问题 Any ideas on how to solve this permission denial error on retry registration event are greatly appreciated. Permission Denial: broadcasting Intent { act=com.google.android.c2dm.intent.RETRY flg=0x4 (has extras) } from com.my.package (pid=-1, uid=10041) requires com.google.android.c2dm.permission.SEND due to receiver com.my.package/com.google.android.c2dm.C2DMBroadcastReceiver manifest <uses-sdk android:minSdkVersion="8" /> <permission android:name="com.my.package.permission.C2D_MESSAGE"

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

HttpURLConnection c = URL.openConnection(); c.setRequestProperty() Doesn't work

∥☆過路亽.° 提交于 2019-12-30 03:35:06
问题 This Code here is a normal Java application not an android application, this is designed to send C2DM messages to a device with YOUR_REGISTRATION_STRING as the developer with auth_key, the problem is described below import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLEncoder; import javax.net.ssl.HostnameVerifier; import javax.net.ssl

c2dm server with C#

不问归期 提交于 2019-12-29 07:19:26
问题 Do anyone know if its possible to create a c2dm serverside with C#? How do i add the required parameters (email, password etc)? 回答1: Here is the core of a basic prototype C# server I created. class C2DMPrototype { // Hardcoded for now private const string RegistrationId = "XXXXXXXXXXX"; private const string GoogleAuthUrl = "https://www.google.com/accounts/ClientLogin"; // TODO : Production code should use https (secure) push and have the correct certificate private const string

How to call the C2DM PHP Function from the Android APP

纵然是瞬间 提交于 2019-12-25 17:25:25
问题 I am trying to add a Push Notification service to my Android Application. I added the necessary methods in the application (Receiver, Manifest Changes etc.) I then proceeded to follow this (http://stackoverflow.com/questions/4121508/c2dm-implementation-php-code) to add the functions to my third party server for registration to C2DM and sending messages. This may sound silly but as I am not that proficient at PHP can somebody please advise me on how to call the PHP functions to register/send

GCM Push Notification without using JSON

∥☆過路亽.° 提交于 2019-12-25 05:04:15
问题 I am trying to migrate my application from C2DM service to new GCM push notification. I have successfully integrated the GCMIntentService class which extends GCMBaseIntentService. When I send the push notification from server using PHP, the GCM sends the message data as a JSON object. I am using the following code in my Android GCM service, and its returning a null value with the new code. public void onMessage(Context context, Intent intent) { String action = intent.getAction(); if ("com

InvalidRegistration both on C2DM & GCM

独自空忆成欢 提交于 2019-12-25 03:52:25
问题 I'm trying to send Push Notifications via C2DM / GCM to an Android Application via PHP. No matter which i use, i keep getting the following : For GCM : {"multicast_id":7672049265453358197,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"InvalidRegistration"}]} For C2DM : Error=InvalidRegistration After reading allot about this issue all day I'm still clueless as to why this is an InvalidRegistration as if i take the registatoin_id and use it to send a test push message via Urban

C2DM Error=MissingRegistration i already put registration_id to request

早过忘川 提交于 2019-12-25 02:16:14
问题 i am working to sent a push message to android phone from my asp.net project and i already put register_id in my code but i handle an error Missing registration, i didnt understand its reason. Here is my code: public void SendMessage(string registrationId, string data, string sAuth) { string collapseKey = Guid.NewGuid().ToString("n"); ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(ValidateRemoteCertificate); string url = "https://android