Thursday, 15 September 2011

android - Custom GCMBroadcastReceiver -


I am currently creating a broadcast receiver in this way: in my pieces:

  Receiver = New GCM Boardest Receiver Lobby (); IntentFilter filter = new intent filter ("com.google.android.c2dm.intent.RECEIVE"); Filter.setPriority (9999); Filter.addAction ("com.google.android.c2dm.intent.RECEIVE"); GetActivity () Register receiver (receiver, filter); Class GCMBcastcastrayer lobby spreads to WakefulBroadcastReceiver {@ Override Public Records on Receive (Reference Reference, Intent of Intent) {Bundle Extras = Intent. JetExtros (); String message type = extras.toString (); SetResultCode (Activity.RESULT_CANCELED); AbortBroadcast (); }}  

The problem does not return details from intent.getExtras GCM-message

   & Lt; Category android: name = "de.battlestr1k3.gamelobbies" /> & Lt; / Intent-Filter & gt; & Lt; / Receiver & gt; & Lt; Service Android: name = ".gcmIntentService" android: export = "true" />  

GcmBroadcastReceiver is a high priority of Lobby, so it gets the notification first. Maybe I could not get permission in the code?

  extras.toString ()  

bundles [mParcelledData.dataSize = 280]

OK I added

  if (! Extras.isEmpty ()) { 

} And it worked


No comments:

Post a Comment