首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >应用程序: iOS 10苹果推送服务不起作用

应用程序: iOS 10苹果推送服务不起作用
EN

Stack Overflow用户
提问于 2016-10-03 04:06:06
回答 1查看 393关注 0票数 0

我正在使用SDK 5.5.1

我正在尝试用我自己的nodejs服务器在生产中发送APS。在开发状态下,在设备上发布一切都很好。我得到设备令牌,设备接收通知。

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

有人有解决办法吗?

这是我的tiapp.xml

代码语言:javascript
复制
<?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>

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-10-03 15:43:03

这是与Apple在Xcode 8中的一个重大变化。您需要创建应享权利文件,并将其放在/app/platform/ios/. create示例中:

MyApp.entitlements

代码语言:javascript
复制
<?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>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39824482

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档