Skip to content

Conversation

@simivar
Copy link

@simivar simivar commented May 11, 2017

PushOver API "Users, Groups, and Devices" states that:

Messages may be addressed to multiple specific devices by joining them with a comma (such as device=iphone,nexus5).

Right now if you use ->setDeviceName('iphone,nexus5') you get an exception Device name must be no more than 25 characters long and contain character set [A-Za-z0-9-]. This PR fixes it. Now you can use:

$user = new User('myID', 'motorola');
$user->setDeviceName('iphone')
     ->setDeviceName('nexus5');

echo $user->getDeviceName(); // prints 'motorola,iphone,nexus5'

A device that is not correct still throws an exception:

$user = new User('myID', 'motorola-over-25-characters');

// Exception: Device name must be no more than 25 characters long and contain character set [A-Za-z0-9-]

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant