flutter_background_geolocation_firebase icon indicating copy to clipboard operation
flutter_background_geolocation_firebase copied to clipboard

iOS Setup instructions in Swift

Open wizawuza opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe. There are currently instructions to set up in iOS at https://github.com/transistorsoft/flutter_background_geolocation_firebase/blob/master/help/INSTALL-IOS.md

Describe the solution you'd like Please add the specific instructions if we have an AppDelegate.swift file

Thank you.

wizawuza avatar Nov 20 '21 15:11 wizawuza

That's easy

christocracy avatar Nov 20 '21 15:11 christocracy

Sharing how it looks for me, the placement of configure is important because if you place it after GeneratedPluginRegsitrant.register(with: self), it would cause a crash.

import Flutter
import UIKit
import Firebase

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    FirebaseApp.configure()
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}

rc8marcelo avatar Aug 02 '24 12:08 rc8marcelo