| @@ 53-66 (lines=14) @@ | ||
| 50 | * |
|
| 51 | * @return array |
|
| 52 | */ |
|
| 53 | public function getAll($limit = self::DEVICES_LIMIT, $offset = 0) |
|
| 54 | { |
|
| 55 | return $this->api->request('GET', '/players?' . http_build_query([ |
|
| 56 | 'limit' => max(0, min(self::DEVICES_LIMIT, filter_var($limit, FILTER_VALIDATE_INT))), |
|
| 57 | 'offset' => max(0, min(self::DEVICES_LIMIT, filter_var($offset, FILTER_VALIDATE_INT))), |
|
| 58 | ]), [ |
|
| 59 | 'headers' => [ |
|
| 60 | 'Authorization' => 'Basic ' . $this->api->getConfig()->getApplicationAuthKey(), |
|
| 61 | ], |
|
| 62 | 'json' => [ |
|
| 63 | 'app_id' => $this->api->getConfig()->getApplicationId(), |
|
| 64 | ], |
|
| 65 | ]); |
|
| 66 | } |
|
| 67 | ||
| 68 | /** |
|
| 69 | * Register a device for your application. |
|
| @@ 57-70 (lines=14) @@ | ||
| 54 | * |
|
| 55 | * @return array |
|
| 56 | */ |
|
| 57 | public function getAll($limit = self::NOTIFICATIONS_LIMIT, $offset = 0) |
|
| 58 | { |
|
| 59 | return $this->api->request('GET', '/notifications?' . http_build_query([ |
|
| 60 | 'limit' => max(0, min(self::NOTIFICATIONS_LIMIT, filter_var($limit, FILTER_VALIDATE_INT))), |
|
| 61 | 'offset' => max(0, min(self::NOTIFICATIONS_LIMIT, filter_var($offset, FILTER_VALIDATE_INT))), |
|
| 62 | ]), [ |
|
| 63 | 'headers' => [ |
|
| 64 | 'Authorization' => 'Basic ' . $this->api->getConfig()->getApplicationAuthKey(), |
|
| 65 | ], |
|
| 66 | 'json' => [ |
|
| 67 | 'app_id' => $this->api->getConfig()->getApplicationId(), |
|
| 68 | ], |
|
| 69 | ]); |
|
| 70 | } |
|
| 71 | ||
| 72 | /** |
|
| 73 | * Send new notification with provided data. |
|