任何人都可以在Xamarin iOS中向我提出任何关于在背景中应用时显示徽章计数的想法
实际上在背景中,当通知到来时,Xamarin iOS中没有任何方法触发器。
答案 0 :(得分:0)
public class UserNotificationCenterDelegate : UNUserNotificationCenterDelegate
{
#region Constructors
public UserNotificationCenterDelegate()
{
}
#endregion
#region Override Methods
public override void WillPresentNotification(UNUserNotificationCenter center, UNNotification notification, Action<UNNotificationPresentationOptions> completionHandler)
{
/// here we can add badge
}
}
*****************
public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions)
{
UNUserNotificationCenter.Current.Delegate = new UserNotificationCenterDelegate();
----------
------------
}