- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用来自AppDelefate的scheduleLocalNotification作为UILocalNotification,并且调试配置一切顺利。但是,当我在临时设置上测试我的应用程序时 - 它不会触发通知。有人可以指导我吗?谢谢!
最佳答案
首先 - 本地通知不依赖于配置文件。您会错过 PushNotifications。
您确定要安排通知吗?也许您忘记请求用户许可?
它应该是这样的:
if #available(iOS 8.0, *) {
application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: UIUserNotificationType.Sound, categories: nil))
let notification = UILocalNotification()
notification.alertBody = "body"
notification.alertAction = "open"
notification.fireDate = NSDate().dateByAddingTimeInterval(60)
notification.soundName = UILocalNotificationDefaultSoundName
notification.userInfo = ["myKey": "myValue"]
notification.category = "category"
UIApplication.sharedApplication().scheduleLocalNotification(notification)
} else {
// do nothing
// iOS 7 and prior does not require permission
}
关于IOS - 生产上的 ScheduleLocalNotification,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33919530/
我有一个应用程序调用 scheduleLocalNotification ,但是当我将其安装到 /Applications 而不是 /var/mobile/Applications 时,它不起作用:
我正在使用来自AppDelefate的scheduleLocalNotification作为UILocalNotification,并且调试配置一切顺利。但是,当我在临时设置上测试我的应用程序时 -
我正在尝试设置重复提醒...我正在使用此代码: UILocalNotification *localNotif = [[UILocalNotification alloc] init];
当我从 dateTimePicker.date 获取时间/日期时,通知有效,但当我使用 dateFromString 触发日期时,通知无效。 代码: -(IBAction)alarmSetButton
在我们的应用中,如果用户设置了我们的 future 提醒,我们会通过以下方式设置本地通知: UILocalNotification *localNotif = [[UILocalNotificatio
不知道是不是技术问题。我试图通过调用这个来实现预定的本地通知: // Schedule the notification ***************************************
我的应用程序有时需要安排近 64 个本地通知,这将在 iPhone4 上阻塞我的主线程近 1 秒。我想在一个单独的线程上执行此操作,UIApplcation 线程的这些本地通知操作方法安全吗? 最佳答
调用scheduleLocalNotification:后在 UIApplication 上单例,我注意到在一些场合 scheduledLocalNotifications 返回的通知数组在 UIAp
我正在使用 UILocalNotification 问题是当我使用 scheduleLocalNotification 发布我的通知时,它永远不会触发 didReceiveLocalNotificat
我遇到了 scheduleLocalNotification 的性能问题。我正在尝试注册大量本地通知。这就像 friend 的生日闹钟。为了测试,我尝试注册大约 300 个通知,但我的 iPhone4
presentLocalNotificationNow 和 scheduleLocalNotification 有什么区别。 因为以下两个函数都是在 1 秒后显示通知 -(void)showLocal
我在为我的 iOS 应用程序设置带有计划本地通知的图标角标(Badge)时遇到了一些困难。 当我在加载应用程序后单击主屏幕时,我能够在 10 秒后触发本地通知弹出。但是,未设置应用程序图标角标(Bad
我在我的 info.plist 中设置了“应用程序不在后台运行”,所以当用户点击主页按钮时,应用程序退出。 当我的 [UIApplication -appWillTerminate:] 被调用时,我将
我是 iOS 技术的新手。我正在尝试使用 UILocalNotification 使用 swift 2.0 构建一个闹钟应用程序。当我单击按钮时,我从 UIPickerView 获取时间和日期。我也想
有谁知道“PushNotificationIOS”方法“scheduleLocalNotification”的“fireDate”对象的日期和时间格式 提前致谢 最佳答案 我在向 fireDate 发
native react :0.44.3 目标平台:iOS 开发操作系统:macOS Sierra 10.12.4 构建工具:XCode 这种行为会导致一个非常令人困惑的错误,即预定通知在模拟器上按预
我是一名优秀的程序员,十分优秀!