Skip to content

Commit

Permalink
Merge pull request #704 from Flyclops/fix/unity_pause_ios
Browse files Browse the repository at this point in the history
Fixed Unity not receiving lifecycle events from iOS
  • Loading branch information
juicycleff authored Nov 14, 2022
2 parents 799e0ca + 2a87c10 commit 7f55bc2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions ios/Classes/UnityPlayerUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ var sharedApplication: UIApplication?
return
}

let unityAppController = self.ufw?.appController as? UnityAppController
let unityAppController = self.ufw?.appController() as? UnityAppController
let application = UIApplication.shared

if notification?.name == UIApplication.willResignActiveNotification {
Expand Down Expand Up @@ -199,13 +199,10 @@ var sharedApplication: UIApplication?
UIApplication.willEnterForegroundNotification,
UIApplication.didReceiveMemoryWarningNotification
] {
guard let name = name as? String else {
continue
}
NotificationCenter.default.addObserver(
self,
selector: #selector(self.handleAppStateDidChange),
name: NSNotification.Name(name),
name: name,
object: nil)
}
}
Expand Down

0 comments on commit 7f55bc2

Please sign in to comment.