BowlerKitBowlerKit

Setup Push Notifications

10/11/2026

Configure Account-profile native/FCM notifications for the Expo template.

Scope

Remote push registration is an Account-profile feature. Guest mode keeps local notification handling but never requests or syncs an FCM/device token.

1. Create the Firebase project

  1. Create or select a project in the Firebase Console.
  2. Enable Firebase Cloud Messaging API (HTTP v1) as required by the current Firebase console.
  3. Register the Android and iOS apps using the exact identifiers in mobile-app/app.config.ts:
    • Android: com.soewidiputra.exonlate.mobile
    • iOS: com.soewidiputra.exonlate.mobile
  4. Download the matching google-services.json and GoogleService-Info.plist.

Do not reuse configuration files registered for a different package or bundle identifier.

2. Add native Firebase files

Copy the files to the mobile project root:

mobile-app/google-services.json
mobile-app/GoogleService-Info.plist

app.config.ts passes these paths to the Android and iOS native projects. Generate a development/release build after changing them; Expo Go does not include your native Firebase configuration.

3. Configure Laravel sending

Create a Firebase service-account key with the minimum permissions required for messaging. Store it outside Git at:

admin-panel/storage/app/firebase-auth.json

NotificationSenderService reads exactly that path. Set restrictive file permissions and never commit the JSON key. The admin panel stores device tokens, persists notification history, and sends FCM messages from its Filament/admin workflows.

4. Register the Account device token

The template calls registerForPushNotificationsAsync() from onboarding and the notification settings screen. On a physical device the hook:

  1. Creates the Android default channel.
  2. Requests notification permission.
  3. Reads the native device/FCM token.
  4. Stores it locally and syncs it after the authenticated user is restored through POST /api/v1/app/device-tokens.
const { registerForPushNotificationsAsync } = usePushNotifications();
await registerForPushNotificationsAsync();

The root layout only installs foreground/response listeners; it does not silently request permission on every startup.

5. iOS requirements

Configure an APNs authentication key/certificate for the Firebase iOS app and enable the appropriate push capability in the Apple Developer account/EAS credentials. Test on a physical iPhone or iPad; the iOS simulator cannot produce a real device token.

6. Test delivery

  • Confirm a token exists in the Account device_tokens table after onboarding/settings registration.
  • Send a test message from Firebase or the Laravel admin notification workflow.
  • Confirm a notification record appears in /api/v1/app/notifications and that read/delete actions work.
  • Test foreground, background, terminated, permission-denied, logout, and token-refresh cases.

The Expo response listener currently logs a tapped notification; it does not navigate based on an arbitrary notification payload. Add an explicit allowlisted deep-link/navigation contract before relying on notification taps for routing.

Relevant files

  • app.config.ts
  • hooks/use-push-notifications.ts
  • hooks/use-push-token.ts
  • app/onboarding.tsx
  • app/settings/notifications.tsx
  • templates/backend/admin-panel/app/Services/NotificationSenderService.php (source repository reference)