如何在iOS 9中获取本地通知

时间:2016-02-15 08:55:14

标签: ios uilocalnotification

我想从通知面板获取本地通知,以便我可以管理应用程序徽章值。

到目前为止,这是我的代码:

- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification{
    if(application.applicationIconBadgeNumber < localNotification.applicationIconBadgeNumber){
        application.applicationIconBadgeNumber = localNotification.applicationIconBadgeNumber;
    }else {
        application.applicationIconBadgeNumber--;
    }
}

1 个答案:

答案 0 :(得分:0)

notification.fireDate =“你的日期”;