PushNotificationDevices.php
1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
namespace Zendesk\API;
/**
* The PushNotificationDevices class is a wrapper for methods as detailed on https://developer.zendesk.com/rest_api/docs/core/push_notification_devices
* @package Zendesk\API
*
*/
class PushNotificationDevices extends ClientAbstract
{
/**
* @param Client $client
*/
public function __construct(Client $client)
{
parent::__construct($client);
}
/**
* Unregister the mobile devices that are receiving push notifications
*
* @param array $devices
*
* @throws MissingParametersException
* @throws ResponseException
* @throws \Exception
*
* @return bool
*/
public function delete(array $devices = array())
{
$endPoint = Http::prepare('push_notification_devices/destroy_many.json');
$response = Http::send($this->client, $endPoint, array("push_notification_devices" => $devices), 'POST');
if ($this->client->getDebug()->lastResponseCode != 200) {
throw new ResponseException(__METHOD__);
}
$this->client->setSideload(null);
return true;
}
}