Wrapply logoWrapply Tutorials
🔔 Push notifications

Add Firebase push notifications to your Wrapply app

Push notifications require Firebase Cloud Messaging, Android and iOS configuration, permission handling, FCM tokens and usually backend sending logic.

Push notifications with Flutter and Firebase

Push notifications require Firebase Cloud Messaging, Android/iOS configuration and backend logic to send messages. Wrapply can prepare the app for notifications, but the final setup depends on your Firebase project and use case.

Notifications are not only a UI feature. You need Firebase configuration, device permissions, tokens and usually a backend or Cloud Function to send messages.

Add Firebase packages

Add the required packages from the project root.

flutter pub add firebase_core
flutter pub add firebase_messaging
flutter pub add flutter_local_notifications

Flutter setup in lib/main.dart

Initialize Firebase before running the app, request notification permission and retrieve the FCM token.

await Firebase.initializeApp();
final messaging = FirebaseMessaging.instance;
await messaging.requestPermission();
final token = await messaging.getToken();

Android configuration

Android requires Firebase configuration files and notification permissions for modern Android versions.

google-services.json
Add it inside android/app/.
Gradle plugin
Configure Google Services plugin in Android Gradle files.
Android permission
For Android 13+, request POST_NOTIFICATIONS.
Manifest
Check android/app/src/main/AndroidManifest.xml.

iOS configuration

iOS requires Apple Developer configuration, push notification capability and Firebase iOS setup.

GoogleService-Info.plist
Add it to ios/Runner/ using Xcode.
Signing & Capabilities
Enable Push Notifications in Xcode.
APNs key
Configure APNs authentication in Firebase console.
Permission prompt
Request user permission before receiving notifications.

Backend sending logic

To send notifications automatically from your web app or dashboard, you usually need a backend endpoint or Firebase Cloud Function.

Store FCM tokens
Save tokens in your database for each user/device.
Send through Firebase Admin
Use Cloud Functions or your backend to send messages.