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 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;}}   

Because it is also a service , you must register it in your AndroidManifest file:

  &    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -