Skip to content

Commit 4f3d4c9

Browse files
committed
Update the installation ID method to use notify instead of wait
1 parent 9568176 commit 4f3d4c9

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

FirebaseSessions/Sources/Installations+InstallationsProtocol.swift

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ extension InstallationsProtocol {
3737
}
3838

3939
// TODO(ncooke3): Convert o async await ahead of Firebase 12.
40-
40+
4141
func installationID(completion: @escaping (Result<(String, String), Error>) -> Void) {
4242
let authTokenComplete = UnfairLock<String>("")
4343
let installationComplete = UnfairLock<String?>(nil)
@@ -60,16 +60,8 @@ extension InstallationsProtocol {
6060
}
6161
workingGroup.leave()
6262
}
63-
64-
// adding timeout for 10 seconds
65-
let result = workingGroup
66-
.wait(timeout: .now() + DispatchTimeInterval.seconds(installationsWaitTimeInSecond))
67-
68-
switch result {
69-
case .timedOut:
70-
completion(.failure(FirebaseSessionsError.SessionInstallationsTimeOutError))
71-
return
72-
default:
63+
64+
workingGroup.notify(queue: .main) {
7365
if let installationComplete = installationComplete.value() {
7466
completion(.success((installationComplete, authTokenComplete.value())))
7567
} else if let errorComplete = errorComplete.value() {

0 commit comments

Comments
 (0)