[MC-1886] Do not handle push on launch if Leanplum library #371
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
CleverTap push notification open action is handled twice when using Leanplum SDK. The notification is handled by the
application:didFinishLaunchingWithOptions:
in CleverTap and also handled fromUNUserNotificationCenterDelegate
didReceive
method.If the notification is not handled by Leanplum, there are cases where it is not handled at all. This happens when the application already became active and CleverTap does not handle the deeplink since app is in foreground. The method
_appEnteredForegroundWithLaunchingOptions
calls_handlePushNotification
with the launch options which passesopenDeepLinksInForeground:NO
.Implementation
Check if the library is
Leanplum
. Do not handle the notification in this case, and log a message.Testing
Manual QA