簡體   English   中英

如何在 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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM