苹果推送通知 - 没有有效的“aps-environment"已经尝试了我在网上看到的所有解决方案? [英] apple push notifications - no valid 'aps-environment' have tried all solutions I've seen on web?

查看:50
本文介绍了苹果推送通知 - 没有有效的“aps-environment"已经尝试了我在网上看到的所有解决方案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力让推送通知起作用!我正在关注 本教程 基本上没有有用.我已经多次删除 xcode,重做整个苹果开发证书,几次清理我的登录钥匙串.这对一些问题有帮助,但最后我还是卡住了.

我认为我需要做的事情(通过阅读其他人的经验):1)我的openssl证书和密钥需要与苹果服务器交谈2) 具有此 openssl 证书的应用程序 ID 具有与之关联的配置文件.3) 构建(在 xcode 中)需要具有与之关联的正确配置文件4) 构建标识符(在 xcode 中)需要与具有配置文件的应用程序 ID 具有相同的文本4) ???

据我所知,一切正常:

  1. 我的 ssl 证书 + 密钥很好地与苹果服务器通信(忽略错误,我最终还是得到了提示):

<块引用>

MacBook-Pro:apple_dev_certification nflacco$ openssl s_client -connectgateway.sandbox.push.apple.com:2195 -key xxx.pem -cert xxx.pem 输入xxx.pem 的密码:CONNECTED(00000003) depth=1/C=US/O=Entrust,Inc./OU=www.entrust.net/rpa 以引用方式并入/OU=(c) 2009Entrust, Inc./CN=Entrust 证书颁发机构 - L1C 验证错误:num=20:无法获得本地颁发者证书.....

2,3,4) 当我创建一个新项目时,它永远不会获得正确的应用程序 ip(构建设置->信息包标识符).如果我的配置文件与com.xxx"匹配,那么应用程序将始终是com.xxx.FOO",因此选择了默认的 IOS 团队配置文件.我像这样运行应用程序,然后得到:

<块引用>

2011-10-22 22:42:45.086 VVV[3552:707] 获取令牌失败,错误:错误域=NSCocoaErrorDomain 代码=3000没有有效的 'aps-environment'找到应用程序的权利字符串" UserInfo=0x16d140{NSLocalizedDescription=没有有效的aps-environment"权利字符串找到申请}

4 contd) 我想使用我的配置文件,它使用我的应用程序 ID 并启用推送,因此我将应用程序标识符更改为com.xxx",并在构建菜单的代码签名选项中选择正确的配置文件.将它安装在我的 iPhone 上,同样的事情:(

我唯一能想到的:

  • 我的配置文件不正确?我做了几个新的次,删除了 xcode 管理器中所有现有的,但是这个没有帮助.
  • 代码仍在使用团队资料而不是我的新资料进行签名一?有没有办法确保这一点?

关于我应该在这里做什么的任何想法?这不可能这么复杂.我是否应该擦除我的 HD 并从头开始重新安装并希望它有效?

解决方案

你知道那是什么吗?我的应用 ID.

foo.bar 被视为 foo.bar.*(这是不允许的)

你必须有 foo.bar.xxx

I'm tearing my hair out trying to get push notifications to work! I'm following this tutorial to basically no avail. I've deleted xcode several times, redone the whole apple dev certificate, cleaned out my login keychain a few times. This has helped a few issues, but at the end I'm still stuck.

What I think I need to do (from reading other people's experience with this): 1) My openssl cert and key need to be talk to the apple server 2) The app id with this openssl cert has a provisioning profile associated with it. 3) The build (in xcode) needs to have the proper provisioning profile associated with it 4) The build identifier (in xcode) needs to have the same text as the application id with the provisioning profile 4) ???

As far as I can tell, all of this is ok:

  1. My ssl certificate + key talk nicely to the apple server (ignore the error, I still get a prompt eventually):

MacBook-Pro:apple_dev_certification nflacco$ openssl s_client -connect gateway.sandbox.push.apple.com:2195 -key xxx.pem -cert xxx.pem Enter pass phrase for xxx.pem: CONNECTED(00000003) depth=1 /C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C verify error:num=20:unable to get local issuer certificate .....

2,3,4) When I create a new project, it never gets the right app ip (build settings->info-bundle identifier). If my provisioning profile matches 'com.xxx' then the app will always be 'com.xxx.FOO', so the default IOS Team Provisioning Profile is selected. I run the app like that, and get:

2011-10-22 22:42:45.086 VVV[3552:707] Failed to get token, error: Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0x16d140 {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}

4 contd) I want to use my provisioning profile that uses my app id with push enabled, so I change the app identifier to 'com.xxx', and select the proper profile in the code signing option in the build menu. Install it on my iPhone, same thing :(

The only things I can think of:

  • My provisioning profile is not correct? I've made a new one several times, deleted the all existing ones in xcode organizer, but this hasn't helped.
  • Code is still getting signed with the Team Profile instead of my new one? Is there a way to ensure this?

Any ideas on what I should do here? This can't be this complicated. Should I just wipe my HD and reinstall from scratch and hope it works?

解决方案

You know what it was? My app id.

foo.bar is treated as foo.bar.* (which is not permitted)

you have to have foo.bar.xxx

这篇关于苹果推送通知 - 没有有效的“aps-environment"已经尝试了我在网上看到的所有解决方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆