简体   繁体   English

如何在 xamarin.ios 本机应用程序中的前台应用程序时获取推送/远程通知?

[英]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.

相关问题 如何检测应用程序何时在 UIViewController class xamarin.ios 中移动到后台或前台 - How to detect when app moves to background or foreground in UIViewController class xamarin.ios 如何在xamarin.ios本机应用程序中显示DisplayActionSheet - How to show DisplayActionSheet in xamarin.ios native app 仅当应用程序处于前台 ios 时才接收 Firebase 推送通知 - Firebase push notification receiving only when app is in foreground ios 网络可用时,如何在xamarin.ios应用程序中更改视图? - How to change view in xamarin.ios app when network is available? 如何在前台App中抑制推送吐司通知? - How to suppress push toast notification only when App in foreground? 如何在 Xamarin.iOS 应用程序中创建导航? - How to create navigation in a Xamarin.iOS app? Xamarin.iOS应用程序在活动时未收到parse.com PUSH - Xamarin.iOS app does not receive parse.com PUSH when active 如何在Xamarin.ios本机应用程序的自定义控制器类中打开新的故事板? - How do I open a new storyboard from custom controller class in Xamarin.ios native app? 如何解决,UIAlertController(ActionSheet)在xamarin.ios本机应用程序的iPad上崩溃了? - How to solve, UIAlertController (ActionSheet) is Crashed on iPad in xamarin.ios native app? 如何在Xamarin.ios应用程序中比较CBUUID对象 - How to compare CBUUID objects in Xamarin.ios app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM