Skip to content

Commit

Permalink
fix: sdk not able to compile in ios app (customerio#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
levibostian committed Dec 2, 2022
1 parent 47907f9 commit e4d1b3f
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions Sources/Tracking/CustomerIO.swift
Expand Up @@ -163,9 +163,14 @@ public class CustomerIO: CustomerIOInstance {
siteId: siteId,
apiKey: apiKey,
region: region,
isFromiOSApplicationExtension: false,
config: newSdkConfig
)

if newSdkConfig.autoTrackScreenViews {
// Setting up screen view tracking is not available for rich push (Notification Service Extension).
// Only call this code when not possibly being called from a NSE.
Self.shared.setupAutoScreenviewTracking()
}
}

/**
Expand All @@ -190,7 +195,6 @@ public class CustomerIO: CustomerIOInstance {
siteId: siteId,
apiKey: apiKey,
region: region,
isFromiOSApplicationExtension: true,
config: newSdkConfig.toSdkConfig()
)
}
Expand All @@ -201,20 +205,13 @@ public class CustomerIO: CustomerIOInstance {
siteId: String,
apiKey: String,
region: Region,
isFromiOSApplicationExtension: Bool,
config: SdkConfig
) {
let newDiGraph = DIGraph(siteId: siteId, apiKey: apiKey, sdkConfig: config)

Self.shared.diGraph = newDiGraph
Self.shared.implementation = CustomerIOImplementation(siteId: siteId, diGraph: newDiGraph)

if !isFromiOSApplicationExtension, config.autoTrackScreenViews {
// Setting up screen view tracking is not available for rich push (Notification Service Extension).
// Only call this code when not possibly being called from a NSE.
Self.shared.setupAutoScreenviewTracking()
}

Self.shared.postInitialize(siteId: siteId, diGraph: newDiGraph)
}

Expand Down

0 comments on commit e4d1b3f

Please sign in to comment.