mirror of
https://github.com/block/buzz.git
synced 2026-11-26 19:21:50 +00:00
feat(ios): route notification taps to messages
Signed-off-by: Tom Brow <tomb@squareup.com>
This commit is contained in:
@@ -38,6 +38,9 @@ final class NotificationService: UNNotificationServiceExtension {
|
||||
return
|
||||
}
|
||||
bestAttemptContent = content
|
||||
var cleanUserInfo = content.userInfo
|
||||
cleanUserInfo.removeValue(forKey: BuzzPushNavigationTarget.userInfoKey)
|
||||
content.userInfo = cleanUserInfo
|
||||
|
||||
resolver.resolve { [weak self] resolution in
|
||||
guard let self else { return }
|
||||
@@ -50,6 +53,11 @@ final class NotificationService: UNNotificationServiceExtension {
|
||||
if let threadIdentifier = resolution.threadIdentifier {
|
||||
content.threadIdentifier = threadIdentifier
|
||||
}
|
||||
if let navigationTarget = resolution.navigationTarget {
|
||||
var userInfo = content.userInfo
|
||||
userInfo[BuzzPushNavigationTarget.userInfoKey] = navigationTarget.userInfoValue
|
||||
content.userInfo = userInfo
|
||||
}
|
||||
}
|
||||
self.finish(content)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user