您的位置:首页 > 其它

解决Xcode 7 无法推送 或者 打印错误 "remote-notification"

2015-11-06 17:40 190 查看
升级到Xcode 7 之后发现了不少得小问题 ,



看了官方的提示之后,解决了暂时遇到的一些小问题

下面是其中的一个问题,做推送的时候会报出如下错误




You've implemented -[ application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to
add "remote-notification" to the list of your


supported UIBackgroundModes in your Info.plist.



意思是在infoplist
文件中缺少对推送的 配置




下面是解决方法:

在工程的
infoplist 文件中  按图 添加如下:


需要用到的代码 :    Required background
modes     App downloads content in response to push notifications












或者





之间右键 infoplist文件 showInFinder

右键选择大开方式


用文本编辑工具打开

在最下面的</dict>上面添加代码

<key>UIBackgroundModes</key>

    <array>

        <string>remote-notification</string>

    </array>


如下添加






关闭,编辑



之后便OK了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息