iOS Setup (Flutter)
This page covers iOS app requirements for bubbl_flutter_sdk.
1) Podfile requirements
In ios/Podfile:
platform :ios, '15.1'
use_frameworks! :linkage => :static
target 'Runner' do
pod 'BubblSDK', '2.3.7'
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
If CocoaPods CDN has not indexed 2.3.7 yet in your environment, use:
pod 'BubblSDK', :git => 'https://github.com/bubbl-repo/bubbl-ios-sdk.git', :tag => '2.3.7'
Then run:
cd ios
pod install
2) Add Firebase config file
Add GoogleService-Info.plist to the Runner target.
3) AppDelegate wiring (Firebase + APNs + FCM)
In ios/Runner/AppDelegate.swift:
import Bubbl
import FirebaseCore
import FirebaseMessaging
import Flutter
import UIKit
import UserNotifications
@main
@objc class AppDelegate: FlutterAppDelegate, MessagingDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
if FirebaseApp.app() == nil {
FirebaseApp.configure()
}
UNUserNotificationCenter.current().delegate = NotificationManager.shared
Messaging.messaging().delegate = self
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
override func application(
_ application: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data
) {
Messaging.messaging().apnsToken = deviceToken
BubblPlugin.updateAPNsToken(deviceToken)
}
func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {
guard let token = fcmToken else { return }
BubblPlugin.updateFCMToken(token)
}
}
4) Info.plist permissions
Ensure these keys exist in ios/Runner/Info.plist:
NSLocationWhenInUseUsageDescriptionNSLocationAlwaysAndWhenInUseUsageDescriptionNSLocationAlwaysUsageDescriptionUIBackgroundModesincludeslocationandremote-notification
5) Validate
flutter run -d ios