ios - 如何创建本地通知ios

标签 ios uilocalnotification

    UILocalNotification* localNotification = [[UILocalNotificationalloc] init]; 
localNotification.alertBody = @"Your alert message";
localNotification.timeZone = [NSTimeZone defaultTimeZone];
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];

我没有收到本地通知,谁能告诉我如何获得本地通知。

最佳答案

localNotification.fireDate = [NSDate dateWithTimeIntervalSinceNow:60];

试试这个!!!!

关于ios - 如何创建本地通知ios,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23976898/

相关文章:

ios - 如何在警报通知时自动启动应用程序?

ios - Swift 中每 24 小时一次的本地通知

ios - renderInContext 抛出崩溃

android - 如何在 iOS 上注册 React Native 模块

ios - 如何从一个类中访问另一个类中的值? swift 4

ios - iPhone UILocalNotification 加载特定 View

ios - 当应用程序在后台时,iPhone PresentLocalNotificationNow 不会触发警报和声音

ios - 覆盖已经显示的本地通知

ios - 在 iOS 中使用 dispatch_async 时的内存警告

iphone - 如何以编程方式向下滚动 UITable