![](/img/trans.png)
[英]Xamarin.Android push notification is breaking the app when App is Not Running
[英]Remote notification (GCM) into Xamarin.Android (monodroid) when app exit
我遵循了本教程
主要问题是:
WAKELOCK_KEY
是什么? 我必须在这里放什么? classType
是什么? 我必须在这里放什么? 对于WAKELOCK_KEY
我只输入“ NOTIF”,对于classType
使用typeof(MyIntentService)
。
我收到通知,但杀死应用程序后无法收到通知。 那么如何在Xamarin(没有PushSharp或类似的lib)中管理它呢?
(除了WAKELOCK_KEY和classType,我的代码与教程中的代码相同)。
如果您按照本教程进行操作,则只需执行此操作(似乎我的wakelock_key和classType的解决方案很好):-)
[BroadcastReceiver]
[IntentFilter(new[] { Android.Content.Intent.ActionBootCompleted })]
public class BootReceiver : BroadcastReceiver
{
public override void OnReceive(Context context, Intent intent)
{
MyIntentService.RunIntentInService(context, intent);
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.