ios 为什么即使在 App ID 中显示启用推送通知后,“向您的应用 ID 添加推送通知功能”警告?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/40505216/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 10:45:16  来源:igfitidea点击:

Why "add Push notification feature to your app id" warning even after push-notification showing enabled in App ID?

iosxcodeios10

提问by Sandesh Sardar

I am using Xcode8, swift 3, iOS 10

我正在使用 Xcode8、swift 3、iOS 10

In Targets -> capabilities showing "add the Push notification feature to your app id".

在目标 -> 功能中显示“将推送通知功能添加到您的应用程序 ID”。

I check my APP ID and it is showing pushnotfication enabled in both development and distribution.

我检查了我的 APP ID,它显示在开发和分发中都启用了推送通知。

With same APP IS and certificate I am getting notification in iOS9 but in iOS 10 i am getting error

使用相同的 APP IS 和证书,我在 iOS9 中收到通知,但在 iOS 10 中我收到错误

Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo={NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}  

and also showing red mark (issue)

并且还显示红色标记(问题)

回答by SteMa

I restarted XCode and it was gone :-)

我重新启动了 XCode,它不见了:-)

回答by DBIT

Close Xcode -> reopen -> clean -> build -> run.

关闭 Xcode -> 重新打开 -> 清理 -> 构建 -> 运行。

Fixed the issue for me. Xcode 9.0.

为我解决了这个问题。Xcode 9.0。

回答by sam k

Sadly I quit xcode then installed the .mobileprovision (double clicking it) then restarted xcode and the warning was gone...Followed the other answer here by SteMa

可悲的是,我退出了 xcode,然后安装了 .mobileprovision(双击它)然后重新启动了 xcode,警告消失了......按照 SteMa 的另一个答案

回答by Gary Mansted

This happened to me. For some reason xCode signed me out. The fix: Tap Xcode (top bar) -> select Preferences -> select your Apple Id -> Sign-in. Hope this helps someone!

这发生在我身上。出于某种原因,xCode 将我注销了。修复方法:点击 Xcode(顶部栏)-> 选择首选项-> 选择您的 Apple Id -> 登录。希望这可以帮助某人!

回答by Juntae

In my case it does not help restarting xcode again.

就我而言,它无助于再次重新启动 xcode。

I just restart system and that problem was gone.

我刚刚重新启动系统,这个问题就消失了。

回答by Sandy Chapman

After I enabled push for my app, I had to regenerate my provisioning profiles and re-download them for Xcode to recognized the aps attribute.

在为我的应用程序启用推送后,我必须重新生成我的配置文件并重新下载它们以便 Xcode 识别 aps 属性。

回答by Joseph Astrahan

In my situation I went to here enter image description here& here enter image description here

在我的情况下,我去了这里在此处输入图片说明和这里在此处输入图片说明

under the general tab in xCode settings and reset my bundle identifier to a different name and it fixed the certificates and everything worked!

在 xCode 设置的常规选项卡下,将我的包标识符重置为不同的名称,它修复了证书,一切正常!

Obviously if you need the same bundle identifier you will need to go with some of the other suggestions here, but use this if all else fails.

显然,如果您需要相同的包标识符,您将需要使用这里的其他一些建议,但如果所有其他建议都失败了,请使用它。

回答by Codeicus

In my case, none of the above answers worked. I had to generate new certificates. Xcode >> Preferences... >> Accounts >> select team>> Manage Certificates... >> + >> iOS Development >> repeat+ >> iOS App Store.

就我而言,上述答案均无效。我必须生成新证书。Xcode >> Preferences... >> Accounts >> select team>> Manage Certificates... >> + >> iOS Development >> repeat+ >> iOS App Store。

回答by Chandramani

IF you have enabled Push notification ,your old Provisioning profile become inactive . Edit that old Provisioning profile and download fresh one , then try to generate the build .

如果您启用了推送通知,您的旧配置文件将变为非活动状态。编辑旧的 Provisioning 配置文件并下载新的配置文件,然后尝试生成构建。

回答by Ivan

Check Info.plist -> Bundle identifier and establish it as YourProject -> Targets -> General -> Bundle identifier. Work for me

检查 Info.plist -> Bundle identifier 并将其设置为 YourProject -> Targets -> General -> Bundle identifier。为我工作