简体   繁体   中英

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. We have unable to get notification in foreground state. How to solve this? Can any one suggest how to implement c# code for this

userNotificationCenter:(UNUserNotificationCenter* )center willPresentNotification

Xamarin.ios native app . 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM