How to detect if android app is open from a notification sent with PushSharp? -


so i'm using pushsharp send notification in c# android app :

      var push = new pushbroker();       push.registergcmservice(new gcmpushchannelsettings(androidkey) { });       push.queuenotification(                 new gcmnotification().fordeviceregistrationid(registrationid)                     .withjson("{\"alert\":\"" + pushmessageformater.formatmessage(ncruleresult) + "\",\"badge\":7,\"sound\":\"sound.caf\"}")); 

everything works fine, notification correctly sent.

now, want detect mainactivity if app open when final user tap in received notification.

protected void oncreate(bundle savedinstancestate) {     registrationgetter = new registrationgetter(this);     super.oncreate(savedinstancestate);     intent intent = getintent() ;     // how check here if app open further push tap. } 

all found in need put variable on intent, unfornately, can't find way specify intent pushsharp.

thank in advance.

change pending intent invoke service while tapping on notification

pendingintent pendingintent = pendingintent.getservice(context, 579, intent,pendingintent.flag_update_current); 

refer here check whether app in foreground or not.. have check service invoked after tapping received notification..