Skip to content

Commit

Permalink
Fixed if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
vanlooverenkoen committed Feb 19, 2021
1 parent e213c4f commit e4d8c9f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ios/Classes/SwiftBackgroundLocationTrackerPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ extension SwiftBackgroundLocationTrackerPlugin: FlutterPlugin {
}

public static func getFlutterEngine()-> FlutterEngine? {
if (flutterEngine == nil) {
if flutterEngine == nil {
let flutterEngine = FlutterEngine(name: flutterThreadLabelPrefix, project: nil, allowHeadlessExecution: true)

guard let callbackHandle = SharedPrefsUtil.getCallbackHandle(),
Expand All @@ -67,7 +67,7 @@ extension SwiftBackgroundLocationTrackerPlugin: FlutterPlugin {
}

public static func initBackgroundMethodChannel(flutterEngine: FlutterEngine) {
if (backgroundMethodChannel == nil) {
if backgroundMethodChannel == nil {
let backgroundMethodChannel = FlutterMethodChannel(name: SwiftBackgroundLocationTrackerPlugin.BACKGROUND_CHANNEL_NAME, binaryMessenger: flutterEngine.binaryMessenger)
backgroundMethodChannel.setMethodCallHandler { (call, result) in
switch call.method {
Expand Down Expand Up @@ -122,14 +122,14 @@ extension SwiftBackgroundLocationTrackerPlugin: CLLocationManagerDelegate {
"logging_enabled": SharedPrefsUtil.isLoggingEnabled(),
]

if (SwiftBackgroundLocationTrackerPlugin.initializedBackgroundCallbacks) {
if SwiftBackgroundLocationTrackerPlugin.initializedBackgroundCallbacks {
CustomLogger.log(message: "INITIALIZED, ready to send location updates")
SwiftBackgroundLocationTrackerPlugin.sendLocationupdate(locationData: locationData)
} else {
CustomLogger.log(message: "NOT YET INITIALIZED. Cache the location data")
SwiftBackgroundLocationTrackerPlugin.locationData = locationData

if (!SwiftBackgroundLocationTrackerPlugin.initializedBackgroundCallbacksStarted){
if !SwiftBackgroundLocationTrackerPlugin.initializedBackgroundCallbacksStarted {
SwiftBackgroundLocationTrackerPlugin.initializedBackgroundCallbacksStarted = true

guard let flutterEngine = SwiftBackgroundLocationTrackerPlugin.getFlutterEngine() else {
Expand Down

0 comments on commit e4d8c9f

Please sign in to comment.