diff --git a/Package.swift b/Package.swift index 4b1dea4..cd8d70f 100644 --- a/Package.swift +++ b/Package.swift @@ -18,8 +18,8 @@ let package = Package( targets: [ .binaryTarget( name: "Batch", - url: "https://download.batch.com/sdk/ios/spm/BatchSDK-ios_spm-xcframework-1.19.4.zip", - checksum: "32b8ef5a122705f7df47054cab192cc85169bc1f98c4096fd5b640e851424608" + url: "https://download.batch.com/sdk/ios/spm/BatchSDK-ios_spm-xcframework-1.19.5.zip", + checksum: "9dec44e2163ac9ca28e8874985af8defb102c12ae8c7a98e6a51d83119b778cc" ) ] ) \ No newline at end of file diff --git a/Sources/Batch/Modules/Core/BAApplicationLifecycle.h b/Sources/Batch/Modules/Core/BAApplicationLifecycle.h index 4c47891..70cc051 100644 --- a/Sources/Batch/Modules/Core/BAApplicationLifecycle.h +++ b/Sources/Batch/Modules/Core/BAApplicationLifecycle.h @@ -11,6 +11,8 @@ NS_ASSUME_NONNULL_BEGIN @interface BAApplicationLifecycle : NSObject +@property (class, readonly) BOOL applicationUsesSwiftUILifecycle; + @property (class, readonly) BOOL applicationUsesUIScene; @property (class, readonly) BOOL applicationImplementsUNDelegate; diff --git a/Sources/Batch/Modules/Core/BAApplicationLifecycle.m b/Sources/Batch/Modules/Core/BAApplicationLifecycle.m index 3502ec1..8a45486 100644 --- a/Sources/Batch/Modules/Core/BAApplicationLifecycle.m +++ b/Sources/Batch/Modules/Core/BAApplicationLifecycle.m @@ -11,6 +11,19 @@ @implementation BAApplicationLifecycle ++ (BOOL)applicationUsesSwiftUILifecycle { + if (@available(iOS 13.0, *)) { + UIScene *scene = UIApplication.sharedApplication.connectedScenes.allObjects.firstObject; + id delegate = scene.delegate; + if (delegate == nil) { + return false; + } + // Expected name is SwiftUI.AppSceneDelegate but we expect it to change + return [NSStringFromClass([delegate class]) hasPrefix:@"SwiftUI."]; + } + return false; +} + + (BOOL)applicationUsesUIScene { if (@available(iOS 13.0, *)) { return [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIApplicationSceneManifest"] != nil; diff --git a/Sources/Batch/Modules/Messaging/UI/BAMSGWebviewViewController.m b/Sources/Batch/Modules/Messaging/UI/BAMSGWebviewViewController.m index a1c84fd..8de5d3c 100644 --- a/Sources/Batch/Modules/Messaging/UI/BAMSGWebviewViewController.m +++ b/Sources/Batch/Modules/Messaging/UI/BAMSGWebviewViewController.m @@ -368,6 +368,8 @@ - (WKWebViewConfiguration *)webViewConfiguration { WKWebViewConfiguration *config = [WKWebViewConfiguration new]; config.userContentController = userContentController; + config.allowsInlineMediaPlayback = true; + config.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAudio; return config; } diff --git a/Sources/Batch/Versions.h b/Sources/Batch/Versions.h index 0ecad88..e18f593 100644 --- a/Sources/Batch/Versions.h +++ b/Sources/Batch/Versions.h @@ -11,6 +11,6 @@ Comments should not use the // form, as the plist preprocessor will include them */ -#define BASDKVersion 1.19.4 +#define BASDKVersion 1.19.5 #define BAAPILevel 51 #define BAMessagingAPILevel 12