简体   繁体   English

缺少推送通知权利

[英]Missing Push Notification Entitlement

I have received a warning mail from Apple after submitting the binary build.提交二进制构建后,我收到了来自 Apple 的警告邮件。

    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.
    
    After you’ve corrected the issues, you can use Xcode or Application Loader to upload a new binary to iTunes Connect.

I am not using Push notifications or any third party frameworks like Coredova but I am not sure why I am getting this warning again and again.我没有使用推送通知或任何第三方框架,如 Coredova,但我不确定为什么我会一次又一次地收到此警告。 I have gone through the following links but everywhere it is third party framework issue.我浏览了以下链接,但到处都是第三方框架问题。

I don't want to enable push notification service as I am not going to use it in my app.我不想启用推送通知服务,因为我不会在我的应用程序中使用它。 How can this be fixed?这怎么能解决?

Note: Already several times I have tried deleting and re-creating my profiles and certificates.注意:我已经多次尝试删除并重新创建我的配置文件和证书。

Missing Push Notification Entitlement warning 缺少推送通知授权警告

Missing Push Notification Entitlement 缺少推送通知权利

IOS Missing Push notification entitlement IOS 缺少推送通知权利

I am pretty certain that it is a bug in Apples checking system.我很确定这是苹果检查系统中的一个错误。 I uploaded an app yesterday and got this message.我昨天上传了一个应用程序并收到了这条消息。 This app has been updated at least 30 times without any problems.此应用程序已更新至少 30 次,没有任何问题。 I didn't add any push notification code in the last version and I don't use any frameworks like PhoneGap or Cordova that could cause this message.我没有在上一个版本中添加任何推送通知代码,也没有使用任何可能导致此消息的框架,如 PhoneGap 或 Cordova。 It doesn't appear under notifications on the device.它不会出现在设备的通知下方。

I have searched the app for push notification code without finding anything:我在应用程序中搜索了推送通知代码,但没有找到任何内容:

grep -r "registerUserNotificationSettings" . grep -r "registerUserNotificationSettings" 。
grep -r "registerForRemoteNotificationTypes" . grep -r "registerForRemoteNotificationTypes" 。

I finally tried to upload the previous version that was approved in July (and didn't generate an email).我终于尝试上传7月份批准的先前版本(并且没有生成电子邮件)。 This this time I got the warning email also for this version.这次我也收到了这个版本的警告邮件。 So I think that Apple is wrong and I will take my chances and hope it will be approved despite the warning.所以我认为苹果是错误的,我会抓住机会,希望尽管有警告,但它会被批准。


EDIT: Found this reply from an Apple staff in Apple Developer Forum:编辑:在 Apple Developer Forum 中找到了一位 Apple 员工的回复:

"That notice is a warning only, not a rejection. “该通知只是警告,而不是拒绝。

The app validator checks for an implementation of the UIApplicationDelegate method application:didRegisterForRemoteNotificationsWithDeviceToken: in the app.应用验证器检查应用中 UIApplicationDelegate 方法 application:didRegisterForRemoteNotificationsWithDeviceToken: 的实现。 You'll get the warning you described if your app delegate implements that method and there is no aps-environment entitlement.如果您的应用程序委托实现了该方法并且没有 aps-environment 权利,您将收到您描述的警告。

It's possible that a third-party library you're using has implemented that method even though your app doesn't do anything with push notifications.即使您的应用程序没有对推送通知执行任何操作,您使用的第三方库也可能实现了该方法。 In that case you can just ignore the warning.在这种情况下,您可以忽略警告。 It's there to let developers who do use push notifications know if they might have signed their app incorrectly."它可以让使用推送通知的开发人员知道他们是否可能错误地签署了他们的应用程序。”


EDIT 2: I now have two different apps that have been approved without any problems despite generating the warning email编辑 2:尽管生成了警告电子邮件,但我现在有两个不同的应用程序已被批准而没有任何问题

Here are a few things you might want to double check:以下是您可能需要仔细检查的一些事项:

Apple Developer Center苹果开发者中心

In the section Identifiers > App IDs , Push Notifications should not be enabled if you are not implementing them.Identifiers > App IDs 部分,如果您没有实现推送通知,则不应启用它们。

Apple 开发者中心:应用程序服务

You will have to generate a new mobile provisioning each time your enable or disable a service.每次启用或禁用服务时,您都必须生成新的移动配置。 Make sure Push Notifications is not listed in your app enabled services:确保推送通知未列在您的应用程序启用服务中:

在此处输入图片说明

Xcode project target settings Xcode 项目目标设置

In the Capabilities tab of your application target, Push Notifications should be turned off.在应用程序目标的Capabilities选项卡中,应该关闭推送通知

Also, in Background Modes , there should not be any Remote Notifications mode.此外,在后台模式中,不应有任何远程通知模式。

在此处输入图片说明

Application Delegate申请委托

Finally, make sure you're not having your application delegate registering for remote notifications and that it is not implementing any remote notification delegate methods.最后,确保您的应用程序委托没有注册远程通知,并且没有实现任何远程通知委托方法。 You should make sure the following methods are not called or implemented:您应该确保未调用或实现以下方法:

  • registerForRemoteNotifications() ( registerForRemoteNotificationTypes() prior to iOS 8.0 ) registerForRemoteNotifications()iOS 8.0之前的registerForRemoteNotificationTypes()
  • unregisterForRemoteNotifications()
  • isRegisteredForRemoteNotifications()
  • application(_:didRegisterForRemoteNotificationsWithDeviceToken:)
  • application(_:didFailToRegisterForRemoteNotificationsWithError:)
  • application(_:didReceiveRemoteNotification:fetchCompletionHandler:)
  • application(_:handleActionWithIdentifier:forRemoteNotification:completionHandler:)
  • application(_:didReceiveRemoteNotification:)

Hope that helps!希望有帮助!

I am receiving the same email but it seems to only be a warning and my apps managed to get approved to the store.我收到了同样的电子邮件,但它似乎只是一个警告,我的应用程序设法获得了商店的批准。

I have an app that I have been updating in the past 2 years, it does not have push notifications and it's been all good so far until my recent release when I got this warning.我有一个在过去 2 年里一直在更新的应用程序,它没有推送通知,到目前为止一切都很好,直到我最近发布时收到此警告。 After contacting Apple it seems this is just a warning and should not be considered.在联系 Apple 后,这似乎只是一个警告,不应予以考虑。 I think it's an error on their side so hopefully they will get it fixed in the next Xcode update.我认为这是他们的错误,所以希望他们能在下一次 Xcode 更新中修复它。

Go to Target > Capabilities,转到目标 > 能力,

Push notification should be enabled without any issues and Background mode also should be enabled.推送通知应该没有任何问题地启用,并且还应该启用后台模式。

For me too looks like a bug from Apple.对我来说,它看起来也像是 Apple 的错误。 The latest version of my app got the warning as well, yet was approved within a week.我的应用程序的最新版本也收到了警告,但在一周内就获得了批准。 In this new version I am using an extremely simple Today widget.在这个新版本中,我使用了一个非常简单的 Today 小部件。 Thus, I have to link the NotificationCenter framework.因此,我必须链接 NotificationCenter 框架。 The widget reports some data from the containing app.小部件报告来自包含应用程序的一些数据。 To do so, it simply uses the NSUserDefaults which are shared via the App Groups entitlement.为此,它只需使用通过 App Groups 权利共享的 NSUserDefaults。 Nothing remotely as sofisticated as push notification.没有什么比推送通知更复杂的了。

Apple writes that push notification can be used to manage Today widgets: Apple 写道,推送通知可用于管理 Today 小部件:

https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/NotificationCenter.html https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/NotificationCenter.html

Perhaps for that reason including the NotificationCenter framework did trigger the warning, albeit mistakenly.也许是因为这个原因,包括 NotificationCenter 框架确实触发了警告,尽管是错误的。

This message is actually a warning to indicate that somewhere in your code, the methods for registering for a push token were used (indicating that your app is trying to use push notifications), but as the required entitlement is missing, this functionality is not going to work.此消息实际上是一个警告,表明在您的代码中的某处使用了注册推送令牌的方法(表明您的应用程序正在尝试使用推送通知),但由于缺少所需的权利,此功能将无法运行上班。

It seems at the moment If one doesn't use APN the warning can be ignored.目前看来,如果不使用 APN,则可以忽略警告。

It's possible that a third party library has implemented this functionality, even if your app does not use it.第三方库可能已经实现了此功能,即使您的应用程序没有使用它。 In that case, you can ignore the warning.在这种情况下,您可以忽略警告。 Although, you may want to understand what each library you include in your app is doing before publishing your app, to avoid unwanted surprises like this occurring in the future.不过,在发布应用之前,您可能想了解应用中包含的每个库正在做什么,以避免将来发生此类意外。

I would start by searching the code for registerForRemoteNotificationTypes or registerUserNotificationSettings , which are both used to register for push notifications (depending on the version of the OS).我将首先搜索registerForRemoteNotificationTypesregisterUserNotificationSettings的代码,它们都用于注册推送通知(取决于操作系统的版本)。

If you find one of them, that's the issue.如果您找到其中之一,那就是问题所在。 You need to remove them, if you're not using notifications.如果您不使用通知,则需要删除它们。

Perhaps the issue is that you're using Local notifications and accidentally registering for remote notifications as well?也许问题在于您正在使用本地通知并且不小心注册了远程通知?

经过 1 个月的深入研究和跟踪,这对我有用缺少推送通知权利警告

I got this warning just by updating some pods (FacebookSDK is one of them).我只是通过更新一些 pod(FacebookSDK 就是其中之一)就收到了这个警告。 I assume one of them is implementing the UIApplicationDelegate method application:didRegisterForRemoteNotificationsWithDeviceToken: which is why i'll just ignore the warning from now on.我假设其中一个正在实现UIApplicationDelegate方法application:didRegisterForRemoteNotificationsWithDeviceToken:这就是为什么我将从现在开始忽略警告。

I was sent this message after I added NSPhotoLibraryUsageDescription... NSPhotoLibraryUsageDescription Permission to access photo gallery ... Since I built in flutter then used Xcode to publish, I added a new build number in pubspec.yaml and closed Flutter.在我添加 NSPhotoLibraryUsageDescription... NSPhotoLibraryUsageDescription 访问照片库的权限后,我收到了这条消息...由于我内置了 flutter 然后使用 Xcode 发布,我在 pubspec.yaml 中添加了一个新的内部版本号并关闭了 Flutter。 Then in Xcode, I also added the new build number.然后在 Xcode 中,我还添加了新的内部版本号。

Making sure that both Flutter and Xcode were closed, use the terminal to navigate to the directory of my project and did the following:确保 Flutter 和 Xcode 都已关闭,使用终端导航到我的项目目录并执行以下操作:

flutter clean flutter build ios颤振清洁颤振构建 ios

After uploading the new build using Xcode, I did not get the warning again.使用 Xcode 上传新版本后,我没有再次收到警告。

For project was created by Flutter For 项目是由 Flutter 创建的

I found an answer from here flutter-itms-90078-missing-push-notification-entitlement我从这里找到了一个答案flutter-itms-90078-missing-push-notification-entitlement

Thanks,谢谢,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM