[英]How to detect when app moves to background or foreground in UIViewController class xamarin.ios
[英]How to get push/remote notification when app in foreground in xamarin.ios native app?
我們在 Xamarin.ios 本機應用程序中實現了 APNS 推送通知,並且當應用程序處於后台或終止狀態時它可以正常工作。 我們無法在前台狀態收到通知。 如何解決這個問題? 任何人都可以建議如何為此實現 c# 代碼
userNotificationCenter:(UNUserNotificationCenter* )center willPresentNotification
Xamarin.ios 本機應用程序。 請幫助/指導。
請參閱文檔。
您可以致電:
completionHandler(UNNotificationPresentationOptions.Alert | UNNotificationPresentationOptions.Sound | UNNotificationPresentationOptions.Badge);
in userNotificationCenter:(UNUserNotificationCenter* )center willPresentNotification
默認為UNNotificationPresentationOptions.None
在前台時通常是正常的,因為除非您的應用程序需要,否則您不想在應用程序處於前台時顯示推送通知。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.