[英]No valid aps-environment entitlement string found for application for Enterprise app
[英]Failed to get token, error: Error Domain=NSCocoaErrorDomain Code=3000 “no valid 'aps-environment' entitlement string found for application”
被困在这个问题上很长一段时间了。 尝试运行以下行:
[application registerForRemoteNotifications];
并得到错误
(via: - (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
{
NSLog(@"Failed to get token, error: %@", error);
})
2015-04-03 16:06:42.753 TownHall[696:169453] Failed to get token, error: Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0x17426a1c0 {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}
Tried some of the stuff with the following associated post http://stackoverflow.com/questions/10987102/how-to-fix-no-valid-aps-environment-entitlement-string-found-for-application but little luck.
这包括:1) 重新创建配置文件 2) 重新创建 ID 并检查它是否匹配并启用推送 3) 清理和重建等 4) 创建新证书 5) 使用 Xcode > 首选项 > 帐户 > 查看详细信息刷新(选择您的帐户)
想知道是否有人对此有任何解决方案?
很高兴分享人们可能认为对解决此问题有用的任何其他信息。
非常感谢您的帮助!
转到Capabilities
部分下的项目目标,您会发现此错误在发光。 XCode 可能会建议您自动修复它。
您必须在您的项目中创建一个包含以下内容的两个权利(AppName_Debug.entitlements 和 AppName_Release.entitlements)文件:AppName_Debug.entitlements
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist>
AppName_Release.entitlements
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>production</string>
</dict>
</plist>
在适当的选项下在构建设置中的代码签名权限下添加这两个文件。
您没有有效的配置文件或团队没有
如果您看到错误“未找到应用程序的权利字符串”,请在权利文件中添加 aps-environment 和 development 密钥值对,如上所述
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.