File tree Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 33// Leanplum
44//
55// Created by Andrew First on 4/30/12.
6- // Copyright (c) 2022 Leanplum, Inc. All rights reserved.
6+ // Copyright (c) 2023 Leanplum, Inc. All rights reserved.
77//
88// Licensed to the Apache Software Foundation (ASF) under one
99// or more contributor license agreements. See the NOTICE file
@@ -1625,7 +1625,8 @@ + (void)setShouldOpenNotificationHandler:(LeanplumShouldHandleNotificationBlock)
16251625+ (void )setCleverTapOpenDeepLinksInForeground : (BOOL )openDeepLinksInForeground
16261626{
16271627 LPCTNotificationsManager *manager = (LPCTNotificationsManager *)[Leanplum notificationsManager ];
1628- [manager setOpenDeepLinksInForeground: openDeepLinksInForeground];
1628+ NSNumber *value = [NSNumber numberWithBool: openDeepLinksInForeground];
1629+ [manager setOpenDeepLinksInForeground: value];
16291630}
16301631
16311632+ (void )setHandleCleverTapNotification : (_Nullable LeanplumHandleCleverTapNotificationBlock)block
Original file line number Diff line number Diff line change 33// LeanplumSDK
44//
55// Created by Nikola Zagorchev on 12.10.22.
6- // Copyright © 2022 Leanplum. All rights reserved.
6+ // Copyright © 2023 Leanplum. All rights reserved.
77
88import Foundation
99// Use @_implementationOnly to *not* expose CleverTapSDK to the Leanplum-Swift header
1010@_implementationOnly import CleverTapSDK
1111
1212@objc public class LPCTNotificationsManager : NotificationsManager {
13- @objc public var openDeepLinksInForeground = false
13+ // Using NSNumber since Optional Bool cannot be represented in Objective-C
14+ @objc public var openDeepLinksInForeground : NSNumber ?
1415 @objc public var handleCleverTapNotificationBlock : LeanplumHandleCleverTapNotificationBlock ?
1516
1617
@@ -74,7 +75,8 @@ import Foundation
7475 return
7576 }
7677
77- handleNotification ( openDeepLinksInForeground)
78+ // If `openDeepLinksInForeground` is not set explicitly, use `true` for notification Opens.
79+ handleNotification ( openDeepLinksInForeground? . boolValue ?? ( event == . opened) )
7880 }
7981
8082 @objc public func handleWithCleverTapInstance( action: @escaping ( ) -> ( ) ) {
Original file line number Diff line number Diff line change 33// LeanplumSDK
44//
55// Created by Nikola Zagorchev on 23.12.21.
6- // Copyright © 2021 Leanplum. All rights reserved.
6+ // Copyright © 2023 Leanplum. All rights reserved.
77
88import Foundation
99
@@ -13,7 +13,8 @@ extension NotificationsProxy {
1313 if let fromStart = notificationHandledFromStart {
1414 let idA = Leanplum . notificationsManager ( ) . getNotificationId ( fromStart)
1515 let idB = Leanplum . notificationsManager ( ) . getNotificationId ( userInfo)
16- return idA == idB
16+ // CleverTap notifications do not have notification Id
17+ return idA == idB && idA != " -1 "
1718 }
1819 return false
1920 }
You can’t perform that action at this time.
0 commit comments