Skip to content

Commit

Permalink
Messaging token refresh delegate should be able to return null token (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
charlotteliang committed Oct 6, 2020
1 parent 8eded3f commit 1f6c2ff
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion FirebaseMessaging/Apps/Sample/Sample/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, MessagingDelegate {
.store(in: &cancellables)
}

func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String) {
func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {
identity.token = fcmToken
}
}
1 change: 1 addition & 0 deletions FirebaseMessaging/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# unreleased -- v.7.0.0
- [changed] Remove the deprecated FCM direct channel API and Upstream send API. (#6430)
- [changed] The `messaging:didReceiveRegistrationToken:` should be able to return a null token. Update the API parameter fcmToken to be nullable. (#5339)
- [fixed] Fixed an issue that downloading an image failed when there's no extension in the file name but MIME type is set. (#6590)

# 2020-09 -- v.4.7.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ NS_SWIFT_NAME(MessagingDelegate)
///
/// * Subscribing to any topics.
- (void)messaging:(FIRMessaging *)messaging
didReceiveRegistrationToken:(NSString *)fcmToken
didReceiveRegistrationToken:(nullable NSString *)fcmToken
NS_SWIFT_NAME(messaging(_:didReceiveRegistrationToken:));
@end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
var messaging = Messaging.messaging()
var delegateIsCalled = false

func messaging(_: Messaging, didReceiveRegistrationToken _: String) {
func messaging(_: Messaging, didReceiveRegistrationToken _: String?) {
delegateIsCalled = true
}
}
Expand Down

0 comments on commit 1f6c2ff

Please sign in to comment.