"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功能。如下图 "Missing <wbr>Push <wbr>Notification <wbr>Entitlement"警告-----以及解决方法
2.要是用第一种方法的话,以后要添加这个功能的时候还要重新设置,重新编辑修改app ids,然后重新生成证书,有点麻烦。相比之下,第二种方法就没有那么麻烦了,只需要在xcode中添加一句话就行,如下 "Missing <wbr>Push <wbr>Notification <wbr>Entitlement"警告-----以及解决方法
以后要是用到了推送功能,直接删掉这句话就行了,方便快捷,还好记!推荐用第二种方法!

转载于:https://www.cnblogs.com/chongyangcui/p/5022364.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在使用 `react-native-push-notification` 时,可以通过设置 `channelId` 属性来指定 Android 平台通知的渠道 ID。渠道 ID 的作用是将通知分组,使用户可以根据需要选择接收或屏蔽不同类型的通知。 要设置 `channelId` 属性,需要先创建一个通知渠道。可以使用 `PushNotification.createChannel()` 方法创建一个新的通知渠道,并指定渠道的名称、描述和其他属性。例如: ``` PushNotification.createChannel( { channelId: "my-channel-id", // 渠道 ID channelName: "My Notification Channel", // 渠道名称 channelDescription: "A channel to categorise my notifications", // 渠道描述 playSound: true, // 是否播放通知声音 soundName: "default", // 通知声音文件名称 importance: 4, // 渠道重要性(0-4) vibrate: true, // 是否震动 }, (created) => console.log(`Channel created: ${created}`) // 回调函数,用于输出渠道是否创建成功 ); ``` 在上面的示例中,我们创建了一个名为 "My Notification Channel" 的通知渠道,并设置了渠道 ID、描述、是否播放声音、声音文件名称、重要性和是否震动等属性。 创建通知渠道后,就可以在发送本地通知时使用 `channelId` 属性来指定通知渠道了。例如: ``` PushNotification.localNotification({ channelId: "my-channel-id", // 指定通知渠道 ID title: "My Notification Title", message: "My Notification Message", date: new Date(Date.now() + 60 * 1000), allowWhileIdle: true, }); ``` 在上面的示例中,我们在发送本地通知时使用 `channelId` 属性来指定通知渠道 ID。这样,通知就会被分配到指定的通知渠道中,便于用户管理和控制。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值