feat(notifications): initialize Firebase Messaging and Capacitor push on native

Add firebaseMessagingClient to ensure the Firebase app is created from VITE_FIREBASE_*,
wire PushNotifications (listeners, requestPermissions, register) before token work,
and call getMessaging/getToken/onMessage when firebase/messaging is supported. Hook
startup from main.capacitor and set PushNotifications presentationOptions in
capacitor.config. Depend on firebase and @capacitor/push-notifications.
This commit is contained in:
Jose Olarte III
2026-05-06 15:30:46 +08:00
parent 1643bab18b
commit 162158066f
12 changed files with 2983 additions and 1278 deletions

View File

@@ -15,6 +15,7 @@ dependencies {
implementation project(':capacitor-camera')
implementation project(':capacitor-clipboard')
implementation project(':capacitor-filesystem')
implementation project(':capacitor-push-notifications')
implementation project(':capacitor-share')
implementation project(':capacitor-status-bar')
implementation project(':capawesome-capacitor-file-picker')

View File

@@ -16,6 +16,13 @@
]
}
},
"PushNotifications": {
"presentationOptions": [
"badge",
"sound",
"alert"
]
},
"SplashScreen": {
"launchShowDuration": 3000,
"launchAutoHide": true,

View File

@@ -23,6 +23,10 @@
"pkg": "@capacitor/filesystem",
"classpath": "com.capacitorjs.plugins.filesystem.FilesystemPlugin"
},
{
"pkg": "@capacitor/push-notifications",
"classpath": "com.capacitorjs.plugins.pushnotifications.PushNotificationsPlugin"
},
{
"pkg": "@capacitor/share",
"classpath": "com.capacitorjs.plugins.share.SharePlugin"