Add f7push v0.1: FCM device registry and push API for F7cloud.
Portable occ-based config, OCS endpoints for APK registration, notification relay, and server-side push dispatch.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace OCA\F7Push\Controller;
|
||||
|
||||
use OCA\F7Push\Service\ConfigService;
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\OCSController;
|
||||
use OCP\IRequest;
|
||||
|
||||
class ConfigApiController extends OCSController {
|
||||
public function __construct(
|
||||
string $appName,
|
||||
IRequest $request,
|
||||
private ConfigService $config,
|
||||
) {
|
||||
parent::__construct($appName, $request);
|
||||
}
|
||||
|
||||
/** Public status for mobile clients (no secrets). */
|
||||
#[NoAdminRequired]
|
||||
#[NoCSRFRequired]
|
||||
public function status(): DataResponse {
|
||||
return new DataResponse([
|
||||
'enabled' => $this->config->isEnabled(),
|
||||
'firebaseConfigured' => $this->config->isFirebaseConfigured(),
|
||||
'defaultClickUrl' => $this->config->getDefaultClickUrl(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user