OneSignal\Devices::update PHP Method

update() public method

Update existing registered device for your application with provided data.
public update ( string $id, array $data ) : array
$id string Device ID
$data array New device data
return array
    public function update($id, array $data)
    {
        $data = $this->resolve($data, function (OptionsResolver $resolver) {
            $resolver->setDefined('notification_types')->setAllowedTypes('notification_types', 'int')->setAllowedValues('notification_types', [1, -2]);
        });
        return $this->api->request('PUT', '/players/' . $id, [], json_encode($data));
    }