问题重述:

iOS 8中改变了通知注冊的方式,假设App须要同一时候支持iOS 7 和 8 的话,须要首先检查selector。

解决方式:在Xcode 6中

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
//-- Set Notification
if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)])
{
// iOS 8 Notifications
[application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]]; [application registerForRemoteNotifications];
}
else
{
// iOS < 8 Notifications
[application registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound)];
} //--- your custom code
return YES;
}

參考:

http://stackoverflow.com/questions/24454033/registerforremotenotificationtypes-is-not-supported-in-ios-8-0-and-later

代码转载自:

http://stackoverflow.com/a/24773465/3458781

iOS iOS8中 问题&quot;registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later&quot; 解决方式的更多相关文章

  1. registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later

    本文转载至 http://bbs.csdn.net/topics/390889517 IOS8 PUSH解决方法 昨天晚上整理PUSH的东西,准备些一个教程,全部弄好之后,发现没有达到预期的效果,本以 ...

  2. ios开发中,A valid provisioning profile for this executable was not found,的解决方法

    手头上的一个ios项目在上架后,再进行时出现了以上的这个错误,这是上架后忘了对一些配置进行复原 我的项目解决方法是: 是上面的这一块出现了问题,图片上的配置是正常的情况,但是上架的时候对其进行了修改, ...

  3. registerForRemoteNotificationTypes: is not supported in iOS 8.0 and

    注册模式: if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) { [[UIApplication sharedA ...

  4. js中使用new Date(str)创建时间对象不兼容firefox和ie的解决方式

    /** * 解决 ie,火狐浏览器不兼容new Date(s) * @param strDate * 返回 date对象 * add by zyf at 2015年11月5日 */ function ...

  5. IOS开发中设置控件内容对齐方式时容易混淆的几个属性

    IOS开发中四个容易混淆的属性: 1. textAligment : 文字的水平方向的对齐方式 1> 取值 NSTextAlignmentLeft      = 0,    // 左对齐 NST ...

  6. 解析iOS开发中的FirstResponder第一响应对象

    1. UIResonder 对于C#里所有的控件(例如TextBox),都继承于Control类.而Control类的继承关系如下: 代码如下: System.Object System.Marsha ...

  7. 64位win7中使用vs2013为python3.4安装pycrypto-2.6.1插件报Unable to find vcvarsall.bat异常解决方式

    问题描写叙述: 64位win7中使用vs2013为python3.4.2安装pycrypto-2.6.1插件报Unable to find vcvarsall.bat. 问题分析: 1.源代码分析,查 ...

  8. [iOS] 初探 iOS8 中的 Size Class

    本文转载至  http://www.itnose.net/detail/6112176.html   以前和安卓的同学聊天的时候,谈到适配一直是一个非常开心的话题,看到他们被各种屏幕适配折磨的欲仙欲死 ...

  9. iOS 学习笔记 九 (2015.04.02)IOS8中使用UIAlertController创建警告窗口

    1.IOS8中使用UIAlertController创建警告窗口 #pragma mark - 只能在IOS8中使用的,警告窗口- (void)showOkayCancelAlert{    NSSt ...

随机推荐

  1. Hibernate-02 HQL实用技术

    学习任务 Query接口的使用 HQL基本用法 动态参数绑定查询 HQL的使用 Hibernate支持三种查询方式:HQL查询.Criateria查询.Native SQL查询. HQL是Hibern ...

  2. centos7 install vim8

    centos7 install vim8 Git and dependency Git: https://github.com/vim/vim # yum install -y perl-devel ...

  3. jquery 拖动(Draggable) 约束运动,输出数组排序Array

    <!doctype html><html lang="en"><head> <meta charset="utf-8" ...

  4. turtle安装问题

    原文来源:https://blog.csdn.net/liudongdong19/article/details/81283942 本人python版本为:Python 3.6.5 在安装turtle ...

  5. (14) openssl x509(签署和自签署)

    主要用于输出证书信息,也能够签署证书请求文件.自签署.转换证书格式等. openssl x509工具不会使用openssl配置文件中的设定,而是完全需要自行设定或者使用该伪命令的默认值,它就像是一个完 ...

  6. python对象销毁(垃圾回收)

    Python 使用了引用计数这一简单技术来跟踪和回收垃圾. 在 Python 内部记录着所有使用中的对象各有多少引用. 一个内部跟踪变量,称为一个引用计数器. 当对象被创建时, 就创建了一个引用计数, ...

  7. 数据结构( Pyhon 语言描述 ) — — 第2章:集合概览

    集合类型 定义 个或多个其他对象的对象.集合拥有访问对象.插入对象.删除对象.确定集合大小以及遍历或访问集合的对象的操作 分类 根据组织方式进行 线性集合 线性集合按照位置排列其项,除了第一项,每一项 ...

  8. Python 模块学习(一)

    一.时间模块 import time # 模块调用语句 注意:模块级导入一般放在文件顶部 import datetime print(time.time()) # 1550411181.441547: ...

  9. 【MVC】使用笔记

    1,在ASP.NET MVC中,路由机制特别碉堡,直接对应于动作方法.没有必要给每一个动作方法添加视图,当视图返回View时,路由系统会自动寻找指定目录下的视图资源. public ViewResul ...

  10. 类函数调用与this指针

    1.定义多个对象是,C++编译器只分配一段空间存放公共的函数代码段,调用各个对象的函数时,都调用这个公共的代码片段. 每个对象的存储空间只是包含该对象数据成员所占的空间,函数代码存储在对象空间之外. ...