获取 iOS8 上的推送通知列表 [英] Get the Push-Notification list on iOS8

查看:32
本文介绍了获取 iOS8 上的推送通知列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 iOS 8 上获取所有收到的推送通知的文本?

Is it possible to get the text of all the received push notifications on iOS 8?

有人在 Apple 提供的文档中找到了一些东西吗?

Has anyone found something on the documentation provided by Apple?

我知道可以使用蓝牙设备获取通知列表,但我想在本地获取.

I know that the notification list can be obtained using a bluetooth device, but I'd like to get it locally.

推荐答案

在 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;
}

这篇关于获取 iOS8 上的推送通知列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆