我在我的应用程序中收到此警报,仅在android中。使用phonegap创建

gpweb

我需要帮助,以通过phonegap和pooshwoosh通知在我的应用程序中找到此警报的位置我仅在android上收到此警报。

<?xml version="1.0" encoding="UTF-8"?>
<!-- config.xml reference: https://build.phonegap.com/docs/config-xml -->
<widget xmlns     = "http://www.w3.org/ns/widgets"
        xmlns:gap = "http://phonegap.com/ns/1.0"
        id        = "........."
        version   = "1.0.1">

    <name>....</name>

    <description>
       .... 
    </description>

    <author .....
    </author>

    <!--
        Enable individual API permissions here.
        The "device" permission is required for the 'deviceready' event.
    -->
    <feature name="http://api.phonegap.com/1.0/device" />
    <gap:plugin name="org.apache.cordova.device" version="0.2.8" />


    <!--
        If you do not want any permissions to be added to your app, add the
        following tag to your config.xml; you will still have the INTERNET
        permission on your app, which PhoneGap requires.
    -->
    <preference name="permissions"                value="none"/>

    <!-- Customize your app and platform with the preference element. -->
    <!-- <preference name="phonegap-version"      value="3.4.0" /> -->      <!-- all: current version of PhoneGap -->
    <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="fullscreen"                 value="true" />           <!-- all: hides the status bar at the top of the screen -->
    <preference name="webviewbounce"              value="true" />           <!-- ios: control whether the screen 'bounces' when scrolled beyond the top -->
    <preference name="prerendered-icon"           value="true" />           <!-- ios: if icon is prerendered, iOS will not apply it's gloss to the app's icon on the user's home screen -->
    <preference name="stay-in-webview"            value="false" />          <!-- ios: external links should open in the default browser, 'true' would use the webview the app lives in -->
   <!-- <preference name="ios-statusbarstyle"         value="black-opaque" />    ios: black-translucent will appear black because the PhoneGap webview doesn't go beneath the status bar -->
    <preference name="detect-data-types"          value="true" />           <!-- ios: controls whether data types (such as phone no. and dates) are automatically turned into links by the system -->
    <preference name="exit-on-suspend"            value="false" />          <!-- ios: if set to true, app will terminate when home button is pressed -->
    <preference name="show-splash-screen-spinner" value="true" />           <!-- ios: if set to false, the spinner won't appear on the splash screen during app loading -->
    <preference name="auto-hide-splash-screen"    value="true" />           <!-- ios: if set to false, the splash screen must be hidden using a JavaScript API -->
    <preference name="disable-cursor"             value="false" />          <!-- blackberry: prevents a mouse-icon/cursor from being displayed on the app -->
    <preference name="android-minSdkVersion"      value="7" />              <!-- android: MIN SDK version supported on the target device. MAX version is blank by default. -->
    <preference name="android-installLocation"    value="auto" />           <!-- android: app install location. 'auto' will choose. 'internalOnly' is device memory. 'preferExternal' is SDCard. -->

    <!-- Plugins can also be added here. -->
    <!--
        <gap:plugin name="Example" />
        A list of available plugins are available at https://build.phonegap.com/docs/plugins
    -->

    <gap:plugin name="com.pushwoosh.plugins.pushwoosh" version="3.0.2" />
    <gap:plugin name="com.phonegap.plugin.statusbar" />
    <preference name="StatusBarOverlaysWebView" value="true" />
    <preference name="StatusBarBackgroundColor" value="#1d1d1d" />

    <!-- Define app icon for each platform. -->
    <icon src="icon.png" />
    <icon src="res/icon/android/icon-36-ldpi.png"   gap:platform="android"    gap:density="ldpi" />
    <icon src="res/icon/android/icon-48-mdpi.png"   gap:platform="android"    gap:density="mdpi" />
    <icon src="res/icon/android/icon-72-hdpi.png"   gap:platform="android"    gap:density="hdpi" />
    <icon src="res/icon/android/icon-96-xhdpi.png"  gap:platform="android"    gap:density="xhdpi" />
    <icon src="res/icon/ios/icon-57.png"            gap:platform="ios"        width="57" height="57" />
    <icon src="res/icon/ios/icon-72.png"            gap:platform="ios"        width="72" height="72" />
    <icon src="res/icon/ios/icon-57-2x.png"         gap:platform="ios"        width="114" height="114" />
    <icon src="res/icon/ios/icon-72-2x.png"         gap:platform="ios"        width="144" height="144" />

    <!-- Define app splash screen for each platform. -->
    <gap:splash src="res/screen/android/screen-ldpi-portrait.png"  gap:platform="android" gap:density="ldpi" />
    <gap:splash src="res/screen/android/screen-mdpi-portrait.png"  gap:platform="android" gap:density="mdpi" />
    <gap:splash src="res/screen/android/screen-hdpi-portrait.png"  gap:platform="android" gap:density="hdpi" />
    <gap:splash src="res/screen/android/screen-xhdpi-portrait.png" gap:platform="android" gap:density="xhdpi" />
    <gap:splash src="res/screen/ios/screen-iphone-portrait.png"    gap:platform="ios"     width="320" height="480" />
    <gap:splash src="res/screen/ios/screen-iphone-portrait-2x.png" gap:platform="ios"     width="640" height="960" />
    <gap:splash src="res/screen/ios/screen-iphone-landscape.png" gap:platform="ios"     width="480" height="320" />
    <gap:splash src="res/screen/ios/screen-iphone-landscape-2x.png" gap:platform="ios"     width="960" height="640" />
        <gap:splash src="res/screen/ios/screen-iphone-portrait-568h-2x.png" gap:platform="ios"     width="640" height="1136" />
    <gap:splash src="res/screen/ios/screen-ipad-portrait.png"      gap:platform="ios"     width="768" height="1024" />
    <gap:splash src="res/screen/ios/screen-ipad-landscape.png"     gap:platform="ios"     width="1024" height="768" />
    <gap:splash src="res/screen/ios/screen-ipad-landscape-2x.png"     gap:platform="ios"     width="2008" height="1536" />
    <gap:splash src="res/screen/ios/screen-ipad-portrait-2x.png"     gap:platform="ios"     width="1536" height="2008" />

    <!--
        Define access to external domains.

        <access />            - a blank access tag denies access to all external resources.
        <access origin="*" /> - a wildcard access tag allows access to all external resource.

        Otherwise, you can specify specific domains:
    -->
    <access origin="*"/> <!-- allow local pages -->
      <access origin="https://cp.pushwoosh.com"/>
    <!--
        <access origin="http://phonegap.com" />                    - allow any secure requests to http://phonegap.com/
        <access origin="http://phonegap.com" subdomains="true" />  - same as above, but including subdomains, such as http://build.phonegap.com/
        <access origin="http://phonegap.com" browserOnly="true" /> - only allows http://phonegap.com to be opened by the child browser.
    -->

</widget>

当我添加

<gap:plugin name="org.apache.cordova.device" version="0.2.8" />

我在下图中得到错误,我也在使用pooshwoosh插件。当我删除cordova插件时,无法将pooshwoosh发送给android,所以我需要它。任何的想法?

ANDROID代码为:

function registerPushwooshAndroid() {

    var pushNotification = window.plugins.pushNotification;

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

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

                //and show alert
                navigator.notification.alert(title);
                navigator.notification.alert(msg);

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

    //projectid: "GOOGLE_PROJECT_ID", appid : "PUSHWOOSH_APP_ID"
    pushNotification.registerDevice({ projectid: "------", appid : "-----" },
                                    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]));
                                    });
 }

我认为带有验证ID的东西...

图片链接

悉达思(Siddharth_Vyas)

alert(token);从以下方法中删除

pushNotification.registerDevice({ projectid: "------", appid : "-----" },
                                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]));
                                });

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

我如何使用 android 库作为我在我的项目应用程序中创建的模块?

来自分类Dev

为什么我的Android应用程序仅在使用引号“ titleOfApp”时显示在playstore中?

来自分类Dev

收到此消息 - 警告:as.tbl 中的错误:在发布我的闪亮应用程序时找不到函数“as.tbl”

来自分类Dev

我可以使用Visual Studio在HTML5中创建Android应用程序吗?

来自分类Dev

我想使用 FCM 在 android studio 中创建音频呼叫应用程序是否可能

来自分类Dev

如何仅在我的应用程序中禁用声音?

来自分类Dev

为什么我在简单的angularjs程序中收到此错误?

来自分类Dev

我在Google Play测试我的应用程序时收到此错误

来自分类Dev

为什么我在Mediaplayer Android应用中收到此错误“ java.lang.IllegalStateException”

来自分类Dev

Android文件下载和仅在我们的应用程序中读取?

来自分类Dev

Android尝试删除我的应用程序中的文件,但仅删除我的应用程序创建的文件

来自分类Dev

我在android中收到此错误,不知道原因

来自分类Dev

即使使用内置的Android Studio应用程序,我也总是在Android Studio中收到错误“目录中不允许内容”

来自分类Dev

GSON:不能仅在发布的应用程序中使用我的JSONEntity正确创建,使用Android Studio可以正常工作

来自分类Dev

如何使用我在 Azure Active Directory 中创建的应用程序注册本地创建的应用程序?

来自分类Dev

什么在我的应用程序中创建新线程?

来自分类Dev

为什么我从源代码中包含无效的Unicode收到此错误(但仅在导入matplotlib时)

来自分类Dev

我希望我的轮播仅在Rails应用程序中出现在索引页面中

来自分类Dev

如何在手机中放置我在Android Studio中创建的应用程序?

来自分类Dev

如何在我的Android应用程序中创建数据库?

来自分类Dev

试图为我的应用程序创建电子邮件功能,但刚刚收到此错误?错误:变量电子邮件可能尚未初始化

来自分类Dev

我正在尝试使用phonegap在adt中运行android应用

来自分类Dev

从我的 Android 应用程序收到奇怪/可疑的崩溃报告

来自分类Dev

重新启动了android手机,我的phonegap应用程序中的Geolocation停止工作

来自分类Dev

为什么我的图标和启动屏幕没有出现在Phonegap Android应用程序中?

来自分类Dev

为什么我的phonegap应用程序中的href命令不能在iOS上运行,而不能在Android上运行?

来自分类Dev

我的与任务计划程序一起使用的应用程序无法在我的C#代码中创建目录

来自分类Dev

我的与任务计划程序一起使用的应用程序无法在我的C#代码中创建目录

来自分类Dev

仅在Django Administration应用程序中更新模型,而在我的应用程序中未更新

Related 相关文章

  1. 1

    我如何使用 android 库作为我在我的项目应用程序中创建的模块?

  2. 2

    为什么我的Android应用程序仅在使用引号“ titleOfApp”时显示在playstore中?

  3. 3

    收到此消息 - 警告:as.tbl 中的错误:在发布我的闪亮应用程序时找不到函数“as.tbl”

  4. 4

    我可以使用Visual Studio在HTML5中创建Android应用程序吗?

  5. 5

    我想使用 FCM 在 android studio 中创建音频呼叫应用程序是否可能

  6. 6

    如何仅在我的应用程序中禁用声音?

  7. 7

    为什么我在简单的angularjs程序中收到此错误?

  8. 8

    我在Google Play测试我的应用程序时收到此错误

  9. 9

    为什么我在Mediaplayer Android应用中收到此错误“ java.lang.IllegalStateException”

  10. 10

    Android文件下载和仅在我们的应用程序中读取?

  11. 11

    Android尝试删除我的应用程序中的文件,但仅删除我的应用程序创建的文件

  12. 12

    我在android中收到此错误,不知道原因

  13. 13

    即使使用内置的Android Studio应用程序,我也总是在Android Studio中收到错误“目录中不允许内容”

  14. 14

    GSON:不能仅在发布的应用程序中使用我的JSONEntity正确创建,使用Android Studio可以正常工作

  15. 15

    如何使用我在 Azure Active Directory 中创建的应用程序注册本地创建的应用程序?

  16. 16

    什么在我的应用程序中创建新线程?

  17. 17

    为什么我从源代码中包含无效的Unicode收到此错误(但仅在导入matplotlib时)

  18. 18

    我希望我的轮播仅在Rails应用程序中出现在索引页面中

  19. 19

    如何在手机中放置我在Android Studio中创建的应用程序?

  20. 20

    如何在我的Android应用程序中创建数据库?

  21. 21

    试图为我的应用程序创建电子邮件功能,但刚刚收到此错误?错误:变量电子邮件可能尚未初始化

  22. 22

    我正在尝试使用phonegap在adt中运行android应用

  23. 23

    从我的 Android 应用程序收到奇怪/可疑的崩溃报告

  24. 24

    重新启动了android手机,我的phonegap应用程序中的Geolocation停止工作

  25. 25

    为什么我的图标和启动屏幕没有出现在Phonegap Android应用程序中?

  26. 26

    为什么我的phonegap应用程序中的href命令不能在iOS上运行,而不能在Android上运行?

  27. 27

    我的与任务计划程序一起使用的应用程序无法在我的C#代码中创建目录

  28. 28

    我的与任务计划程序一起使用的应用程序无法在我的C#代码中创建目录

  29. 29

    仅在Django Administration应用程序中更新模型,而在我的应用程序中未更新

热门标签

归档