Push notification stoped sending

Comments

7 comments

  • Avatar
    Earl

    I'm having the same issue.

    PLUS new device registrations are not getting into the PW database, so all pushes to recently registered devices are NOT working.

  • Avatar
    Lucas

    In your case just new devices doesn't receives the push? Or the oldest devices doesn't receive too? In my case, there isn't any device receiving the push...

  • Avatar
    Earl

    In my case, many devices that registered some time ago are still receiving pushes. We've had working code for a over a year.

    But for some people, the pushes have stopped working. Those people have tried reinstalling our app so their device registers again. For all those people, and new signups -- for anybody who registers a new device -- pushes are not working and I know that the device HWID is not getting in to the PW database.

    This is for iOS only and I believe the problem started recently.

  • Avatar
    benwilson

    Same for me too. iOS only started happening I'd say June 15 - our client was testing so noticed it right away.

    Our App uses Cordova 6.2.0 and pushwoosh-cordova-plugin 5.1.2 (pretty old)

    Here's what we've learned:

    1. Effects only iPhone SE, 6 and 7. iPhone 5 is unaffected
    2. Not dependent on iOS version. Some folks have latest, others a bit older
    3. Response from createMessage is: { "status_code": 200, "status_message": "OK", "response": { "Messages": [ "CODE_NOT_AVAILABLE" ], "UnknownDevices": { "": [ "ffffde32876dfe1197088d2d556e0a72f73610476bab57b0025f69c0a6f4ffff" ] } } }

    "UnknownDevices" bit is the problem - registerDevice is failing.

    ...but... if you use https://github.com/noodlewerk/NWPusher to send the message direct to Apple - it works fine.

    I think they've upgraded something behind the scenes that breaks registerDevice but their dev team says the only problem is the version of the Pushwoosh SDK is too old.

    I have a workaround of sorts.

    I do an extra call to registerDevice to force it. This seems to work 90% of the time. Only trick is to reformat the hwid that you get from a iPhone 6 or 7 to the same format that you get from a 5. In JavaScript:

             function ForceRegisterDeviceiOS(pushwooshAppId, token) {
    
                window.plugins.pushNotification.getPushwooshHWID(
                    function(hwid) {
    
                        if(hwid.length === 32 && hwid.indexOf('-') === -1) {
                            //reformat iPhone 6/7 hwid as iPhone 5 ones
                            //e.g. 0f607264fc6318a92b9e13c65db7cd3c to 0F607264-FC63-18A9-2B9E-13C65DB7CD3C
                            hwid = "{0}-{1}-{2}-{3}-{5}".format(hwid.substr(0,8), hwid.substr(8,4), hwid.substr(12,4),  hwid.substr(16,4),  hwid.substr(20,12)).toUpperCase();
                        }
    
                        var data = {
                            request :{
                                application:pushwooshAppId,
                                push_token:token,
                                hwid: hwid,
                                device_type:1
                            }
                        };
    
                        var headers = {
                            'Content-Type': 'application/json'
                        };
    
                        $.ajax({
                            url: "https://cp.pushwoosh.com/json/1.3/registerDevice",
                            type: 'POST',
                            dataType: 'json',
                            headers: headers,
                            data: JSON.stringify(data),
                            success: success,
                            error: error
                        });
                    }
                );
    
            }
    
  • Avatar
    Earl

    Ben,

    We are still having this issue. Did you update your version of pushwoosh-cordova-plugin?

    We did, and now I'm not sure if we should be using HWID or device token. After updating we see HWIDs that look right (dashes and the new format) but on the PushWoosh control panel we get no report after sending a push. They've told me before that that means the device was not found in their database.

    How are we supposed to test an iOS device anyhow? If we build with production certificates, I'm not sure how we run that build on iOS. If we build in Sandbox, that's no good because I can't change my control panel to Sandbox mode or all the current users will not receive pushes, right?

    I must be doing something wrong.

  • Avatar
    benwilson

    Hi Earl,

    If it returns something like:

    { "status_code": 200, "status_message": "OK", "response": { "Messages": [ "CODE_NOT_AVAILABLE" ] } }

    ...then that's good. Even though it looks bad. You have to turn on debug mode to get it to be more vebose (only lasts for 1 hour before auto turns off)

    The bad message is:

    { "status_code": 200, "status_message": "OK", "response": { "Messages": [ "CODE_NOT_AVAILABLE" ], "UnknownDevices": { "": [ "ffffde32876dfe1197088d2d556e0a72f73610476bab57b0025f69c0a6f4ffff" ] } } }

    ...that means they can't find the token in their database because registerDevice has failed somehow.

    What we did to handle the whole production vs. sandbox thing is to create two Pushwoosh Applications. One for Production and one for sandbox. Then in our dev builds we use the sandbox Pushwoosh Application ID but for Production we use the production Pushwoosh Application ID

    You have to use token not hwid to send. hwid is just used by them I think so they can uniquely identify a device when it registers. hwid can't change but token can.

    Interesting that you've updated and still having problems. If you could capture what the device is sending for registerDevice using http://www.telerik.com/fiddler I'd love to see what the new SDK sends versus my one. I'll be happy to help you set it up. My skype is ben.wilson and I'm on the west coast (North America).

    My gut feel is that they have some kind of load-balancing issue which is causing intermittent registerDevice failures.

  • Avatar
    netwerkapp

    Something similar happening here. 3 different users that are all magically unknown/expired/unsubscribed in the PushWoosh system without the users actually taking any action to unregister.

    Can't reproduce it myself, but might be because my device is already known in the system for a long time.

Please sign in to leave a comment.