From ecd62b8c35fb9fdce2145fb9baf8d6f65198a33f Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Sun, 9 Mar 2025 17:59:53 -0700 Subject: [PATCH 1/4] fix: iOS push notifications alert --> banner --- .../PushNotificationsPlugin/PushNotificationsHandler.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/push-notifications/ios/Sources/PushNotificationsPlugin/PushNotificationsHandler.swift b/push-notifications/ios/Sources/PushNotificationsPlugin/PushNotificationsHandler.swift index f3972b68a..e06cf5ed4 100644 --- a/push-notifications/ios/Sources/PushNotificationsPlugin/PushNotificationsHandler.swift +++ b/push-notifications/ios/Sources/PushNotificationsPlugin/PushNotificationsHandler.swift @@ -35,10 +35,11 @@ public class PushNotificationsHandler: NSObject, NotificationHandlerProtocol { optionsArray.forEach { option in switch option { case "alert": - presentationOptions.insert(.alert) + presentationOptions.insert(.banner) + case "banner": + presentationOptions.insert(.banner) case "badge": presentationOptions.insert(.badge) - case "sound": presentationOptions.insert(.sound) default: From 79ecb3fa49d416d753d8a31628349bf3f5d5af31 Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Sun, 9 Mar 2025 18:10:54 -0700 Subject: [PATCH 2/4] fix typo in default option log --- .../PushNotificationsPlugin/PushNotificationsHandler.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/push-notifications/ios/Sources/PushNotificationsPlugin/PushNotificationsHandler.swift b/push-notifications/ios/Sources/PushNotificationsPlugin/PushNotificationsHandler.swift index e06cf5ed4..9b0bbe1ca 100644 --- a/push-notifications/ios/Sources/PushNotificationsPlugin/PushNotificationsHandler.swift +++ b/push-notifications/ios/Sources/PushNotificationsPlugin/PushNotificationsHandler.swift @@ -43,7 +43,7 @@ public class PushNotificationsHandler: NSObject, NotificationHandlerProtocol { case "sound": presentationOptions.insert(.sound) default: - print("Unrecogizned presentation option: \(option)") + print("Unrecognized presentation option: \(option)") } } From e5e1a50fddfb777f1fc40614f9ac7828e7d6ec7d Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Sun, 9 Mar 2025 18:19:11 -0700 Subject: [PATCH 3/4] request banner permission --- .../PushNotificationsPlugin/PushNotificationsHandler.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/push-notifications/ios/Sources/PushNotificationsPlugin/PushNotificationsHandler.swift b/push-notifications/ios/Sources/PushNotificationsPlugin/PushNotificationsHandler.swift index 9b0bbe1ca..0946f0dfc 100644 --- a/push-notifications/ios/Sources/PushNotificationsPlugin/PushNotificationsHandler.swift +++ b/push-notifications/ios/Sources/PushNotificationsPlugin/PushNotificationsHandler.swift @@ -6,7 +6,7 @@ public class PushNotificationsHandler: NSObject, NotificationHandlerProtocol { var notificationRequestLookup = [String: JSObject]() public func requestPermissions(with completion: ((Bool, Error?) -> Void)? = nil) { - UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in + UNUserNotificationCenter.current().requestAuthorization(options: [.banner, .sound, .badge]) { granted, error in completion?(granted, error) } } From 6cca78c5fd56af89bd156115336c5785c68549c0 Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Sun, 9 Mar 2025 19:53:19 -0700 Subject: [PATCH 4/4] Revert "request banner permission" This reverts commit e5e1a50fddfb777f1fc40614f9ac7828e7d6ec7d. --- .../PushNotificationsPlugin/PushNotificationsHandler.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/push-notifications/ios/Sources/PushNotificationsPlugin/PushNotificationsHandler.swift b/push-notifications/ios/Sources/PushNotificationsPlugin/PushNotificationsHandler.swift index 0946f0dfc..9b0bbe1ca 100644 --- a/push-notifications/ios/Sources/PushNotificationsPlugin/PushNotificationsHandler.swift +++ b/push-notifications/ios/Sources/PushNotificationsPlugin/PushNotificationsHandler.swift @@ -6,7 +6,7 @@ public class PushNotificationsHandler: NSObject, NotificationHandlerProtocol { var notificationRequestLookup = [String: JSObject]() public func requestPermissions(with completion: ((Bool, Error?) -> Void)? = nil) { - UNUserNotificationCenter.current().requestAuthorization(options: [.banner, .sound, .badge]) { granted, error in + UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in completion?(granted, error) } }