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

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

问题描述

我撕裂了我的头发试图让推送通知的工作!我下面的本教程基本上无济于事。我已经删除了X $ C $Ç几次,重做整个苹果开发证书,清理出我的登录钥匙串几次。这帮助了一些问题,但最后我还是坚持。

我想我需要做的(从阅读其他人的这方面的经验):
1)我的OpenSSL证书和密钥需要被谈论到苹果服务器
2)本OpenSSL的证书应用程序ID具有与其关联的配置文件。
3)构建(以x $ C $三)需要具有与它相关的适当配置的个人资料
4)构建标识符(在X code)需要有相同的文字与供应配置文件的应用程序ID
4)???

据我所知,这一切是确定:


  1. 我的SSL证书+很好地向苹果服务器密钥的谈话(忽略错误,我仍然得到一个提示,最终):


  

的MacBook-PRO:apple_dev_certification nflacco $的OpenSSL的s_client.First -connect
  gateway.sandbox.push.apple.com:2195 -key xxx.pem -cert xxx.pem进入
  密码短语xxx.pem:连接(00000003)深度= 1 / C = US / O =委托,
  Inc./OU=www.entrust.net/rpa通过引用/ OU =(C)2009年注册成立
  委托,Inc./CN=Entrust认证机构 - L1C验证
  错误:NUM = 20:无法获取本地颁发者证书.....


2,3,4)当我创建一个新项目,它从来没有得到正确的应用IP(建设置 - >信息束标识符)。如果我的预置简档匹配'com.xxx',那么应用程序将永远是com.xxx.FOO',所以默认IOS团队发放模板被选中。我喜欢运行的应用程序,并获得:


  

22 2011-10-22:42:45.086 VVV [3552:707]无法获得令牌,错误:
  错误域= NSCocoaErrorDomain code = 3000没有有效的APS-环境
  找到应用程序的授权字符串的UserInfo = 0x16d140
  {NSLocalizedDescription =无有效的APS-环境的权利字符串
  发现应用}


4续)我想用一个使用我的应用程序ID与推使我的预置简档,所以我改变了应用标识符为com.xxx,并选择在了code签名选项正确的个人资料建立菜单。在我的iPhone上安装它,同一件事:(

唯一的东西我能想到的:


  • 我的provisioning profile是不正确的?我做了一个新的数
    次,删除以x code主办方所有现有的,但这
    没有帮助。

  • code仍得到与球队简介,而不是我的新签署
    一?有没有办法来保证呢?

这是我应该做什么在这里的任何想法?这不可能是这个复杂的。如果我只是擦我的房屋,并从头开始重新安装,并希望它的工作原理?


解决方案

您知道它是什么?我的应用程序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-环境”已经试过我已经看到网络上所有的解决方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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