本地通知插件会导致Ionic应用程序在设备上崩溃

时间:2015-09-08 23:22:18

标签: cordova ionic-framework phonegap-build cordova-plugins localnotification

我正在开发一个Ionic应用程序,我正在使用Phonegap Build来构建它。

我希望能够安排本地通知。出于这个原因,我决定使用以下插件: https://github.com/katzer/cordova-plugin-local-notifications

不幸的是,当我在我的config.xml中包含插件时,当我在设备中启动它时,应用程序崩溃了!奇怪的是,我甚至没有使用本地通知,我只是将插件包含在我的config.xml中!

我的config.xml如下所示:

<?xml version="1.0" encoding="UTF-8" ?>
    <widget xmlns   = "http://www.w3.org/ns/widgets"
        xmlns:gap   = "http://phonegap.com/ns/1.0"
        id          = "xxxxxxxxx"
        version     = "1.0.0" >

    <name>xxxxxxx</name>

    <description>
        xxxxxxxxx
    </description>

    <author href="xxxxxx" email="xxxxxx">
        xxxxxxx
    </author>

    <access origin="*"/>
    <content src="index.html"/>
    <preference name="permissions"                value="none"/>

    <preference name="orientation"                value="default" />        <!-- all: default means both landscape and portrait are enabled -->
    <preference name="target-device"              value="universal" />      <!-- all: possible values handset, tablet, or universal -->
    <preference name="phonegap-version"           value="3.7.0" />

    <!-- IOS specific -->
    <preference name="KeyboardDisplayRequiresUserAction" value="false" />

    <preference name="webviewbounce" value="false"/>
    <preference name="UIWebViewBounce" value="false"/>
    <preference name="DisallowOverscroll" value="true"/>
    <preference name="android-minSdkVersion" value="16"/>
    <preference name="BackupWebStorage" value="none"/>
    <preference name="SplashScreen" value="screen"/>
    <preference name="SplashScreenDelay" value="3000"/>
    <preference name="StatusBarOverlaysWebView" value="false"/>
    <feature name="StatusBar">
        <param name="ios-package" value="CDVStatusBar" onload="true"/>
    </feature>
    <feature name="Keyboard">
        <param name="ios-package" value="IonicKeyboard" onload="true" />
    </feature>

    <platform name="ios">
        <icon src="resources/ios/icon/icon.png" width="57" height="57"/>
        <icon src="resources/ios/icon/icon@2x.png" width="114" height="114"/>
        <icon src="resources/ios/icon/icon-40.png" width="40" height="40"/>
        <icon src="resources/ios/icon/icon-40@2x.png" width="80" height="80"/>
        <icon src="resources/ios/icon/icon-50.png" width="50" height="50"/>
        <icon src="resources/ios/icon/icon-50@2x.png" width="100" height="100"/>
        <icon src="resources/ios/icon/icon-60.png" width="60" height="60"/>
        <icon src="resources/ios/icon/icon-60@2x.png" width="120" height="120"/>
        <icon src="resources/ios/icon/icon-60@3x.png" width="180" height="180"/>
        <icon src="resources/ios/icon/icon-72.png" width="72" height="72"/>
        <icon src="resources/ios/icon/icon-72@2x.png" width="144" height="144"/>
        <icon src="resources/ios/icon/icon-76.png" width="76" height="76"/>
        <icon src="resources/ios/icon/icon-76@2x.png" width="152" height="152"/>
        <icon src="resources/ios/icon/icon-small.png" width="29" height="29"/>
        <icon src="resources/ios/icon/icon-small@2x.png" width="58" height="58"/>
        <icon src="resources/ios/icon/icon-small@3x.png" width="87" height="87"/>
        <splash src="resources/ios/splash/Default-568h@2x~iphone.png" height="1136" width="640"/>
        <splash src="resources/ios/splash/Default-667h.png" height="1334" width="750"/>
        <splash src="resources/ios/splash/Default-736h.png" height="2208" width="1242"/>
        <splash src="resources/ios/splash/Default-Landscape-736h.png" height="1242" width="2208"/>
        <splash src="resources/ios/splash/Default-Landscape@2x~ipad.png" height="1536" width="2048"/>
        <splash src="resources/ios/splash/Default-Landscape~ipad.png" height="768" width="1024"/>
        <splash src="resources/ios/splash/Default-Portrait@2x~ipad.png" height="2048" width="1536"/>
        <splash src="resources/ios/splash/Default-Portrait~ipad.png" height="1024" width="768"/>
        <splash src="resources/ios/splash/Default@2x~iphone.png" height="960" width="640"/>
        <splash src="resources/ios/splash/Default~iphone.png" height="480" width="320"/>
    </platform>

    <gap:plugin name="org.apache.cordova.geolocation" />
    <gap:plugin name="com.phonegap.plugins.PushPlugin" version="2.4.0" />
    <gap:plugin name="org.apache.cordova.network-information" />
    <gap:plugin name="org.apache.cordova.statusbar" />
    <gap:plugin name="org.transistorsoft.cordova.background-geolocation"/>
    <gap:plugin name="nl.x-services.plugins.calendar" />
    <gap:plugin name="com.ionic.keyboard" version="1.0.3" />
    <gap:plugin name="de.appplant.cordova.plugin.local-notification" />

    <gap:plugin name="com.phonegap.plugins.facebookconnect" version="0.9.0">
        <param name="APP_ID" value="xxxxxxx" />
        <param name="APP_NAME" value="xxxxxxx" />
    </gap:plugin>

</widget>

我应该注意到我也使用ng-cordova进行推送通知和facebook(如果我设法解决崩溃问题,我希望本地通知)。

如果我删除插件,那么一切正常。难道我做错了什么?是否存在任何冲突的依赖关系?

修改

我尝试逐个删除插件以检查哪些插件导致冲突,我发现当我包含以下插件时会出现问题:

  • org.transistorsoft.cordova.background-地理位置
  • de.appplant.cordova.plugin.local通知

0 个答案:

没有答案