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

升级到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了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值