Skip to content

Commit 0ce9e8f

Browse files
Handle pending universal link.
1 parent bba3736 commit 0ce9e8f

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

swift-sdk/Internal/IterableAPIInternal.swift

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,9 @@ final class IterableAPIInternal: NSObject, PushTrackerProtocol, AuthProvider {
357357

358358
private var config: IterableConfig
359359

360+
// Following are needed for handling pending notification and deep link.
360361
static var pendingNotificationResponse: NotificationResponseProtocol?
362+
static var pendingUniversalLink: URL?
361363

362364
private let dateProvider: DateProviderProtocol
363365
private let inAppDisplayer: InAppDisplayerProtocol
@@ -516,7 +518,10 @@ final class IterableAPIInternal: NSObject, PushTrackerProtocol, AuthProvider {
516518

517519
handle(launchOptions: launchOptions)
518520

519-
handlePendingNotifications()
521+
522+
handlePendingNotification()
523+
524+
handlePendingUniversalLink()
520525

521526
requestProcessor.start()
522527

@@ -540,7 +545,7 @@ final class IterableAPIInternal: NSObject, PushTrackerProtocol, AuthProvider {
540545
}
541546
}
542547

543-
private func handlePendingNotifications() {
548+
private func handlePendingNotification() {
544549
if let pendingNotificationResponse = Self.pendingNotificationResponse {
545550
if #available(iOS 10.0, *) {
546551
IterableAppIntegration.implementation?.userNotificationCenter(nil, didReceive: pendingNotificationResponse, withCompletionHandler: nil)
@@ -549,6 +554,13 @@ final class IterableAPIInternal: NSObject, PushTrackerProtocol, AuthProvider {
549554
}
550555
}
551556

557+
private func handlePendingUniversalLink() {
558+
if let pendingUniversalLink = Self.pendingUniversalLink {
559+
handleUniversalLink(pendingUniversalLink)
560+
Self.pendingUniversalLink = nil
561+
}
562+
}
563+
552564
private func checkForDeferredDeepLink() {
553565
guard config.checkForDeferredDeeplink else {
554566
return

0 commit comments

Comments
 (0)