diff --git a/Modules/Hybrid/GrowingWKWebViewJavascriptBridge.m b/Modules/Hybrid/GrowingWKWebViewJavascriptBridge.m index c1f25d90..164c07b9 100644 --- a/Modules/Hybrid/GrowingWKWebViewJavascriptBridge.m +++ b/Modules/Hybrid/GrowingWKWebViewJavascriptBridge.m @@ -114,15 +114,18 @@ + (void)addUserScripts:(WKUserContentController *)contentController { injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:NO]; [contentController addUserScript:userScript]; - + if (GrowingHybridModule.sharedInstance.autoJavaScriptBridgeEnabled) { NSBundle *bundle = [self resourcesBundle]; NSString *filePath = [bundle pathForResource:@"gdp-full" ofType:@"js"]; - NSString *webJSContent = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil]; - webJSContent = [webJSContent stringByAppendingFormat:@"gdp('init', '%@', '%@');", accountId, dataSourceId]; + NSString *webJSContent = [NSString stringWithContentsOfFile:filePath + encoding:NSUTF8StringEncoding + error:nil]; + webJSContent = + [webJSContent stringByAppendingFormat:@"gdp('init', '%@', '%@');", accountId, dataSourceId]; WKUserScript *userScript2 = [[WKUserScript alloc] initWithSource:webJSContent - injectionTime:WKUserScriptInjectionTimeAtDocumentEnd - forMainFrameOnly:NO]; + injectionTime:WKUserScriptInjectionTimeAtDocumentEnd + forMainFrameOnly:NO]; [contentController addUserScript:userScript2]; } } diff --git a/Package.swift b/Package.swift index 4d48db9d..3c7ecd5f 100644 --- a/Package.swift +++ b/Package.swift @@ -68,7 +68,7 @@ let package = Package( // MARK: - Resources - .Resources.bundle, + .Resources.bundle, .Resources.bundle_macOS, .Resources.bundle_tvOS, .Resources.bundle_visionOS, @@ -150,27 +150,27 @@ extension Target { enum Resources { static let bundle = target(name: .bundle, - path: .Path.bundle, - resources: [ - .copy("Resources/GrowingAnalytics.bundle/PrivacyInfo.xcprivacy"), - .copy("Resources/GrowingAnalytics.bundle/gdp-full.js") - ]) + path: .Path.bundle, + resources: [ + .copy("Resources/GrowingAnalytics.bundle/PrivacyInfo.xcprivacy"), + .copy("Resources/GrowingAnalytics.bundle/gdp-full.js"), + ]) static let bundle_macOS = target(name: .bundle_macOS, - path: .Path.bundle_macOS, - resources: [.copy("Resources/GrowingAnalytics.bundle/PrivacyInfo.xcprivacy")]) + path: .Path.bundle_macOS, + resources: [.copy("Resources/GrowingAnalytics.bundle/PrivacyInfo.xcprivacy")]) static let bundle_tvOS = target(name: .bundle_tvOS, - path: .Path.bundle_tvOS, - resources: [.copy("Resources/GrowingAnalytics.bundle/PrivacyInfo.xcprivacy")]) + path: .Path.bundle_tvOS, + resources: [.copy("Resources/GrowingAnalytics.bundle/PrivacyInfo.xcprivacy")]) static let bundle_visionOS = target(name: .bundle_visionOS, - path: .Path.bundle_visionOS, - resources: [.copy("Resources/GrowingAnalytics.bundle/PrivacyInfo.xcprivacy")]) + path: .Path.bundle_visionOS, + resources: [.copy("Resources/GrowingAnalytics.bundle/PrivacyInfo.xcprivacy")]) static let bundle_watchOS = target(name: .bundle_watchOS, - path: .Path.bundle_watchOS, - resources: [.copy("Resources/GrowingAnalytics.bundle/PrivacyInfo.xcprivacy")]) + path: .Path.bundle_watchOS, + resources: [.copy("Resources/GrowingAnalytics.bundle/PrivacyInfo.xcprivacy")]) } enum Core {