Skip to content

CreateMessageResponse does not pass along UnknownDevices #64

Description

@curtisgibby

Pushwoosh now includes in its raw createMessage response a list of devices/tokens for which it does not know what they are (likely because the user removed the app or the token was renewed.) This is similar to the bulk /getunregistereddevices call, but applies to each message in the moment as you try to send it. See example output $json from CreateMessageResponse::create below:

Array
(
    [status_code] => 200
    [status_message] => OK
    [response] => Array
        (
            [Messages] => Array
                (
                    [0] => CODE_NOT_AVAILABLE
                )

            [UnknownDevices] => Array
                (
                    [] => Array
                        (
                            [0] => 0017a2859e0cc1d37bdfc83cf3e92a8bb47f6405b213516eba76082562d3a646
                        )

                )

        )

)

It would be helpful if CreateMessageResponse could pass these unknown devices back up the chain to userland code to allow me to remove my records of those bad tokens. A method similar to the existing setMessages would be nice, something like setUnknownDevices:

// If 'UnknownDevices' are provided
if (array_key_exists('UnknownDevices', $json['response'])) {
    $createMessageResponseResponse->setUnknownDevices($json['response']['UnknownDevices']);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions