Tag: uilocalnotification

需要任何UILocalNotifications的例子

请各位我需要UILocalnotifications任何教程示例显示基于开始date和结束date的警报。 希望任何人都可以让我正确的方向谢谢:)

UILocalNotification根本不起作用

我有一些UILocalNotification非常恼人的问题。 在完成我几乎完成的应用程序时,我注意到无论我尝试了什么,都无法获得本地通知。 所以,我不是浪费时间,而是决定回到基础,看看能否让他们工作。 我创build了一个新的XCode基于视图的应用程序,并用-viewDidLoadreplace了-viewDidLoad : – (void)viewDidLoad { UILocalNotification * theNotification = [[UILocalNotification alloc] init]; theNotification.alertBody = @"Alert text"; theNotification.alertAction = @"Ok"; theNotification.fireDate = [NSDate dateWithTimeIntervalSinceNow:10]; [[UIApplication sharedApplication] scheduleLocalNotification:theNotification]; } 但是,这也没有做任何事情。 我希望在启动应用程序10秒后看到一个通知,但没有出现。 另外,我在iPhone和模拟器上testing了这个。 我在这里错过了一些非常重要的事 ( 我已经通过苹果文档search,找不到为什么会发生这种情况 ) 谢谢

IOS 9和10中的本地和推送通知使用swift3

我在iOS 10开发了local Notifications 。 这是完美的工作。 但是,现在如何编码local notifications和push notification如果用户使用iOS 9及以上版本。 任何人都可以帮忙吗? 以下是iOS 10代码 import UIKit import UserNotifications @available(iOS 10.0, *) class ViewController: UIViewController,UNUserNotificationCenterDelegate { override func viewDidLoad() { super.viewDidLoad() if #available(iOS 10.0, *) { //Seeking permission of the user to display app notifications UNUserNotificationCenter.current().requestAuthorization(options: [.alert,.sound,.badge], completionHandler: {didAllow,Error in }) UNUserNotificationCenter.current().delegate = self } } //To display […]

本地通知在后台

任何人都可以告诉我如何得到一个UILocalNotification而我的应用程序是在后台。 我在这里发布我的代码。 提前致谢。 UILocalNotification *localNotif = [[UILocalNotification alloc] init]; if (localNotif == nil) return; localNotif.fireDate =[startDate addTimeInterval:60]; NSLog(@"%@",localNotif.fireDate); localNotif.timeZone = [NSTimeZone defaultTimeZone]; localNotif.alertAction = @"View"; localNotif.soundName = UILocalNotificationDefaultSoundName; NSString *notifStr=[NSString stringWithFormat:@"Hey looks like you're meeting up with %@, why don't you let your other friends know what fun they're missing out on? Share a photo […]

iOS中的闹钟应用程序

我必须为iPhone创build一个闹钟应用程序,用户可以在其中设置闹钟时间和声音。 在这样做的时候,我使用了UILocalNotification来发起警报。 现在,在UILocalNotification中,首先我们通过选项“Close”和“View”来获得Notification Alert。 如果用户点击“查看”,那么我的委托收到application:didReceiveLocalNotification:消息,并发出警报声音。 但在系统本地报警应用程序中,我们看不到通知警报; 它只是直接播放警报声音。 我如何让我的应用程序使用这种行为?

了解UILocalNotification时区

从文档: fireDate中指定的date根据此属性的值进行解释。 如果您指定nil(默认值),则启动date被解释为绝对GMT时间,适用于倒数计时器等情况。 如果将一个有效的NSTimeZone对象分配给此属性,则激活date被解释为在时区发生更改时自动调整的挂钟时间; 适合这种情况的例子是闹钟。 假设我明天格林尼治标准时间的中午(绝对时间)安排当地通知。 我安排在西雅图下午1点(太平洋时间,格林威治标准时间8),然后立即前往芝加哥下午11时(中部时间,格林威治标准时间-6)。 我的设备从太平洋时间调整到中央时间。 请帮助我了解在以下三种情况下我的通知将会发生: UILocalNotification timeZone被设置为零。 UILocalNotification timeZone被设置为GMT。 UILocalNotification timeZone被设置为太平洋时间。

自定义UILocalNotification的警报

我必须更改alertView的UILocalNotification 。 我怎样才能做到这一点?

如何在iOS中设置闹钟?

我知道这个问题已经问了很多次StackOverflow,但我不能在我的应用程序中设置警报,因为我是iOS的新手? 我正在按照这个教程来设置闹钟: 在iOS中使用UILocalNotification设置提醒。 但是,它似乎并没有为我工作。 我需要每天设置闹钟让我们说每天5.00 PM 。 我不能使用dateselect器来select时间。

UILocalNotification的自定义重复间隔

我尝试了Re.minder应用程序,并注意到它可以用自定义间隔(例如每3分钟,每2小时,每4天…)重复提醒。 我怎样才能做到这一点?

计划本地通知的数量

我正在做一个iPhone应用程序,我已经实施了本地通知的概念,提醒用户吃药。 但在iOS中,我们无法一次安排超过64个通知。 但是我在数据库中有许多date时间条目。 我怎么能安排超过64个通知?