Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateMessageResponse does not pass along UnknownDevices #64

Open
curtisgibby opened this issue Feb 9, 2017 · 0 comments
Open

CreateMessageResponse does not pass along UnknownDevices #64

curtisgibby opened this issue Feb 9, 2017 · 0 comments
Assignees
Milestone

Comments

@curtisgibby
Copy link
Contributor

curtisgibby commented Feb 9, 2017

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']);
}
@bgaillard bgaillard self-assigned this Jun 2, 2017
@bgaillard bgaillard added this to the 2.0.0 milestone Jun 2, 2017
@bgaillard bgaillard modified the milestones: 1.9.0, 2.0.0 Jun 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants