Notifications
This commit is contained in:
parent
a3a87d39d2
commit
64b50ead9f
@ -53,6 +53,7 @@ $router->any('/api/HA', 'GoogleHomeApi@response');
|
||||
$router->post('/api/endpoint/', 'EndpointsApi@default');
|
||||
$router->any('/api/update/', 'UpdatesApi@default');
|
||||
$router->any('/api/users/status', 'UsersApi@status');
|
||||
$router->any('/api/users/subscribe', 'UsersApi@subscribe');
|
||||
|
||||
// examples
|
||||
$router->any('/api/example', 'ExampleApi@example');
|
||||
|
@ -34,4 +34,13 @@ class UsersApi extends ApiController{
|
||||
}
|
||||
$this->response(['value'=>'OK']);
|
||||
}
|
||||
|
||||
public function subscribe(){
|
||||
//$this->requireAuth();
|
||||
|
||||
$subscriptionToken = $this->input['token'];
|
||||
$subscriptionUserId = $this->input['user_id'];
|
||||
NotificationManager::addSubscriber($subscriptionUserId, $subscriptionToken);
|
||||
$this->response(['value'=>'OK']);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user