@extends('layouts.dashboard') @section('title', __('Push Notifications')) @section('page_title', __('Push Notifications')) @section('content') @include('partials.how-it-works', ['key' => 'admin.push'])
@include('partials.dashboard.stat-card', ['label' => __('Registered devices'), 'value' => $stats['devices'], 'icon' => 'bi-phone', 'color' => 'primary'])
@include('partials.dashboard.stat-card', ['label' => __('Android'), 'value' => $stats['android'], 'icon' => 'bi-android2', 'color' => 'success'])
@include('partials.dashboard.stat-card', ['label' => __('iOS'), 'value' => $stats['ios'], 'icon' => 'bi-apple', 'color' => 'secondary'])
@include('partials.dashboard.stat-card', ['label' => __('Status'), 'value' => $enabled && $project ? __('Live') : __('Off'), 'icon' => 'bi-broadcast', 'color' => $enabled && $project ? 'success' : 'warning', 'hint' => $project ? __('Project :p', ['p' => $project]) : __('No credentials yet')])
@csrf @method('PUT')
{{ __('Firebase Cloud Messaging (HTTP v1)') }}
{{ __('Every in-app notification (enrollments, grades, live classes, fee invoices…) is also delivered to the recipient’s registered devices.') }}
@if($project)
{{ __('Service account loaded') }}: {{ $project }} · {{ $clientEmail }}
@endif
@error('service_account')
{{ $message }}
@enderror
{{ __('Firebase console → Project settings → Service accounts → Generate new private key. Paste the downloaded JSON here. It is stored encrypted-at-rest in your database settings and never shown again.') }}
{{ __('Send a test') }}

{{ __('Sends a push to your own registered devices (:n found). Sign in on the mobile app with this account first.', ['n' => $myDevices]) }}

@csrf
{{ __('Mobile app setup') }}
  1. {{ __('Create a Firebase project and add your Android/iOS apps.') }}
  2. {{ __('Run') }} flutterfire configure {{ __('in the Flutter project to generate') }} lib/firebase_options.dart.
  3. {{ __('The app registers its token via') }} POST /api/v1/device-tokens {{ __('after login and removes it on logout.') }}
@endsection