diff --git a/fastlane/Fastfile b/fastlane/Fastfile index a881400ca..7dd5a1039 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -101,7 +101,7 @@ platform :ios do ) github_release = set_github_release( - repository_name: "Iterable/swift-sdk", + repository_name: "Iterable/iterable-swift-sdk", api_token: github_token, name: "#{version}", tag_name: "#{version}", @@ -135,4 +135,4 @@ platform :ios do slack_url: slack_webhook, ) end -end \ No newline at end of file +end diff --git a/swift-sdk/Constants.swift b/swift-sdk/Constants.swift index 844afebd5..27cce798b 100644 --- a/swift-sdk/Constants.swift +++ b/swift-sdk/Constants.swift @@ -95,6 +95,11 @@ enum Const { static let location = "Location" static let setCookie = "Set-Cookie" } + + enum RemoteNotification { + static let aps = "aps" + static let contentAvailable = "content-available" + } } enum JsonKey { diff --git a/swift-sdk/Internal/InternalIterableAPI.swift b/swift-sdk/Internal/InternalIterableAPI.swift index 1b165fdad..c80e9d3cb 100644 --- a/swift-sdk/Internal/InternalIterableAPI.swift +++ b/swift-sdk/Internal/InternalIterableAPI.swift @@ -706,7 +706,16 @@ final class InternalIterableAPI: NSObject, PushTrackerProtocol, AuthProvider { guard let launchOptions = launchOptions else { return } + if let remoteNotificationPayload = launchOptions[UIApplication.LaunchOptionsKey.remoteNotification] as? [AnyHashable: Any] { + + if let aps = remoteNotificationPayload[Const.RemoteNotification.aps] as? [String: Any], + let contentAvailable = aps[Const.RemoteNotification.contentAvailable] as? Int, + contentAvailable == 1 { + ITBInfo("Received push notification with wakey content-available flag") + return + } + if let _ = IterableUtil.rootViewController { // we are ready IterableAppIntegration.implementation?.performDefaultNotificationAction(remoteNotificationPayload)