Skip to content

Commit 40f3dc0

Browse files
committed
🐞 Potential fix for launchOptions incorrectly tracking notification
1 parent 86f01d7 commit 40f3dc0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

swift-sdk/Internal/InternalIterableAPI.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,16 @@ final class InternalIterableAPI: NSObject, PushTrackerProtocol, AuthProvider {
706706
guard let launchOptions = launchOptions else {
707707
return
708708
}
709+
709710
if let remoteNotificationPayload = launchOptions[UIApplication.LaunchOptionsKey.remoteNotification] as? [AnyHashable: Any] {
711+
712+
if let aps = remoteNotificationPayload["aps"] as? [String: Any],
713+
let contentAvailable = aps["content-available"] as? Int,
714+
contentAvailable == 1 {
715+
ITBInfo("Received push notification with wakey content-available flag")
716+
return
717+
}
718+
710719
if let _ = IterableUtil.rootViewController {
711720
// we are ready
712721
IterableAppIntegration.implementation?.performDefaultNotificationAction(remoteNotificationPayload)

0 commit comments

Comments
 (0)