Push Notifications Setup Guide โ
This guide will help you set up push notifications for your MartFury Flutter app. Follow these simple steps to enable notifications for both Android and iOS.
๐ฑ What You'll Need โ
Before starting, make sure you have:
- A Google account (for Firebase)
- Access to your app's source code
- For iOS: An Apple Developer account ($99/year)
๐ฅ Step 1: Create a Firebase Project โ
- Go to Firebase Console
- Click "Create a project" or "Add project"
- Enter your project name (e.g., "MartFury App")
- Follow the setup wizard (you can disable Google Analytics if not needed)
- Click "Create project" and wait for it to complete
๐ค Step 2: Get Android Configuration File โ
Follow these steps to get your google-services.json
file:
In Firebase Console:
- Click the Android icon or "Add app" โ "Android"
- Enter your Android package name (e.g.,
com.yourcompany.martfury
) - Register the app
Download the configuration file:
- Click "Download google-services.json"
- Save this file to your computer
Add the file to your app:
- Open your app's folder
- Navigate to
android/app/
- Copy the
google-services.json
file here
For detailed instructions with screenshots, visit: Firebase Android Setup Guide
๐ Step 3: Get iOS Configuration File โ
Follow these steps to get your GoogleService-Info.plist
file:
In Firebase Console:
- Click "Add app" โ "iOS"
- Enter your iOS bundle ID (e.g.,
com.yourcompany.martfury
) - Register the app
Download the configuration file:
- Click "Download GoogleService-Info.plist"
- Save this file to your computer
Add the file to your app:
- Open your app's folder
- Navigate to
ios/Runner/
- Copy the
GoogleService-Info.plist
file here
Enable Push Notifications in Xcode:
- Open
ios/Runner.xcworkspace
in Xcode - Select your project in the left sidebar
- Click on the "Signing & Capabilities" tab
- Click "+ Capability"
- Add "Push Notifications"
- Open
For detailed instructions with screenshots, visit: Firebase iOS Setup Guide
โ Step 4: Configure iOS Push Notifications (iOS Only) โ
For iOS to receive push notifications, you need to set up APNs certificates:
In Firebase Console:
- Go to Project Settings (gear icon)
- Click "Cloud Messaging" tab
- Scroll to "Apple app configuration"
Upload APNs Certificate:
- Click "Upload" under APNs certificates
- You'll need to create this certificate in your Apple Developer account
- Follow Firebase's guide for creating APNs certificates
๐งช Step 5: Test Your Setup โ
After adding both configuration files:
Build and run your app:
- Connect a real device (not simulator)
- Run the app
Test notifications:
- Go to Firebase Console
- Navigate to "Cloud Messaging"
- Click "Send your first message"
- Enter a test message and send
Check if it works:
- You should receive the notification on your device
- If not, check the Troubleshooting section below
โ Troubleshooting โ
Nothing happens when I send a test notification โ
- Make sure you're using a real device (not simulator/emulator)
- Check that you copied the files to the correct folders
- For iOS: Ensure you enabled Push Notifications in Xcode
- Try restarting the app
Where do I find my package name/bundle ID? โ
- Android package name: Look in
android/app/build.gradle
forapplicationId
- iOS bundle ID: Look in Xcode under your target's General tab
I don't have an Apple Developer account โ
- You need one for iOS push notifications in production ($99/year)
- For testing only, you might be able to use development certificates
๐ Need More Help? โ
If you're stuck:
- Double-check you followed all steps above
- Make sure file names are exactly
google-services.json
andGoogleService-Info.plist
- Verify files are in the correct folders
- Contact your developer for assistance with technical issues