// 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. 007. 自定义ListBox的item的宽高, 字体居中

    /// <summary> /// 自定义ListBox的item的宽高, 字体居中 /// </summary> /// <param name="sende ...

  2. Iaas-cloudstack概念

    管理serverother high end ports     tomcat20400                     tomcat     server.xml               ...

  3. 【转】jQuery选择器总结

    jQuery 的选择器可谓之强大无比,这里简单地总结一下常用的元素查找方法   $("#myELement")    选择id值等于myElement的元素,id值不能重复在文档中 ...

  4. asp.net生成PDF文件 (1)

    asp.net生成PDF文件 (1) 这个是例子是网上淘来的,哈哈,很有用的! 首先要到网上下载itextsharp.dll,然后添加引用,主程序如下: 1 2 3 4 5 6 7 8 9 10 11 ...

  5. HBase(七): HBase体系结构剖析(下)

    目录: write Compaction splite read Write: 当客户端发起一个Put请求时,首先根据RowKey寻址,从hbase:meta表中查出该Put数据最终需要去的HRegi ...

  6. Spark(二): 内存管理

    Spark 作为一个以擅长内存计算为优势的计算引擎,内存管理方案是其非常重要的模块: Spark的内存可以大体归为两类:execution和storage,前者包括shuffles.joins.sor ...

  7. (转)mongodb分片

    本文转载自:http://www.cnblogs.com/huangxincheng/archive/2012/03/07/2383284.html 在mongodb里面存在另一种集群,就是分片技术, ...

  8. MATLAB GUI对话框设计(转载)

    原文地址:http://blog.csdn.net/shuziluoji1988/article/details/8532982 1.公共对话框: 公共对话框是利用windows资源的对话框,包括文件 ...

  9. vmware 没挂载光盘解决方案

    一定要选中上方的'已连接'

  10. 【maven】之使用jetty发布web项目

    <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin ...