[英]iOS 5 “Notification Center” API?
I'm talking about this: http://reviews.cnet.com/8301-19512_7-20120625-233/ios-5-notifications-a-deeper-look/ 我在谈论这个: http : //reviews.cnet.com/8301-19512_7-20120625-233/ios-5-notifications-a-deeper-look/
Those pulldown menus on iOS, I for the love of life cannot find any documentation on how to make a notification so that it shows an update while in another application. iOS上的那些下拉菜单,我对生活的热爱找不到任何关于如何发出通知的文档,以便在另一个应用程序中显示更新。 I don't know if I just am using the wrong terminology or what, but is it "NSNotificationCenter", and where is any documentation on it? 我不知道我是在使用错误的术语还是什么,但是它是“NSNotificationCenter”,它的文档在哪里?
Thanks :) 谢谢 :)
The numerical badge isn't the only property of a local notification. 数字徽章不是本地通知的唯一属性。 It can also display banners, and play sounds. 它还可以显示横幅和播放声音。 These banners are subsequently added to notification center. 随后将这些横幅添加到通知中心。
Here's an example: 这是一个例子:
- (void)addNotification {
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = self.datePicker.date;
localNotification.alertBody = self.messageField.text;
localNotification.soundName = UILocalNotificationDefaultSoundName;
localNotification.applicationIconBadgeNumber = 1;
NSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys:@"Object 1", @"Key 1", @"Object 2", @"Key 2", nil];
localNotification.userInfo = infoDict;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
[localNotification release];
}
And here's a tutorial: http://www.icodeblog.com/2010/07/29/iphone-programming-tutorial-local-notifications/ 这是一个教程: http : //www.icodeblog.com/2010/07/29/iphone-programming-tutorial-local-notifications/
refer to Local and Push Notification Programming Guide by apple: 请参阅apple的Local and Push Notification Programming Guide :
http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Introduction/Introduction.html%23//apple_ref/doc/uid/TP40008194-CH1-SW1 http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Introduction/Introduction.html%23//apple_ref/doc/uid/TP40008194-CH1-SW1
NSNotificationCenter
is in fact not related and provides API to pass notifications internally in the app itself. 事实上, NSNotificationCenter
不相关,并提供API以在应用程序本身内部传递通知。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.