Flutter
PushExpress -- SDK Flutter**
You will need to integrate your Push.Express account with Firebase.
Setup Firebase
Go to Firebase Console and create a new project (or use existing one)
You can use one project for all your apps.
Open Project Settings -> General
Create new Flutter app or just download
google-services.jsonfrom existing appInstall and run the FlutterFire CLI
Then, at the root of your Flutter project directory, run this command:
Add your app in firebase project
This automatically registers your per-platform apps with Firebase and adds a lib/firebase_options.dart configuration file to your Flutter project.
Setup Push.Express
Get Firebase Private key
Go to Firebase Console and create a new project (or use existing one)
You can use one project for all your apps.
Open Project Settings
Go to Service accounts, press
Generate new private keyand save it to fileprivate-key.json(you can use same key for all apps)
Integrate your Push.Express App with Firebase
Go to your Push.Express account
Open existing App settings or create a new App
Switch type application Firebase
Paste
private-key.jsonfile to Firebase Admin SDK private key textbox
Add sdk in your application
Import package in your main.dart file
In main.dart add code for init Push Express sdk. Replace the default value of 12345-12 with the PULEXPRESS_APP_ID of your application. You can find out your PUSHEXPRESS_APP_ID in the Applications.
Call initFirebase() in the initState() method in the main.dart file.
Add a background push notification handler to Firebase Cloud Messaging in the main.dart file.
Register the firebaseMessagingBackgroundHandler background push notification handler in the main() function of the main.dart file.
Example of the main.dart file
Last updated