android - Google Cloud Messaging notification functions? -
Now that I've got GCM work, I'm looking at a method to do an app function when receiving a message Occurs or information is clicked.
Unfortunately, I can not find anything about it. I should remember however that these things are possible where.
I know this is not a good stackwormflow question, but I really need to answer it.
This is a Because it is also a IntentService :
Can import com.google.android.gms to import? gcm.GoogleCloudMessaging; Public category GCpros is interspersed with intensive service (public GCMprosas () (Super ("GCMIntent Service");} @ Override Protected Zero to HandelIntent {Last GoogleCloudMessaging GCM = GoogleCloudMessaging.getInstance (this); Last String Message Type = GCM.GetMessage Type (Intent); Final Bundle Extra = Intent if ((!!! Extras. ISET) and (GoogleCloudMessaging.MESSAGE_TYPE_MESSAGE.equals (messageType))) {// This will test status Is there a given code that is called fu (extras.getString ("code") .equals ("foo")} {dohhiteYouNeed ();}} GCMBroadcastReceiver.completeWakefulIntent;}}
service , you must register it in your
AndroidManifest file:
&
Comments
Post a Comment