应用程序因“缺少推送通知权利”而被拒绝

发布于 2024-11-02 10:45:51 字数 288 浏览 3 评论 0原文

最近我的申请在上传时被拒绝了。 Apple 审核团队表示我的应用程序“缺少推送通知权利”

这是他们提供的信息:

缺少推送通知权利 - 您的应用程序向 Apple 推送通知服务注册,但应用程序签名的权利不包括所需的“aps-environment”权利。确保您已为此应用启用推送通知服务,并且已下载包含“aps-environment”权利的分发配置文件。

我的应用程序的早期版本曾经有推送通知,并且我的应用程序二进制文件从未因此被拒绝。我应该在这里做什么?

Recently my application got rejected while uploading it. The Apple review team says my app is "Missing Push Notification Entitlements"

This is the information they have provided:

Missing Push Notification Entitlement - Your app registers with the Apple Push Notification Service, but the application signature's entitlements do not include the required "aps-environment" entitlement. Make sure you have enabled Push Notification Services for this app, and that you have downloaded a Distribution provisioning profile that includes the "aps-environment" entitlement.

Earlier versions of my app used to have push notifications, and my app binary never got rejected due to that. What should I do here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

无所的.畏惧 2024-11-09 10:45:51

在任何文本编辑器中打开您的配置文件并搜索“环境”。

您应该找到:aps-environment

如果您在配置文件中没有看到 aps-environment,则您的 Apple 配置证书存在问题。

如果您创建了一个没有推送通知的证书,然后添加了推送通知服务,Apple 不会更新您的配置文件。

您需要创建一个新的配置文件。使用这个新的配置文件签署二进制文件,然后您就可以开始了。

Open your Provisioning Profile in any Text Editor and search for "environment".

You should find: aps-environment

If you don't see aps-environment in your provisioning profile, there is an issue in your Apple provisioning certificate.

If you created a certificate without push notifications, and then later on you added Push Notification service, Apple DOESN'T update your provisioning profile.

You need to create a NEW provisioning profile. Sign the binary with this new Provisioning Profile and you would be good to go.

假面具 2024-11-09 10:45:51

我已经重新创建了我的分发配置文件并用它构建了我的应用程序。此更改修复了缺少推送通知权利的问题。

I have recreated my Distribution provisioning profile and build my application with it. This change fixed the issue of Missing Push Notification Entitlements.

深者入戏 2024-11-09 10:45:51

如果您提交 Cordova / Phonegap 项目并且不使用推送通知,则应检查 Classes/AppDelegate.m 中是否有以下两种方法。在 Cordova 3.7.0 中观察到,不确定其他版本。

确保您没有以任何其他方式使用远程通知(也要仔细检查您的插件)。然后删除或注释掉以下块:

- (void) application:(UIApplication*)application
    didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
    // re-post ( broadcast )
    NSString* token = [[[[deviceToken description]
        stringByReplacingOccurrencesOfString:@"<" withString:@""]
        stringByReplacingOccurrencesOfString:@">" withString:@""]
        stringByReplacingOccurrencesOfString:@" " withString:@""];

    [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotification object:token];
}

- (void) application:(UIApplication*)application
    didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
{
    // re-post ( broadcast )
    [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotificationError object:error];
}

希望这可以为您节省几个小时;-)

If you are submitting a Cordova / Phonegap project and you are NOT using push notifications, you should inspect Classes/AppDelegate.m for the two methods below. Observed in Cordova 3.7.0, not sure about other versions.

Make sure you are not using remote notifications in any other way (carefully check your plugins as well). Then remove or comment out the following block:

- (void) application:(UIApplication*)application
    didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
    // re-post ( broadcast )
    NSString* token = [[[[deviceToken description]
        stringByReplacingOccurrencesOfString:@"<" withString:@""]
        stringByReplacingOccurrencesOfString:@">" withString:@""]
        stringByReplacingOccurrencesOfString:@" " withString:@""];

    [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotification object:token];
}

- (void) application:(UIApplication*)application
    didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
{
    // re-post ( broadcast )
    [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotificationError object:error];
}

Hope this saves you a few hours ;-)

霓裳挽歌倾城醉 2024-11-09 10:45:51

我遇到了同样的问题,我通过重新创建配置文件来修复它。来自“配置和开发”在本地和推送通知指南中:

接下来,团队管理员或团队代理必须创建在远程通知开发的服务器端使用的配置文件(开发或分发)。配置文件是资产的集合,它将应用程序及其设备的开发人员与授权的开发团队相关联,并使这些设备能够用于测试。该配置文件包含证书、设备标识符、应用程序的捆绑包 ID 以及所有权利,包括 .所有团队成员都必须在他们将运行和测试应用程序代码的设备上安装配置文件。

I had the same problem and I fixed it by recreating the provisioning profile. From "Provisioning and Development" in the Local and Push Notification Guide:

The Team Admin or Team Agent must next create the provisioning profile (Development or Distribution) used in the server side of remote-notification development. The provisioning profile is a collection of assets that associates developers of an application and their devices with an authorized development team and enables those devices to be used for testing. The profile contains certificates, device identifiers, the application’s bundle ID, and all entitlements, including . All team members must install the provisioning profile on the devices on which they will run and test application code.

不知所踪 2024-11-09 10:45:51

我的案例:我已经为我的应用商店应用程序的更新实现了推送通知。由于推送通知实施之前的配置文件变得无效,我创建了新的应用程序商店分发配置文件,并使用新的配置文件构建了应用程序并上传到商店。但我收到一封邮件,上面写着“缺少推送通知权利”。

发现:我发现在归档时,Xcode 使用了错误的(无效/旧的)配置文件。因此,从会员中心删除了旧的配置文件,解决了问题

验证存档时的屏幕截图

My Case : I have implemented push notifications for an update to my appstore app. As the provisioning profiles prior to the push notification impelmentation becomes invalid, I have created new Appstore-distribution provisioning profile and built the app with new profile and uploaded to store. But I got a mail saying "Missing Push Notification Entitlement".

Finding : I found that while archiving, Xcode is using the wrong (invalid/old) provisioning profile. So deleted the old provisioning profile from member centre and it solved the problem

Screenshot while validating the archive

罪#恶を代价 2024-11-09 10:45:51

我收到了同样的错误消息,重新创建我的配置文件并没有消除它。

相反,我发现我的应用程序包含一些未使用的与 APNS 相关的杂散符号(在库中)。显然,他们导致静态分析器将应用程序标记为使用推送通知(但事实并非如此)。 #ifdef-ing 符号允许我的应用程序在没有 aps-environment 权利的情况下被接受。

I received this same error message, and recreating my provisioning profile didn't eliminate it.

Instead I found that my app contained some stray APNS-related symbols (in a library) that weren't being used. Apparently they caused a static analyzer to mark the app as using push notifications (it doesn't). #ifdef-ing out the symbols allowed my app to be accepted without the aps-environment entitlement.

守不住的情 2024-11-09 10:45:51

我在使用 Cordova 应用程序时也遇到了这个问题,在阅读了一些内容之后,这似乎是当今的一个常见问题。

为什么会发生这种情况?

既然您提到您的应用程序已通过推送通知获得批准,最有可能的情况是您的应用程序的配置文件在将其提交到 AppStore 时发生了更改。也许您:

  1. 在 XCode 中重建项目,或者
  2. 转移到另一台计算机并忘记告诉 XCode 正确的配置文件是什么,或者
  3. 有人坐在您的计算机上并更改了它,或者

发生此问题是因为权限是通过配置配置文件收集的。如果您忘记将应用程序的配置文件链接到具有“推送通知”权限的 AppID(请注意,XCode 默认情况下使用通配符开发人员配置证书自动执行此操作),那么您可能会收到此消息,直到您排序出许可。

如何消除 CORDOVA 应用程序中推送通知的需要

当我收到此消息时,我正在提交 Cordova 应用程序,虽然 @jlapoutre 发布的解决方案足以让您的应用程序获得批准,但您想要继续受益于 Cordova 升级,因此最好的办法是利用条件编译(即触发 #ifndef DISABLE_PUSH_NOTIFICATIONS指令告诉 XCode 编译你的应用程序并省略这段代码)。

在 XCode 中,条件编译也称为“预处理器宏”。您可以通过 UI 以图形方式完成此操作(请注意,这是在 XCode 6.1 中完成的方式):

在此处输入图像描述

希望这可以帮助处于相同情况的其他人。

I also had this problem with a Cordova app and after doing a bit of reading it seems that this is a common issue nowadays.

WHY DID IT HAPPEN?

Since you mention that your app was already approved using push notifications, the most likely scenario is that the Provisioning Profile for your app was changed when submitting it to the AppStore. Perhaps you:

  1. rebuilt your project in XCode, or
  2. moved to another computer and forgot to tell XCode what the correct profile was, or
  3. somebody sat on your computer and changed it, or

This issue happens because permissions are gleaned through the provisioning profile. If you forget to link the provisioning profile for your app to an AppID that has the 'Push Notifications' entitlement (Note that XCode does this automatically by using the wildcard developer provisioning certificate by default) then you are likely to get this message until you sort out the permissioning.

HOW TO REMOVE THE NEED FOR PUSH NOTIFICATIONS IN CORDOVA APPS:

I was submitting a Cordova app when I got this message, and while the solution posted by @jlapoutre is enough to get your app approved, you want to continue benefiting from Cordova upgrades so the best thing is to take advantage of conditional compilation (ie triggering the #ifndef DISABLE_PUSH_NOTIFICATIONS directive which tells XCode to compile you app with this bit of code left out).

Conditional compilation is also known as 'Preprocessor Macros' in XCode-speak. This is how the you can accomplish this graphically via the UI (note that this the way its done in XCode 6.1):

enter image description here

Hope this helps other people out there in same situation.

烟沫凡尘 2024-11-09 10:45:51

我最近在将 Today 扩展添加到启用了推送服务的应用程序后遇到了这个问题。最后意识到 Xcode 为 Today Extension 生成的移动配置配置文件没有启用推送通知服务。一旦我启用了 Today Extension 的推送服务,来自 Apple 的警告就消失了。

I recently encountered this issue after adding a Today Extension to an app with Push Services enabled. Finally realized that the Mobile Provisioning profile generated by Xcode for the Today Extension did not have Push Notifications Services enabled. Once I enabled Push Services for the Today Extension, the warning from Apple went away.

梦里的微风 2024-11-09 10:45:51

步骤

  1. 启用推送通知服务(生产推送 SSL 证书)

  2. 创建/重新创建分发配置文件并构建您的
    具有更新的分发配置文件的应用程序。

以下资源可能会对您有所帮助

Steps

  1. Enable Push Notification Service (Production Push SSL Certificate)

  2. Create/Recreate Distribution Provisioning Profile and build your
    application with updated Distribution Provisioning Profile.

The following resources may help you

孤星 2024-11-09 10:45:51

我有同样的问题。我已经解决了。

我认为这个问题是在将推送通知功能添加到 AppID 中并且没有重新创建配置时引起的。
添加 iCloud 功能时我们会收到警告:

您为此应用程序 ID 创建的所有新配置文件都将为 iCloud 启用。如果您希望为与此应用 ID 关联的任何现有配置文件启用 iCloud,您必须手动重新生成它们

我认为当我们在 AppID 中添加某些功能时,我们应该手动重新生成与该应用程序 ID 相关的所有配置文件应用程序 ID。

我想是的

I have same problem. I have solved it.

I think this problem causes when adding push-notification-function into AppID and no recreating Provisioning.
We will receive a warning when adding iCloud-function:

All new provisioning profiles you create for this App ID will be enabled for iCloud. If you wish to enable iCloud for any existing provisioning profiles associated with this App ID, you must manually regenerate them

I think when we add some function in AppID, we should manually regenerate all provisionings which are related to that AppID.

I think so

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文