// IOS8 新系统需要使用新的代码注册推送
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)];
}

判断PUSH是否打开的方法是:

//判断推送是否开启

if (isiOS8)

{

UIUserNotificationType type = [application currentUserNotificationSettings].types;

if (type) {

}else

{

}

NSLog(@"------- 推送类型 ------%d",type);

}

else

{

UIRemoteNotificationType type = [application enabledRemoteNotificationTypes];

if (type) {

}else

{

   }

NSLog(@"------- 推送类型 ------%d",type);

}

iOS8远程通知处理的更多相关文章

  1. (九十六)借助APNS实现远程通知、后台任务

    APNS全称为Apple Push Notification Service,可以实现在app不启动时也能通过服务器推送到iOS端特定设备的功能. APNS的实现原理为先发送设备的UDID和应用的Bu ...

  2. 使用JPush(极光推送)实现远程通知

    使用JPush(极光推送)实现远程通知 远程推送是APP 必备的功能, 现在第三方的 SDK 已经做的非常完备了, 在 iOS10.0出来之后, 极光推送也及时更新了他的 SDK, 今天小试了一下效果 ...

  3. iOS10以前的本地通知和远程通知

    一.简介 分为本地推送和远程推送2种.可以在应用没有打开甚至手机锁屏情况下给用户以提示.它们都需要注册,注册后系统会弹出提示框(如下图)提示用户是否同意,如果同意则正常使用:如果用户不同意则下次打开程 ...

  4. iOS 远程通知(Remote Notification)和本地通知(Local Notification)

    ios通知分为远程通知和本地通知,远程通知需要连接网络,本地通知是不需要的,不管用户是打开应用还是关闭应用,我们的通知都会发出,并被客户端收到 我们使用远程通知主要是随时更新最新的数据给用户,使用本地 ...

  5. iOS iOS8注册通知

    http://blog.csdn.net/apple_app/article/details/39228221 极光推送 action设置 http://docs.jpush.cn/display/d ...

  6. 收到远程通知,怎么区分是点击通知栏提醒进去的还是在foreground收到的通知?

    我现在是要区分点击通知栏的通知进入应用还是点击应用图标进入的,1,开始程序都是在后台.2,接受通知都是在foreground状态.applicationdidFinishLaunchWithOptio ...

  7. 远程通知APNs(Apple Push Notification Server)

    推送通知是由应用服务提供商发起的,通过苹果的APNs(Apple Push Notification Server)发送到应用客户端.下面是苹果官方关于推送通知的过程示意图: 推送通知的过程可以分为以 ...

  8. ios开发——实用技术OC-Swift篇&本地通知与远程通知详解

    本地通知与远程通知详解 一:本地通知   Local Notification的作用 Local Notification(本地通知) :是根据本机状态做出的通知行为,因此,凡是仅需依赖本机状态即可判 ...

  9. iOS Notification – 远程通知

    本文讲解iOS的远程通知的基本使用,主要包括远程通知的类型,处理远程通知的场景,以及远程通知相关证书的配置等等. 一.APNs简介 APNs是苹果公司提供的远程通知的服务器,当App处于后台或者没有运 ...

随机推荐

  1. OSGi 的由来和本质特性

    OSGi 的由来 随着科技和需求的发展和变化,现在的软件变得越来越庞大.这样,随之而来的最大挑战就是软件在设计上的越来越复杂和维护上的越来越困难.为了解决这个问题,软件架构师将软件切分成比较小的并且易 ...

  2. easyui datagrid使用(好)

    加载相关js和css,因为easyui依赖jquery,所有加载easyui前要先加载jquery,否则为提示找不到datagrid <!-- 加载jquery --> <scrip ...

  3. java_list,set,map集合

    一.集合定义 集合就是讲诺干用途相同.近似的“数据”结合成一个整体 集合从体系上分为三种 1.列表(List):List集合区分元素的顺序,允许包含相同的元素 2.集(set):Set集合不区分元素的 ...

  4. cocos2d-x,求世界坐标

    老版: http://user.qzone.qq.com/350479720/blog/1384483239 一,求node的世界坐标.因为node的contentSize为0,局部坐标原点与node ...

  5. lambda 的使用汇总

    d=lambda x:x+1print(d(10))lambda 相当于一个轻量函数返回 d=lambda x:x+1 if x>0 else "error"print(d( ...

  6. tnsnames linux找的位置顺序

    In Sue’s article, it states that SQLDeveloper looks for a tnsnames.ora in the following places in th ...

  7. apache配置weblogic部署集群,多节点的项目和单节点项目并存 负载均衡

    开启模块如下: LoadModule weblogic_module modules/mod_wl_22.so LoadModule lbmethod_byrequests_module module ...

  8. selenium+python自动化之操作浏览器

    一.打开网站 1.第一步:从selenium里面导入webdriver模块 2.打开Firefox浏览器(Ie和Chrome对应下面的) 3.打开百度网址 二.设置休眠 1.由于打开百度网址后,页面加 ...

  9. JAVA线程池ThreadPoolExecutor-转

    首先是构造函数签名如下: public ThreadPoolExecutor(int corePoolSize,int maximumPoolSize,long keepAliveTime,TimeU ...

  10. javascript util.js

    //根据Id获得页面元素 function $(para) {    return document.getElementById(para);} //创建一个新的元素function createE ...