cordova - i get this alert in my app , only in android.Created with phonegap -
i need find alert on app phonegap , pooshwoosh notification. alert on 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. "device" permission required 'deviceready' event. --> <feature name="http://api.phonegap.com/1.0/device" /> <gap:plugin name="org.apache.cordova.device" version="0.2.8" /> <!-- if not want permissions added app, add following tag config.xml; still have internet permission on app, phonegap requires. --> <preference name="permissions" value="none"/> <!-- customize app , platform 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 , portrait enabled --> <preference name="target-device" value="universal" /> <!-- all: possible values handset, tablet, or universal --> <preference name="fullscreen" value="true" /> <!-- all: hides status bar @ top of screen --> <preference name="webviewbounce" value="true" /> <!-- ios: control whether screen 'bounces' when scrolled beyond top --> <preference name="prerendered-icon" value="true" /> <!-- ios: if icon prerendered, ios not apply it's gloss app's icon on user's home screen --> <preference name="stay-in-webview" value="false" /> <!-- ios: external links should open in default browser, 'true' use webview app lives in --> <!-- <preference name="ios-statusbarstyle" value="black-opaque" /> ios: black-translucent appear black because phonegap webview doesn't go beneath status bar --> <preference name="detect-data-types" value="true" /> <!-- ios: controls whether data types (such phone no. , dates) automatically turned links system --> <preference name="exit-on-suspend" value="false" /> <!-- ios: if set true, app terminate when home button pressed --> <preference name="show-splash-screen-spinner" value="true" /> <!-- ios: if set false, spinner won't appear on splash screen during app loading --> <preference name="auto-hide-splash-screen" value="true" /> <!-- ios: if set false, splash screen must hidden using javascript api --> <preference name="disable-cursor" value="false" /> <!-- blackberry: prevents mouse-icon/cursor being displayed on app --> <preference name="android-minsdkversion" value="7" /> <!-- android: min sdk version supported on target device. max version blank default. --> <preference name="android-installlocation" value="auto" /> <!-- android: app install location. 'auto' choose. 'internalonly' device memory. 'preferexternal' sdcard. --> <!-- plugins can added here. --> <!-- <gap:plugin name="example" /> list of available plugins available @ 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 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 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 external domains. <access /> - blank access tag denies access external resources. <access origin="*" /> - wildcard access tag allows access external resource. otherwise, can specify specific domains: --> <access origin="*"/> <!-- allow local pages --> <access origin="https://cp.pushwoosh.com"/> <!-- <access origin="http://phonegap.com" /> - allow secure requests http://phonegap.com/ <access origin="http://phonegap.com" subdomains="true" /> - same above, including subdomains, such http://build.phonegap.com/ <access origin="http://phonegap.com" browseronly="true" /> - allows http://phonegap.com opened child browser. --> </widget>
when add
<gap:plugin name="org.apache.cordova.device" version="0.2.8" />
i error in image below, using pooshwoosh plug-in too. when remove cordova plug-in, cant send pooshwoosh android need it. idea?
the android code :
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 console if 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 ready onpushwooshandroidinitialized(token); }, function(status) { alert("failed register: " + status); console.warn(json.stringify(['failed register ', status])); }); }
i think somthing verification id ...
remove alert(token);
below method :
pushnotification.registerdevice({ projectid: "------", appid : "-----" }, function(token) { alert(token); //callback when pushwoosh ready onpushwooshandroidinitialized(token); }, function(status) { alert("failed register: " + status); console.warn(json.stringify(['failed register ', status])); });
Comments
Post a Comment