Skip to content

Commit b279805

Browse files
fix a few places (#5370)
1 parent e78c3dc commit b279805

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Example/Messaging/Sample/Sample/Identity.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public final class Identity: ObservableObject {
2828
print("Failed to get FID: ", error)
2929
return
3030
}
31-
self.instanceID = fid ?? "None"
31+
self.instanceID = fid
3232
})
3333
}
3434
}

Example/Messaging/Sample/Sample/SceneDelegate.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
import Combine
1516
import UIKit
1617
import SwiftUI
1718
import FirebaseInstanceID
@@ -21,6 +22,7 @@ import FirebaseInstallations
2122
class SceneDelegate: UIResponder, UIWindowSceneDelegate, MessagingDelegate {
2223
var window: UIWindow?
2324
let identity = Identity()
25+
var cancellables = Set<AnyCancellable>()
2426

2527
func scene(_ scene: UIScene, willConnectTo session: UISceneSession,
2628
options connectionOptions: UIScene.ConnectionOptions) {
@@ -41,6 +43,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, MessagingDelegate {
4143
.map { $0.object as? String }
4244
.receive(on: RunLoop.main)
4345
.assign(to: \Identity.token, on: identity)
46+
.store(in: &cancellables)
4447

4548
// Subscribe to fid changes
4649
_ = NotificationCenter.default
@@ -53,8 +56,9 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, MessagingDelegate {
5356
print("Failed to get FID: ", error)
5457
return
5558
}
56-
self.identity.instanceID = fid ?? "None"
59+
self.identity.instanceID = fid
5760
})
5861
})
62+
.store(in: &cancellables)
5963
}
6064
}

0 commit comments

Comments
 (0)