File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
Projects/App/Sources/AppDelegate Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ extension AppDelegate: UIApplicationDelegate {
4242 Messaging . messaging ( ) . token { token, error in
4343 if let error {
4444 self . store. send ( . didRegisterForRemoteNotifications( . failure( error) ) )
45- } else if let _ = token {
46- self . store. send ( . didRegisterForRemoteNotifications( . success( deviceToken ) ) )
45+ } else if let token {
46+ self . store. send ( . didRegisterForRemoteNotifications( . success( token ) ) )
4747 }
4848 }
4949 }
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ public struct AppDelegateFeature {
2828
2929 public enum Action {
3030 case didFinishLaunching
31- case didRegisterForRemoteNotifications( Result < Data , Error > )
31+ case didRegisterForRemoteNotifications( Result < String , Error > )
3232 case userNotifications( UserNotificationClient . DelegateEvent )
3333 case root( RootFeature . Action )
3434 }
@@ -70,9 +70,8 @@ public struct AppDelegateFeature {
7070 }
7171 case . didRegisterForRemoteNotifications( . failure) :
7272 return . none
73- case let . didRegisterForRemoteNotifications( . success( tokenData) ) :
74- let token = tokenData. map { String ( format: " %02.2hhx " , $0) } . joined ( )
75- return . run { _ in await userDefaults. setString ( token, . fcmToken) }
73+ case let . didRegisterForRemoteNotifications( . success( token) ) :
74+ return . run { _ in await userDefaults. setString ( token, . fcmToken) }
7675 catch: { _, _ in }
7776 case let . userNotifications( . willPresentNotification( _, completionHandler) ) :
7877 return . run { _ in completionHandler ( . banner) }
You can’t perform that action at this time.
0 commit comments