Tag: nsusernotification

简单的警报和徽章IOS 10.2 UserNotifications问题

在写这篇文章之前,我对UserNotification Framework做了大量的研究,在IOS 10中代替了UILocalNotification。我也按照这个教程学习了这个新function的一切: http : //useyourloaf.com/blog/local-notifications-with- ios-10 / 。 今天,我遇到了很多麻烦来实现这样简单的通知,而且由于这是最近的新function,我找不到任何解决scheme(特别是在客观的C中)! 我目前有2个不同的通知,一个警报和一个徽章更新 。 警报问题 在从iOS 10.1更新我的手机到10.2之前,我在用户closures应用程序时立即触发的Appdelegate发出警报: -(void)applicationWillTerminate:(UIApplication *)application { NSLog(@"applicationWillTerminate"); // Notification terminate [self registerTerminateNotification]; } // Notification Background terminate -(void) registerTerminateNotification { // the center UNUserNotificationCenter * notifCenter = [UNUserNotificationCenter currentNotificationCenter]; // Content UNMutableNotificationContent *content = [UNMutableNotificationContent new]; content.title = @"Stop"; content.body = @"Application closed"; […]

UserNotifications取消,swift3

我正在开发应用程序,用户可以为每天的本地通知设置时间,然后我可以select启用或禁用这些通知。 我的问题如何禁用/取消已经设置的通知? 在这个IF中,我需要取消notif override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { if (indexPath as NSIndexPath).row == 1 && switchiBtn.isOn == false { return 0.0 } if (indexPath as NSIndexPath).row == 2 { if switchiBtn.isOn == false || dpVisible == true { return 0.0 } return 216.0 } if (indexPath as NSIndexPath).row == […]