ApplicationIconBadgeNumber设置为0不起作用

时间:2014-04-12 06:48:53

标签: ios xamarin.ios push

为什么行" UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;"不行? 我通过PHP发送推送通知。

数字将全部由应用程序图标显示!

[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
    // class-level declarations
    UIWindow window;
    HomeViewController viewController;
    //
    // This method is invoked when the application has loaded and is ready to run. In this 
    // method you should instantiate the window, load the UI into it and then make the window
    // visible.
    //
    // You have 17 seconds to return from this method, or iOS will terminate your application.
    //
    public override bool FinishedLaunching (UIApplication app, NSDictionary options)
    {
        UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;

        window = new CustomWindow (UIScreen.MainScreen.Bounds);

        viewController = new HomeViewController ();
        window.RootViewController = viewController;
        window.MakeKeyAndVisible ();

        UIRemoteNotificationType notificationTypes = UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge;
        UIApplication.SharedApplication.RegisterForRemoteNotificationTypes(notificationTypes);

        return true;
    }

1 个答案:

答案 0 :(得分:0)

因为允许自然数(n> = 1)。当事件计数等于0时,它没有显示