@@ 47-58 (lines=12) @@ | ||
44 | * |
|
45 | * @return array |
|
46 | */ |
|
47 | public function getAll($limit = self::NOTIFICATIONS_LIMIT, $offset = 0) |
|
48 | { |
|
49 | return $this->api->request('GET', '/notifications?'.http_build_query([ |
|
50 | 'limit' => max(0, min(self::NOTIFICATIONS_LIMIT, filter_var($limit, FILTER_VALIDATE_INT))), |
|
51 | 'offset' => max(0, min(self::NOTIFICATIONS_LIMIT, filter_var($offset, FILTER_VALIDATE_INT))), |
|
52 | ]), [ |
|
53 | 'Authorization' => 'Basic '.$this->api->getConfig()->getApplicationAuthKey(), |
|
54 | 'Content-Type' => 'application/json', |
|
55 | ], json_encode([ |
|
56 | 'app_id' => $this->api->getConfig()->getApplicationId(), |
|
57 | ])); |
|
58 | } |
|
59 | ||
60 | /** |
|
61 | * Send new notification with provided data. |
@@ 51-62 (lines=12) @@ | ||
48 | * |
|
49 | * @return array |
|
50 | */ |
|
51 | public function getAll($limit = self::DEVICES_LIMIT, $offset = 0) |
|
52 | { |
|
53 | return $this->api->request('GET', '/players?'.http_build_query([ |
|
54 | 'limit' => max(0, min(self::DEVICES_LIMIT, filter_var($limit, FILTER_VALIDATE_INT))), |
|
55 | 'offset' => max(0, min(self::DEVICES_LIMIT, filter_var($offset, FILTER_VALIDATE_INT))), |
|
56 | ]), [ |
|
57 | 'Authorization' => 'Basic '.$this->api->getConfig()->getApplicationAuthKey(), |
|
58 | 'Content-Type' => 'application/json', |
|
59 | ], json_encode([ |
|
60 | 'app_id' => $this->api->getConfig()->getApplicationId(), |
|
61 | ])); |
|
62 | } |
|
63 | ||
64 | /** |
|
65 | * Register a device for your application. |