Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
110 stars 139 forks source link

pushwoosh gives me (Application not found) in XCode #168

Closed int3rnet closed 8 years ago

int3rnet commented 8 years ago

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

x
|    Pushwoosh request:
| Url:      https://cp.pushwoosh.com/json/1.3/getInApps
| Payload:  {"request":{"device_type":1,"language":"en-SA","application":"","userId":"75FF3890-C889-4449-B402-936A1E21B8C7","v":"3.1.1.434","hwid":"75FF3890-C889-4449-B402-936A1E21B8C7"}}
| Status:   "200 no error"
| Response: {"status_code":210,"status_message":"Application not found","response":null}
x
2016-03-15 14:14:02.157 HelloCordova[441:116238] [PW] [I] -[PWRequestManager] 
x
|    Pushwoosh request:
| Url:      https://cp.pushwoosh.com/json/1.3/applicationOpen
| Payload:  {"request":{"userId":"75FF3890-C889-4449-B402-936A1E21B8C7","app_version":"0.0.1","hwid":"75FF3890-C889-4449-B402-936A1E21B8C7","language":"en","os_version":"9.2","package":"com.ajeer.teststc","v":"3.1.1.434","application":"","device_type":1,"jailbroken":0,"device_model":"iPhone7,2"}}
| Status:   "200 no error"
| Response: {"status_code":210,"status_message":"Application not found","response":null}
x
2016-03-15 14:14:02.161 HelloCordova[441:116238] [PW] [I] -[PushNotificationManager] sending appOpen failed
2016-03-15 14:14:02.195 HelloCordova[441:116236] [PW] [I] -[PWRequestManager] 
x
|    Pushwoosh request:
| Url:      https://cp.pushwoosh.com/json/1.3/registerUser
| Payload:  {"request":{"device_type":1,"application":"","userId":"75FF3890-C889-4449-B402-936A1E21B8C7","v":"3.1.1.434","hwid":"75FF3890-C889-4449-B402-936A1E21B8C7"}}
| Status:   "200 no error"
| Response: {"status_code": 210, "status_message": "Request format is not valid."}
x

i checked the provision profile many times and seems good with the App id in ios developer

can any please helps me

thank you

shaders commented 8 years ago

You can safely ignore this errors. They are harmless, though would be fixed in the next release of the plugin.

nickoj81 commented 8 years ago

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

shaders commented 8 years ago

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

shaders commented 8 years ago

For Cordova: http://docs.pushwoosh.com/docs/cordova-phonegap //initialize the plugin pushNotification.onDeviceReady({pw_appid:"PUSHWOOSH_APP_ID"});

nickoj81 commented 8 years ago

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

shaders commented 8 years ago

That's weird. Can you try adding Pushwoosh App Id to the Info.plist file under Pushwoosh_APPID key (as string value)?

nickoj81 commented 8 years ago

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?

ericmachine88 commented 8 years ago

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.

int3rnet commented 8 years ago

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