Appcelerator:iOS 10 苹果推送服务不工作

Appcelerator : iOS 10 Apple Push Service not working

我正在使用 SDK 5.5.1

我正在尝试使用我自己的 nodejs 服务器在生产环境中发送 APS。 在处于开发状态的设备上发布一切正常。 我得到了设备令牌,设备收到了通知。

在生产中,使用相同的证书导出(使用生产证书和 p12),我可以获得设备令牌,但收不到通知。

有人有解决办法吗?

这是我的tiapp.xml

<?xml version="1.0" encoding="UTF-8"?>
<ti:app xmlns:ti="http://ti.appcelerator.org">
<id>app.test.test</id>
<name>test</name>
<version>1.1.2004</version>
<publisher>Zuhn</publisher>
<url>undefined</url>
<description>undefined</description>
<copyright>2016 by Zuhn</copyright>
<icon>appicon.png</icon>
<fullscreen>false</fullscreen>
<navbar-hidden>false</navbar-hidden>
<analytics>true</analytics>
<guid>mynumber</guid>
<property name="ti.ui.defaultunit" type="string">dp</property>
<property name="run-on-main-thread" type="bool">true</property>
<ios>
    <team-id>mynumber</team-id>

    <enable-launch-screen-storyboard>false</enable-launch-screen-storyboard>
    <use-app-thinning>true</use-app-thinning>
    <plist>
        <dict>
            <key>NSContactsUsageDescription</key>
            <string>Can we use to your contacts?</string>
            <key>NSCameraUsageDescription</key>
            <string>Can we use your camera?</string>
            <key>NSCalendarsUsageDescription</key>
            <string>Can we use your calendar?</string>
            <key>NSPhotoLibraryUsageDescription</key>
            <string>Can we save to your library?</string>
            <key>NSMicrophoneUsageDescription</key>
            <string>Can we use your microphone?</string>

            <key>aps-environment</key>
            <string>production</string>

            <!-- Either development or production -->
            <key>UISupportedInterfaceOrientations~iphone</key>
            <array>
                <string>UIInterfaceOrientationPortrait</string>
            </array>
            <key>UISupportedInterfaceOrientations~ipad</key>
            <array>
                <string>UIInterfaceOrientationPortrait</string>
                <string>UIInterfaceOrientationPortraitUpsideDown</string>
                <string>UIInterfaceOrientationLandscapeLeft</string>
                <string>UIInterfaceOrientationLandscapeRight</string>
            </array>
            <key>UIRequiresPersistentWiFi</key>
            <false/>
            <key>UIPrerenderedIcon</key>
            <false/>
            <key>UIStatusBarHidden</key>
            <true/>
            <key>UIStatusBarStyle</key>
            <string>UIStatusBarStyleDefault</string>
            <key>UIBackgroundModes</key>
            <array>
                <string>voip</string>
            </array>
        </dict>
    </plist>
</ios>
<android xmlns:android="http://schemas.android.com/apk/res/android"/>
<mobileweb>
    <precache/>
    <splash>
        <enabled>true</enabled>
        <inline-css-images>true</inline-css-images>
    </splash>
    <theme>default</theme>
</mobileweb>
<modules/>
<deployment-targets>
    <target device="android">true</target>
    <target device="ipad">false</target>
    <target device="iphone">true</target>
    <target device="mobileweb">false</target>
    <target device="windows">false</target>
</deployment-targets>
<sdk-version>5.5.1.GA</sdk-version>
<plugins>
    <plugin version="1.0">ti.alloy</plugin>
</plugins>
<property name="appc-app-id" type="string">mynumber</property>

这是 Apple 在 Xcode 8 中的重大更改。您需要创建权利文件并将其放在 /app/platform/ios/.entitlements 示例:

MyApp.entitlements

<?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>aps-environment</key>
    <string>development</string> <!-- Either development or production -->
</dict>
</plist>