diff --git a/ios/wrappers/utils/CioConfigUtils.swift b/ios/wrappers/utils/CioConfigUtils.swift index 8a7737c0..06b89c55 100644 --- a/ios/wrappers/utils/CioConfigUtils.swift +++ b/ios/wrappers/utils/CioConfigUtils.swift @@ -6,12 +6,18 @@ extension Region: Decodable {} let logLevels = Set(CioLogLevel.allCases.map(\.rawValue)) +struct QASettings: Decodable { + let cdnHost: String + let apiHost: String +} + struct RCTCioConfig: Decodable { let cdpApiKey: String let siteId: String? let region: Region? let trackApplicationLifecycleEvents: Bool? let enableInApp: Bool? + let qa: QASettings? static func from(_ json: AnyObject) throws -> Self { let data = try JSONSerialization.data(withJSONObject: json, options: []) @@ -39,6 +45,8 @@ func cioInitializeConfig(from config: RCTCioConfig, logLevel: String?) -> CioCon ifNotNil(config.region, thenPassItTo: cdpConfigBuilder.region) ifNotNil(config.trackApplicationLifecycleEvents, thenPassItTo: cdpConfigBuilder.trackApplicationLifecycleEvents) ifNotNil(cioLogLevel, thenPassItTo: cdpConfigBuilder.logLevel) + ifNotNil(config.qa?.cdnHost, thenPassItTo: cdpConfigBuilder.cdnHost) + ifNotNil(config.qa?.apiHost, thenPassItTo: cdpConfigBuilder.apiHost) var inAppConfig: MessagingInAppConfigOptions? = nil diff --git a/src/customer-io.ts b/src/customer-io.ts index 400aeeef..f7d56e96 100644 --- a/src/customer-io.ts +++ b/src/customer-io.ts @@ -36,7 +36,6 @@ export class CustomerIO { id?: string, traits?: Record ) => { - CustomerIO.assrtInitialized(); if (!id && !traits) { throw new Error('You must provide an id or traits to identify'); } @@ -44,7 +43,6 @@ export class CustomerIO { }; static readonly clearIdentify = async () => { - CustomerIO.assrtInitialized(); return NativeCustomerIO.clearIdentify(); }; @@ -74,14 +72,12 @@ export class CustomerIO { static readonly setProfileAttributes = async ( attributes: Record ) => { - CustomerIO.assrtInitialized(); return NativeCustomerIO.setProfileAttributes(attributes); }; static readonly setDeviceAttributes = async ( attributes: Record ) => { - CustomerIO.assrtInitialized(); return NativeCustomerIO.setDeviceAttributes(attributes); };