Appcelerator:iOS 10 Apple Push Service 不工作 [英] Appcelerator : iOS 10 Apple Push Service not working

查看:27
本文介绍了Appcelerator:iOS 10 Apple Push Service 不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 SDK 5.5.1

I'm working with SDK 5.5.1

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

I'm trying to send APS in production with my own nodejs server. Everything is working fine with publishing on device in development state. I get the device token and the notification is received by the device.

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

In production, with the same certificate exports (with the production cert and p12), i can get the device token, but not receive the notification.

有没有人有解决办法?

这是我的 tiapp.xml

Here is my 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示例:

It's a breaking change from Apple in Xcode 8. You need to create the entitlements file and place it in /app/platform/ios/.entitlements Example:

MyApp.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>

这篇关于Appcelerator:iOS 10 Apple Push Service 不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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