APNS推送通知头疼;适用于开发但不适用于生产

时间:2010-12-24 08:07:33

标签: apple-push-notifications

嗨朋友们 我至少待了一个星期。对于我的生活,我不会在生产中获得推送通知,在开发中工作正常。

我已经尝试过,我可以在网上找到的任何解决方案,没有任何效果。

我已经将证书重新生成了至少100次

我的entitlements.plist文件很好 -

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>get-task-allow</key>
    <false/>
    <key>aps-environment</key>
    <string>production</string>
    <key>application-identifier</key>
    <string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>
    <key>keychain-access-groups</key>
    <array>
        <string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>
    </array>
</dict>
</plist>

当我改变环境并将get-task-allow设置为true时,它可以与gateway.sandbox.push.apple.com一起使用。我也尝试使用精确的捆绑名称而不是“$(AppIdentifierPrefix)$(CFBundleIdentifier)”

但是当我将aps-environment更改为production并将get-task-allow更改为false时(即使尝试使用true) - 设备也不会收到任何通知。

我尝试过使用pushmebaby,编写我的ownscript,easyapns - 所有这些都与开发有关。 我只是想弄清楚它为什么会破产。

我的构建设置很好,我创建了一个发布配置的副本,称之为ad-hoc,并将codesigning元素设置为entitlements.plist,并将标识设置为相应的配置文件。

我使用相同的方法生成证书文件,就像我用来生成开发人员证书一样

openssl pkcs12 -in aps-production-cert.p12 -out aps-production-cert.pem -nodes

当我使用codesign -dvvvv --entitlements -Forecast.app时,我得到了这个 - 看起来很好。

Executable=/Users/seantan/Documents/Alpha/build/Ad-Hoc-iphoneos/Forecast.app/Forecast
Identifier=com.xxxxxxxx.wforecast
Format=bundle with Mach-O universal (armv6 armv7)
CodeDirectory v=20100 size=2651 flags=0x0(none) hashes=124+5 location=embedded
CDHash=63a3d238db30f8e4fd3c2a545867fe2fe645a981
Signature size=4313
Authority=iPhone Distribution: xxxxxxxx
Authority=Apple Worldwide Developer Relations Certification Authority
Authority=Apple Root CA
Signed Time=Dec 24, 2010 2:24:08 PM
Info.plist entries=25
Sealed Resources rules=3 files=200
Internal requirements count=1 size=216
??qq?<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>application-identifier</key>
    <string>SYK86VV33F.com.xxxxxx.wforecast</string>
    <key>aps-environment</key>
    <string>production</string>
    <key>get-task-allow</key>
    <true/>
    <key>keychain-access-groups</key>
    <array>
        <string>SYK86VV33F.*</string>
    </array>
</dict>
</plist>

我完全没有想法/解决方案。有人能指出我正确的方向吗?

在有人建议之前,我已尝试使用gateway.push.apple.com进行制作,并尝试使用gatetway.sandbox.push.apple.com进行开发

1 个答案:

答案 0 :(得分:2)

我有类似的问题。单步执行this Apple developer document中描述的说明帮助了我。我不得不做几处修改,所以我不能确切地说是哪个解决了问题。也许你的问题不同,但是希望有些东西可以帮助你。