ItunesConnect:"Missing Push Notification Entitlement"警告-----以及解决方法

最近开发的cordova应用,要做ios的适配,并且发布版本,但是有一次在发测试版本的时候,突然收到一封邮件警告,原文如下:

Missing Push Notification Entitlement - 
Your app appears to include API used to register with the Apple Push Notification service, 
but the app signature’s entitlements do not include the “aps-environment” entitlement. If your app uses the Apple Push Notification 
service, make sure your App ID is enabled for Push Notification in the Provisioning Portal, and resubmit after signing your app with 
a Distribution provisioning profile that includes the “aps-environment” entitlement. See “Provisioning and Development” in the Local 
and Push Notification Programming Guide for more information. 
If your app does not use the Apple Push Notification service, no action is required. 
You may remove the API from future submissions to stop this warning. If you use a third-party framework, you may need to contact 
the developer for information on removing the API.
看了看,虽然提示可以忽略,官网也有提到,并不影响审核的通过,但是对于有强迫症的人来说,总收到这样的邮件,每发一回就会有一回警告,心里总感觉有点不舒服!
 
废话不多说,直接上解决方案:
首先看邮件就知道问题所在,你的App IDs中打开了Push Notification功能,也就是推送,但是在软件中并没有用到推送这个功能,这里有两种方法:
1.你可以登陆到开发者中心https://developer.apple.com,找到相应应用的App IDs,点击Edit,关闭Push Notifications功能。如下图

2.要是用第一种方法的话,以后要添加这个功能的时候还要重新设置,重新编辑修改app ids,然后重新生成证书,有点麻烦。相比之下,第二种方法就没有那么麻烦了,只需要在xcode中添加一句话就行(DISABLE_PUSH_NOTIFICATIONS=1),如下

以后要是用到了推送功能,直接删掉这句话就行了,方便快捷,还好记!推荐用第二种方法!
原文地址:https://www.cnblogs.com/lxlx1798/p/10473571.html