简体   繁体   中英

Remote notification (GCM) into Xamarin.Android (monodroid) when app exit

I followed this tutorial

The main problem is :

  • What is WAKELOCK_KEY in their code ? What I must put here ?
  • What is classType in their code ? What I must put here ?

For the WAKELOCK_KEY I just put "NOTIF", and for classType is use typeof(MyIntentService) .

I receive notification but can't receive notification when I kill the application. So how to manage this in Xamarin (no PushSharp or similar lib) ?

(My code is the same as in the tutorial, except for WAKELOCK_KEY and classType).

If you follow the tutorial, you just have to do that (seems my solution for the wakelock_key and the classType was good) :-)

[BroadcastReceiver]
[IntentFilter(new[] { Android.Content.Intent.ActionBootCompleted })]
public class BootReceiver : BroadcastReceiver
{
    public override void OnReceive(Context context, Intent intent)
    {
        MyIntentService.RunIntentInService(context, intent);
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM