Closed int3rnet closed 8 years ago
You can safely ignore this errors. They are harmless, though would be fixed in the next release of the plugin.
Hi I'm also getting these errors, followed by: [PushNotificationManager] Registered for push notifications failed
Just preceding it i'm getting this:
Pushwoosh request:
| Url: https://cp.pushwoosh.com/json/1.3/registerDevice
| Payload: {"request":{"sounds":[],"timezone":"3600","device_type":1,"userId":"xxxxxxx","push_token":"xxxxxxx","application":"","os_version":"8.4.1","gateway":"sandbox","language":"en","hwid":"xxxxxx","package":"(my-bundle-id)","device_model":"iPhone4,1","jailbroken":0,"app_version":"1.1.4","v":"4.0.3."}}
| Status: "200 no error"
| Response: {"status_code":210,"status_message":"Application not found","response":null}
The app is also not receiving notifications. I'm 100% sure the app id is correct though as above it's empty in the request - "application":""
Any ideas appreciated
Your Application ID is empty: "application":"" Did you follow the configuration guide step by step?
http://docs.pushwoosh.com/docs/native-ios-sdk In your Info.plist add the following key Pushwoosh_APPID with your Pushwoosh Application ID string value
For Cordova: http://docs.pushwoosh.com/docs/cordova-phonegap //initialize the plugin pushNotification.onDeviceReady({pw_appid:"PUSHWOOSH_APP_ID"});
I'm using Cordova with Meteor.
Yes I copied and pasted the code from the docs and have checked my app id is correct and I've replaced the 'PUSHWOOSH_APP_ID' with my app id.
function initPushwoosh() {
var pushNotification = cordova.require("pushwoosh-cordova-plugin.PushNotification");
//set push notification callback before we initialize the plugin
document.addEventListener('push-notification', function(event) {
//get the notification payload
var notification = event.notification;
//display alert to the user for example
alert(notification.aps.alert);
//clear the app badge
pushNotification.setApplicationIconBadgeNumber(0);
});
//initialize the plugin
pushNotification.onDeviceReady({pw_appid:"PUSHWOOSH_APP_ID"});
//register for pushes
pushNotification.registerDevice(
function(status) {
var deviceToken = status['deviceToken'];
console.warn('registerDevice: ' + deviceToken);
},
function(status) {
console.warn('failed to register : ' + JSON.stringify(status));
alert(JSON.stringify(['failed to register ', status]));
}
);
//reset badges on app start
pushNotification.setApplicationIconBadgeNumber(0);
}
I have seen https://github.com/Pushwoosh/phonegap-cordova-push-notifications/issues/61 is it likely to be a plugin conflict? Do you have an idea of which plugins conflict with this one?
Thanks for the help
That's weird. Can you try adding Pushwoosh App Id to the Info.plist file under Pushwoosh_APPID key (as string value)?
Hi,
Thanks for the reply, I'm using javascript running Meteor and Cordova. How would I go about editing the Info.plist? Is there a Cordova plugin for that?
if i set the PUSHWOOSH_APP_ID into my info.plist, no error. But by right in ios, it should prompt me whether i want to receive notification. Any idea how to solve this? I tested the basic sample it worked. But when integrating with my existing app, it won't work. Same errors as above.
i solved the issue by changing the code that detect the os
here is my new code
function initPushwoosh() { var pushNotification = cordova.require("pushwoosh-cordova-plugin.PushNotification"); var userAgent = navigator.userAgent || navigator.vendor || window.opera; if( userAgent.match( /iPad/i ) || userAgent.match( /iPhone/i ) || userAgent.match( /iPod/i ) ) {
$("*").append('<script type="text/javascript" src="js/PushwooshiOS.js"></script>');
registerPushwooshIOS();
}else if( userAgent.match( /Android/i ) )
{
$("*").append('<script type="text/javascript" src="js/PushwooshAndroid.js"></script>');
//alert("this is android");
registerPushwooshAndroid();
}else {
}
}
and i made importing the js files dynamically so it's decrease the load on phones
Hello everyone
i donwload the sample code from pushwoosh and i changed the PW_ID and the budnle_name for same sample and getting this error
i checked the provision profile many times and seems good with the App id in ios developer
can any please helps me
thank you