【问题标题】:Appcelerator : iOS 10 Apple Push Service not workingAppcelerator:iOS 10 Apple 推送服务不工作
【发布时间】:2016-10-03 04:06:06
【问题描述】:

我正在使用 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>

【问题讨论】:

    标签: push-notification apple-push-notifications appcelerator ios10


    【解决方案1】:

    这是 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>
    

    【讨论】:

    • 这可能会有所帮助:jira.appcelerator.org/browse/TIMOB-23908
    • 所以有了 SDK 5.5.1,我们不需要自己修复任何东西,是吗?
    • 5.5.1 已修复,我相信您无需再更改任何内容
    • 我没有让它在我的应用程序上运行,但你的答案是正确的 :) !我一直在努力!
    • 如果您使用 5.5.1.GA,您不再需要这样做并且对我来说工作正常。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-18
    相关资源
    最近更新 更多