Docs/iOS_Firebase_Setup.md
com.example.bagistoFlutterGoogleService-Info.plistOpen your iOS project in Xcode:
open ios/Runner.xcworkspace
Drag and drop GoogleService-Info.plist into Xcode
Verify the file is in the correct location:
ios/Runner/GoogleService-Info.plist
Runner project in XcodeRunner target.p8 file)The Podfile should already have Firebase pods configured. Verify it contains:
# File: ios/Podfile
target 'Runner' do
flutter_root = File.expand_path(File.join(packages_dir, 'flutter'))
load File.join(flutter_root, 'packages', 'flutter_tools', 'bin', 'podhelper')
flutter_ios_podfile_setup
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_install_all_ios_build_settings installer
end
end
end
No additional changes needed - Flutter handles Firebase pods automatically.
Edit ios/Runner/Info.plist and add:
<key>FirebaseAppDelegateProxyEnabled</key>
<false/>
This prevents Firebase from swizzling your app delegate (since Flutter handles this).
Clean the project:
flutter clean
rm -rf ios/Pods ios/Podfile.lock
Get dependencies:
flutter pub get
Build for iOS:
flutter run -d <device_id>
Check the device token in logs:
🎫 Device token obtained: ...
You can also use curl with an APNs certificate to send test notifications.
iOS 10+ requires explicit permission for notifications. The code already handles this:
final settings = await _messaging.requestPermission();
Users will be prompted when the app first tries to display notifications.
ios/Runner/ directoryflutter clean && flutter run| Issue | Solution |
|---|---|
| Pod install fails | Run pod repo update and try again |
| Compilation errors | Ensure GoogleService-Info.plist is added to all targets |
| Token not generated | Ensure running on physical device with network access |
| Notifications in background | Verify notification permission is granted |
| App crashes on startup | Check Podfile and Info.plist configuration |
firebase_options.dart with your Firebase configuration