Cordova com.pushwoosh.plugins.pushwoosh 3.6.15粉碎了该应用程序

Cordova com.pushwoosh.plugins.pushwoosh 3.6.15粉碎了该应用程序,cordova,push-notification,cordova-plugins,intel-xdk,pushwoosh,Cordova,Push Notification,Cordova Plugins,Intel Xdk,Pushwoosh,我正在使用Intel XDK开发一个应用程序,我想实现推送通知。 我正在使用pushwoosh cordova插件3.6.15 成功构建后,我将其安装到我的设备上,但该应用程序被压碎了。 当我添加插件但不使用它时,它不会崩溃 这是我为了使用插件而添加的代码行: try { if (/(android)/i.test(navigator.userAgent)) { registerPushwooshAndroid();

我正在使用Intel XDK开发一个应用程序,我想实现推送通知。 我正在使用pushwoosh cordova插件3.6.15 成功构建后,我将其安装到我的设备上,但该应用程序被压碎了。 当我添加插件但不使用它时,它不会崩溃 这是我为了使用插件而添加的代码行:

try {
                if (/(android)/i.test(navigator.userAgent)) {
                    registerPushwooshAndroid();
                } else if (/(iphone|ipad)/i.test(navigator.userAgent)) {

                }
            }
            catch (err) {
                alert(err.message);
            }


This is the implementation of PushwooshAndroid.js:


/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

function registerPushwooshAndroid() {
    var pushNotification = cordova.require("com.pushwoosh.plugins.pushwoosh.PushNotification");

    //set push notifications handler
    document.addEventListener('push-notification',
        function(event) {
            var title = event.notification.title;
            var userData = event.notification.userdata;

            //dump custom data to the console if it exists
            if (typeof(userData) != "undefined") {
                console.warn('user data: ' + JSON.stringify(userData));
            }

            //and show alert
            alert(title);

            //stopping geopushes
            //pushNotification.stopGeoPushes();
        }
    );

    //initialize Pushwoosh with projectid: "GOOGLE_PROJECT_ID", appid : "PUSHWOOSH_APP_ID". This will trigger all pending push notifications on start.
    pushNotification.onDeviceReady({
        projectid: "My ProjectID",
        pw_appid: "My pw_appid"
    });

    //register for push notifications
    pushNotification.registerDevice(
        function(token) {
            alert(token);
            //callback when pushwoosh is ready
            onPushwooshAndroidInitialized(token);
        },
        function(status) {
            alert("failed to register: " + status);
            console.warn(JSON.stringify(['failed to register ', status]));
        }
    );
}

function onPushwooshAndroidInitialized(pushToken) {
    //output the token to the console
    console.warn('push token: ' + pushToken);

    var pushNotification = cordova.require("com.pushwoosh.plugins.pushwoosh.PushNotification");

    //if you need push token at a later time you can always get it from Pushwoosh plugin
    pushNotification.getPushToken(
        function(token) {
            console.warn('push token: ' + token);
        }
    );

    //and HWID if you want to communicate with Pushwoosh API
    pushNotification.getPushwooshHWID(
        function(token) {
            console.warn('Pushwoosh HWID: ' + token);
        }
    );

    pushNotification.getTags(
        function(tags) {
            console.warn('tags for the device: ' + JSON.stringify(tags));
        },
        function(error) {
            console.warn('get tags error: ' + JSON.stringify(error));
        }
    );


    //set multi notificaiton mode
    //pushNotification.setMultiNotificationMode();
    //pushNotification.setEnableLED(true);

    //set single notification mode
    //pushNotification.setSingleNotificationMode();

    //disable sound and vibration
    //pushNotification.setSoundType(1);
    //pushNotification.setVibrateType(1);

    pushNotification.setLightScreenOnNotification(false);

    //setting list tags
    //pushNotification.setTags({"MyTag":["hello", "world"]});

    //settings tags
    pushNotification.setTags({
            deviceName: "hello",
            deviceId: 10
        },
        function(status) {
            console.warn('setTags success');
        },
        function(status) {
            console.warn('setTags failed');
        }
    );

    //Pushwoosh Android specific method that cares for the battery
    //pushNotification.startGeoPushes();
}


Please assist me
I would have sent the APK but I cant becuase its size is 47M
Another thing, I tried the pushwoosh tutorial project and it did not fail, I don't know why
Thanks for your help

请确保您正在按照以下文档添加Pushwoosh XDK插件:


对于英特尔XDK:将pushwoosh英特尔XDK插件添加为第三方插件

我也在index.html代码中包含了这些js脚本:您好,我添加的代码与文档中的完全相同。。它只是不起作用。这与admob插件有关,它们不能很好地生活在一起。我需要帮助通过pushwoosh或其他任何使用intel xdk的方式实现推送通知,我不知道admob如何使用旧的Google Play Services库。你可以附加应用程序的崩溃日志吗?这真的很难猜测。