Skip to content

Commit

Permalink
style: code format
Browse files Browse the repository at this point in the history
  • Loading branch information
GIOSDK committed Oct 12, 2024
1 parent 2632d41 commit dde83f1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
13 changes: 8 additions & 5 deletions Modules/Hybrid/GrowingWKWebViewJavascriptBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}
Expand Down
28 changes: 14 additions & 14 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ let package = Package(

// MARK: - Resources

.Resources.bundle,
.Resources.bundle,
.Resources.bundle_macOS,
.Resources.bundle_tvOS,
.Resources.bundle_visionOS,
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit dde83f1

Please sign in to comment.