-
Go to the Firebase Console.
-
Create a new project if you don't have one already. Once your project is created, navigate to the "Add app" section.
-
Choose the Flutter option to proceed.
-
Use npm to globally install the Firebase CLI. Run the following command in your terminal:
npm install -g firebase-tools
-
Log in to your Firebase account using the Firebase CLI by running:
firebase login
- CallKit enables you to display the system-calling UI for your app's VoIP services and manage communication between your app, the system, and other apps. See more details.
- PushKit sends notifications, including VoIP invitations. It is essential for VoIP apps. Visit PushKit for additional details.
You must upload an APNs Auth Key in order to implement push notifications. We need the following details about your app when sending push notifications via an APNs Auth Key:
- Auth Key file
- Team ID
- Key ID
- Your app’s bundle ID
To create an APNs auth key, follow the steps below.
Visit the Apple Developer Member Center
Click on Certificates, Identifiers & Profiles
. Go to Keys from the left side. Create a new Auth Key by clicking on the plus button in the top right side.
On the following page, add a Key Name, and select APNs.
Click on the Register button.
You can download your auth key file from this page and upload this file to Firebase dashboard without changing its name.
In your firebase project, go to Settings
and select the Cloud Messaging
tab. Scroll down to iOS app configuration
and click upload under APNs Authentication Key
Enter Key ID and Team ID. Key ID is in the file name, AuthKey_{Key ID}.p8
and is 10 characters. Your Team ID is in the Apple Member Center under the membership tab or displayed always under your account name in the top right corner.
Enable Push Notifications in Capabilities
Enable selcted permission in Background Modes
-
Add the required permissions:
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
-
Inside the
<application>
tag, add the Firebase Messaging service:<service android:name="com.google.firebase.messaging.FirebaseMessagingService" android:exported="true"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT" /> </intent-filter> </service>
-
Create a new project directory:
mkdir server cd server npm init -y
-
Install required dependencies:
npm install express cors morgan firebase-admin uuid
-
Setup Firebase Admin SDK for managing FCM
Download private Key from firebase and add the .json
file in the server folder.
- Configure Firebase Admin in Server Code
// Path to your service account key file for Firebase Admin SDK
var serviceAccount = require("add_path_here");