Skip to content

Commit b78b398

Browse files
committed
chore: Add QA settings
1 parent d3096b5 commit b78b398

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

ios/wrappers/utils/CioConfigUtils.swift

+8
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,18 @@ extension Region: Decodable {}
66

77
let logLevels = Set<String>(CioLogLevel.allCases.map(\.rawValue))
88

9+
struct QASettings: Decodable {
10+
let cdnHost: String
11+
let apiHost: String
12+
}
13+
914
struct RCTCioConfig: Decodable {
1015
let cdpApiKey: String
1116
let siteId: String?
1217
let region: Region?
1318
let trackApplicationLifecycleEvents: Bool?
1419
let enableInApp: Bool?
20+
let qa: QASettings?
1521

1622
static func from(_ json: AnyObject) throws -> Self {
1723
let data = try JSONSerialization.data(withJSONObject: json, options: [])
@@ -39,6 +45,8 @@ func cioInitializeConfig(from config: RCTCioConfig, logLevel: String?) -> CioCon
3945
ifNotNil(config.region, thenPassItTo: cdpConfigBuilder.region)
4046
ifNotNil(config.trackApplicationLifecycleEvents, thenPassItTo: cdpConfigBuilder.trackApplicationLifecycleEvents)
4147
ifNotNil(cioLogLevel, thenPassItTo: cdpConfigBuilder.logLevel)
48+
ifNotNil(config.qa?.cdnHost, thenPassItTo: cdpConfigBuilder.cdnHost)
49+
ifNotNil(config.qa?.apiHost, thenPassItTo: cdpConfigBuilder.apiHost)
4250

4351
var inAppConfig: MessagingInAppConfigOptions? = nil
4452

src/customer-io.ts

-4
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,13 @@ export class CustomerIO {
3636
id?: string,
3737
traits?: Record<string, any>
3838
) => {
39-
CustomerIO.assrtInitialized();
4039
if (!id && !traits) {
4140
throw new Error('You must provide an id or traits to identify');
4241
}
4342
return NativeCustomerIO.identify(id, traits);
4443
};
4544

4645
static readonly clearIdentify = async () => {
47-
CustomerIO.assrtInitialized();
4846
return NativeCustomerIO.clearIdentify();
4947
};
5048

@@ -74,14 +72,12 @@ export class CustomerIO {
7472
static readonly setProfileAttributes = async (
7573
attributes: Record<string, any>
7674
) => {
77-
CustomerIO.assrtInitialized();
7875
return NativeCustomerIO.setProfileAttributes(attributes);
7976
};
8077

8178
static readonly setDeviceAttributes = async (
8279
attributes: Record<string, any>
8380
) => {
84-
CustomerIO.assrtInitialized();
8581
return NativeCustomerIO.setDeviceAttributes(attributes);
8682
};
8783

0 commit comments

Comments
 (0)