Reputation: 119
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.
Upvotes: 2
Views: 2017
Reputation: 21
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.
Upvotes: 2