Skip to content

Commit 15b7783

Browse files
Bugfix FXIOS-13757 - Firefox crashes when opening a sent tab from the "Tab received" notification (backport #29836) (#29872)
Bugfix FXIOS-13757 - Firefox crashes when opening a sent tab from the "Tab received" notification (#29836) * Remove nonisolated and async calls. * Add @mainactor protocol conformance. (cherry picked from commit 3233791) Co-authored-by: PARAIPAN SORIN <[email protected]>
1 parent b764b13 commit 15b7783

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

firefox-ios/Client/Application/AppDelegate+PushNotifications.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ extension AppDelegate {
7373
}
7474
}
7575

76-
extension AppDelegate: UNUserNotificationCenterDelegate {
77-
nonisolated func userNotificationCenter(
76+
extension AppDelegate: @MainActor UNUserNotificationCenterDelegate {
77+
// Called when the user taps on a notification while in background.
78+
func userNotificationCenter(
7879
_ center: UNUserNotificationCenter,
7980
didReceive response: UNNotificationResponse
8081
) async {
@@ -86,9 +87,9 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
8687

8788
switch response.actionIdentifier {
8889
case UNNotificationDismissActionIdentifier:
89-
await notificationSurfaceManager.didDismissNotification(messageId)
90+
notificationSurfaceManager.didDismissNotification(messageId)
9091
default:
91-
await notificationSurfaceManager.didTapNotification(messageId)
92+
notificationSurfaceManager.didTapNotification(messageId)
9293
}
9394
} else if content.categoryIdentifier == NotificationCloseTabs.notificationCategoryId {
9495
switch response.actionIdentifier {
@@ -105,11 +106,10 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
105106
}
106107

107108
// Called when the user receives a tab (or any other notification) while in foreground.
108-
nonisolated func userNotificationCenter(
109+
func userNotificationCenter(
109110
_ center: UNUserNotificationCenter,
110111
willPresent notification: UNNotification
111112
) async -> UNNotificationPresentationOptions {
112-
let profile = await self.profile
113113
if profile.prefs.boolForKey(PendingAccountDisconnectedKey) ?? false {
114114
profile.removeAccount()
115115

0 commit comments

Comments
 (0)