[英]How to get push/remote notification when app in foreground in xamarin.ios native app?
We have implemented APNS push notification in Xamarin.ios native app and its work fine when app in background or kill state.我们在 Xamarin.ios 本机应用程序中实现了 APNS 推送通知,并且当应用程序处于后台或终止状态时它可以正常工作。 We have unable to get notification in foreground state.
我们无法在前台状态收到通知。 How to solve this?
如何解决这个问题? Can any one suggest how to implement c# code for this
任何人都可以建议如何为此实现 c# 代码
userNotificationCenter:(UNUserNotificationCenter* )center willPresentNotification userNotificationCenter:(UNUserNotificationCenter* )center willPresentNotification
Xamarin.ios native app . Xamarin.ios 本机应用程序。 Please help/guide.
请帮助/指导。
Please see the documentation .请参阅文档。
You can call:您可以致电:
completionHandler(UNNotificationPresentationOptions.Alert | UNNotificationPresentationOptions.Sound | UNNotificationPresentationOptions.Badge);
in userNotificationCenter:(UNUserNotificationCenter* )center willPresentNotification
Default is UNNotificationPresentationOptions.None
when on foreground which usually is normal because you don't want to show a push notif in when the app is in foreground unless your app requires it.默认为
UNNotificationPresentationOptions.None
在前台时通常是正常的,因为除非您的应用程序需要,否则您不想在应用程序处于前台时显示推送通知。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.