File tree Expand file tree Collapse file tree 3 files changed +7
-12
lines changed Expand file tree Collapse file tree 3 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -1628,13 +1628,8 @@ + (void)setCleverTapOpenDeepLinksInForeground:(BOOL)openDeepLinksInForeground
16281628 [manager setOpenDeepLinksInForeground: openDeepLinksInForeground];
16291629}
16301630
1631- + (void )setHandleCleverTapNotification : (LeanplumHandleCleverTapNotificationBlock)block
1631+ + (void )setHandleCleverTapNotification : (_Nullable LeanplumHandleCleverTapNotificationBlock)block
16321632{
1633- if (!block) {
1634- [self throwError: @" [Leanplum setHandleCleverTapNotification:] Nil block parameter "
1635- @" provided." ];
1636- return ;
1637- }
16381633 LP_TRY
16391634 ((LPCTNotificationsManager *)[Leanplum notificationsManager ]).handleCleverTapNotificationBlock = block;
16401635 LP_END_TRY
Original file line number Diff line number Diff line change @@ -145,9 +145,10 @@ typedef void (^LeanplumSetLocationBlock)(BOOL success);
145145typedef BOOL (^LeanplumActionBlock)(LPActionContext* context);
146146typedef void (^LeanplumHandleNotificationBlock)(void );
147147typedef void (^LeanplumShouldHandleNotificationBlock)(NSDictionary *userInfo, LeanplumHandleNotificationBlock response);
148+ typedef void (^LeanplumCleverTapNotificationBlock)(BOOL openDeeplink);
148149typedef void (^LeanplumHandleCleverTapNotificationBlock)(NSDictionary *userInfo,
149150 BOOL isNotificationOpen,
150- LeanplumHandleNotificationBlock response);
151+ LeanplumCleverTapNotificationBlock response);
151152typedef void (^LeanplumPushSetupBlock)(void );
152153/* *@}*/
153154
@@ -453,7 +454,7 @@ NS_SWIFT_NAME(defineAction(name:kind:args:options:present:dismiss:));
453454 * The block provides the notification userInfo, a bool if the push is received or opened, and a block with the default implementation.
454455 * @see LeanplumHandleCleverTapNotificationBlock for details.
455456 */
456- + (void )setHandleCleverTapNotification : (LeanplumHandleCleverTapNotificationBlock)block ;
457+ + (void )setHandleCleverTapNotification : (_Nullable LeanplumHandleCleverTapNotificationBlock)block ;
457458
458459/* *
459460 * Sets if a Deliver event should be tracked when a Push Notification is received.
Original file line number Diff line number Diff line change @@ -57,8 +57,7 @@ import Foundation
5757 }
5858
5959 func handleCleverTapNotification( userInfo: [ AnyHashable : Any ] , event: NotificationEvent ) {
60- let handleNotification = {
61- let openInForeground = self . openDeepLinksInForeground
60+ let handleNotification : LeanplumCleverTapNotificationBlock = { openInForeground in
6261 self . handleWithCleverTapInstance {
6362 Log . info ( """
6463 [Wrapper] Calling CleverTap.handlePushNotification:openDeepLinksInForeground: \
@@ -75,10 +74,10 @@ import Foundation
7574 return
7675 }
7776
78- handleNotification ( )
77+ handleNotification ( openDeepLinksInForeground )
7978 }
8079
81- func handleWithCleverTapInstance( action: @escaping ( ) -> ( ) ) {
80+ @ objc public func handleWithCleverTapInstance( action: @escaping ( ) -> ( ) ) {
8281 if MigrationManager . shared. hasLaunched {
8382 action ( )
8483 } else {
You can’t perform that action at this time.
0 commit comments