【发布时间】:2014-07-25 19:14:24
【问题描述】:
在 iOS 8 上是否可以获取所有收到的推送通知的文本?
有没有人在 Apple 提供的文档中找到一些东西?
我知道通知列表可以通过蓝牙设备获取,但我想在本地获取。
【问题讨论】:
标签: objective-c notifications push-notification apple-push-notifications ios8
在 iOS 8 上是否可以获取所有收到的推送通知的文本?
有没有人在 Apple 提供的文档中找到一些东西?
我知道通知列表可以通过蓝牙设备获取,但我想在本地获取。
【问题讨论】:
标签: objective-c notifications push-notification apple-push-notifications ios8
在 Xcode6 中试试这个非常简单:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//-- Set Notification
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
{
[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
[[UIApplication sharedApplication] registerForRemoteNotifications];
}
else
{
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
}
//--- your custom code
return YES;
}
【讨论】: