react-native-acoustic-connect-beta 18.0.21 → 18.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10,6 +10,19 @@ dependencyName = useRelease ? 'AcousticConnect' : 'AcousticConnectDebug'
|
|
|
10
10
|
iOSVersion = connectConfig["Connect"]["iOSVersion"]
|
|
11
11
|
dependencyVersion = iOSVersion.to_s.empty? ? "" : ", '#{iOSVersion}'"
|
|
12
12
|
|
|
13
|
+
# Write the merged consumer config to the resource-bundle source path AT POD INSTALL TIME.
|
|
14
|
+
# This MUST happen before CocoaPods builds the AcousticConnectRNConfig bundle target,
|
|
15
|
+
# which it does as a dependency of the parent target — too early for any build-time
|
|
16
|
+
# script_phase to influence. Writing here ensures the bundle ships the consumer's
|
|
17
|
+
# AppKey / PostMessageUrl / KillSwitchUrl from the very first build, instead of an
|
|
18
|
+
# empty placeholder that causes the SDK to fall back to its bundled demo defaults.
|
|
19
|
+
# See: ios/AcousticConnectRNConfig.json (placeholder shipped in the npm tarball;
|
|
20
|
+
# overwritten here on every `pod install`).
|
|
21
|
+
File.open(File.join(__dir__, 'ios', 'AcousticConnectRNConfig.json'), 'w') do |f|
|
|
22
|
+
f.write(JSON.pretty_generate(connectConfig))
|
|
23
|
+
end
|
|
24
|
+
puts "Merged ConnectConfig.json into ios/AcousticConnectRNConfig.json (install-time)"
|
|
25
|
+
|
|
13
26
|
puts "*********react-native-acoustic-connect-beta.podspec*********"
|
|
14
27
|
puts "connectConfig:"
|
|
15
28
|
puts JSON.pretty_generate(connectConfig)
|
|
@@ -37,8 +50,6 @@ Pod::Spec.new do |s|
|
|
|
37
50
|
"ios/**/*.{swift}",
|
|
38
51
|
# Autolinking/Registration (Objective-C++)
|
|
39
52
|
"ios/**/*.{m,mm}",
|
|
40
|
-
# Build Config (Ruby)
|
|
41
|
-
"ios/ConnectConfig/**/*.{rb}",
|
|
42
53
|
# Implementation (C++ objects)
|
|
43
54
|
"cpp/**/*.{hpp,cpp}",
|
|
44
55
|
]
|
|
@@ -52,11 +63,6 @@ Pod::Spec.new do |s|
|
|
|
52
63
|
'AcousticConnectRNConfig' => ['ios/AcousticConnectRNConfig.json'],
|
|
53
64
|
}
|
|
54
65
|
s.resource = 'ios/AcousticConnectRNConfig.json'
|
|
55
|
-
s.script_phase = {
|
|
56
|
-
:name => 'Build Config',
|
|
57
|
-
:script => %("${PODS_TARGET_SRCROOT}/ios/ConnectConfig/Build_Config.rb" "${PODS_ROOT}" "ConnectConfig.json" "${PODS_TARGET_SRCROOT}"),
|
|
58
|
-
:execution_position => :before_compile,
|
|
59
|
-
}
|
|
60
66
|
|
|
61
67
|
load 'nitrogen/generated/ios/AcousticConnectRN+autolinking.rb'
|
|
62
68
|
add_nitrogen_files(s)
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Connect": {
|
|
3
|
+
"AndroidVersion": "11.0.9-beta",
|
|
4
|
+
"AppKey": "b6c3709b7a4c479bb4b5a9fb8fec324c",
|
|
5
|
+
"KillSwitchUrl": "https://lib-us-2.brilliantcollector.com/collector/switch/b6c3709b7a4c479bb4b5a9fb8fec324c",
|
|
6
|
+
"PostMessageUrl": "https://lib-us-2.brilliantcollector.com/collector/collectorPost",
|
|
7
|
+
"iOSVersion": "",
|
|
8
|
+
"layoutConfigAndroid": {
|
|
9
|
+
"AppendMapIds": {
|
|
10
|
+
"[w,9290],[v,0]": {
|
|
11
|
+
"mid": "ASimpleUIView"
|
|
12
|
+
},
|
|
13
|
+
"idxPathValue": {
|
|
14
|
+
"mid": "giveAdditionalId2"
|
|
15
|
+
},
|
|
16
|
+
"tag2999999": {
|
|
17
|
+
"mid": "giveAdditionalId1"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"AutoLayout": {
|
|
21
|
+
"ExampleMaskingPage": {
|
|
22
|
+
"CaptureLayoutDelay": 0,
|
|
23
|
+
"CaptureLayoutOn": 0,
|
|
24
|
+
"CaptureScreenVisits": false,
|
|
25
|
+
"CaptureScreenshotOn": 0,
|
|
26
|
+
"CaptureUserEvents": false,
|
|
27
|
+
"DisplayName": "",
|
|
28
|
+
"Masking": {
|
|
29
|
+
"HasCustomMask": true,
|
|
30
|
+
"HasMasking": true,
|
|
31
|
+
"MaskAccessibilityIdList": [],
|
|
32
|
+
"MaskAccessibilityLabelList": [],
|
|
33
|
+
"MaskIdList": [
|
|
34
|
+
"^9[0-9][0-9][0-9]$",
|
|
35
|
+
"^\\[wvv,0\\],\\[dddv,0\\],\\[v,0\\],\\[v,0\\],\\[v,0\\],\\[b,0\\](.)*$"
|
|
36
|
+
],
|
|
37
|
+
"MaskValueList": [
|
|
38
|
+
"^4[0-9]{12}(?:[0-9]{3})?$",
|
|
39
|
+
"^3[47][0-9]{13}$",
|
|
40
|
+
"^65[4-9][0-9]{13}|64[4-9][0-9]{13}|6011[0-9]{12}|(622(?:12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|9[01][0-9]|92[0-5])[0-9]{10})$",
|
|
41
|
+
"^(5[1-5][0-9]{14}|2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12}))$"
|
|
42
|
+
],
|
|
43
|
+
"Sensitive": {
|
|
44
|
+
"capitalCaseAlphabet": "X",
|
|
45
|
+
"number": "9",
|
|
46
|
+
"smallCaseAlphabet": "x",
|
|
47
|
+
"symbol": "#"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"NumberOfWebViews": 0,
|
|
51
|
+
"ScreenChange": false,
|
|
52
|
+
"ScreenShot": false
|
|
53
|
+
},
|
|
54
|
+
"GlobalScreenSettings": {
|
|
55
|
+
"CaptureLayoutDelay": 1,
|
|
56
|
+
"CaptureLayoutOn": 2,
|
|
57
|
+
"CaptureScreenVisits": false,
|
|
58
|
+
"CaptureScreenshotOn": 2,
|
|
59
|
+
"CaptureUserEvents": true,
|
|
60
|
+
"DisplayName": "",
|
|
61
|
+
"Masking": {
|
|
62
|
+
"HasCustomMask": true,
|
|
63
|
+
"HasMasking": true,
|
|
64
|
+
"MaskAccessibilityIdList": [],
|
|
65
|
+
"MaskAccessibilityLabelList": [],
|
|
66
|
+
"MaskIdList": [],
|
|
67
|
+
"MaskValueList": [],
|
|
68
|
+
"Sensitive": {
|
|
69
|
+
"capitalCaseAlphabet": "X",
|
|
70
|
+
"number": "9",
|
|
71
|
+
"smallCaseAlphabet": "x",
|
|
72
|
+
"symbol": "#"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"NumberOfWebViews": 0,
|
|
76
|
+
"ScreenChange": true,
|
|
77
|
+
"ScreenShot": true
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"layoutConfigIos": {
|
|
82
|
+
"AppendMapIds": {
|
|
83
|
+
"[w,9290],[v,0]": {
|
|
84
|
+
"mid": "ASimpleUIView"
|
|
85
|
+
},
|
|
86
|
+
"idxPathValue": {
|
|
87
|
+
"mid": "giveAdditionalId2"
|
|
88
|
+
},
|
|
89
|
+
"tag2999999": {
|
|
90
|
+
"mid": "giveAdditionalId1"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"AutoLayout": {
|
|
94
|
+
"ExampleMaskingPage": {
|
|
95
|
+
"CaptureLayoutDelay": 0,
|
|
96
|
+
"CaptureLayoutOn": 0,
|
|
97
|
+
"CaptureScreenVisits": false,
|
|
98
|
+
"CaptureScreenshotOn": 0,
|
|
99
|
+
"CaptureUserEvents": false,
|
|
100
|
+
"DisplayName": "",
|
|
101
|
+
"Masking": {
|
|
102
|
+
"HasCustomMask": true,
|
|
103
|
+
"HasMasking": true,
|
|
104
|
+
"MaskAccessibilityIdList": [],
|
|
105
|
+
"MaskAccessibilityLabelList": [],
|
|
106
|
+
"MaskIdList": [
|
|
107
|
+
"^9[0-9][0-9][0-9]$",
|
|
108
|
+
"^\\[wvv,0\\],\\[dddv,0\\],\\[v,0\\],\\[v,0\\],\\[v,0\\],\\[b,0\\](.)*$"
|
|
109
|
+
],
|
|
110
|
+
"MaskValueList": [
|
|
111
|
+
"^4[0-9]{12}(?:[0-9]{3})?$",
|
|
112
|
+
"^3[47][0-9]{13}$",
|
|
113
|
+
"^65[4-9][0-9]{13}|64[4-9][0-9]{13}|6011[0-9]{12}|(622(?:12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|9[01][0-9]|92[0-5])[0-9]{10})$",
|
|
114
|
+
"^(5[1-5][0-9]{14}|2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12}))$"
|
|
115
|
+
],
|
|
116
|
+
"Sensitive": {
|
|
117
|
+
"capitalCaseAlphabet": "X",
|
|
118
|
+
"number": "9",
|
|
119
|
+
"smallCaseAlphabet": "x",
|
|
120
|
+
"symbol": "#"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"NumberOfWebViews": 0,
|
|
124
|
+
"ScreenChange": false,
|
|
125
|
+
"ScreenShot": false
|
|
126
|
+
},
|
|
127
|
+
"GlobalScreenSettings": {
|
|
128
|
+
"CaptureLayoutDelay": 1,
|
|
129
|
+
"CaptureLayoutOn": 2,
|
|
130
|
+
"CaptureScreenVisits": false,
|
|
131
|
+
"CaptureScreenshotOn": 2,
|
|
132
|
+
"CaptureUserEvents": true,
|
|
133
|
+
"DisplayName": "",
|
|
134
|
+
"Masking": {
|
|
135
|
+
"HasCustomMask": true,
|
|
136
|
+
"HasMasking": true,
|
|
137
|
+
"MaskAccessibilityIdList": [],
|
|
138
|
+
"MaskAccessibilityLabelList": [],
|
|
139
|
+
"MaskIdList": [],
|
|
140
|
+
"MaskValueList": [],
|
|
141
|
+
"Sensitive": {
|
|
142
|
+
"capitalCaseAlphabet": "X",
|
|
143
|
+
"number": "9",
|
|
144
|
+
"smallCaseAlphabet": "x",
|
|
145
|
+
"symbol": "#"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"NumberOfWebViews": 0,
|
|
149
|
+
"ScreenChange": true,
|
|
150
|
+
"ScreenShot": true
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"useRelease": false
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -61,17 +61,89 @@ class HybridAcousticConnectRN: HybridAcousticConnectRNSpec {
|
|
|
61
61
|
|
|
62
62
|
func load() {
|
|
63
63
|
DispatchQueue.main.async {
|
|
64
|
-
self.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
let connectData = self.parseConnectConfigJSON()
|
|
65
|
+
let appKey = (connectData?["AppKey"] as? String) ?? ""
|
|
66
|
+
let postURL = (connectData?["PostMessageUrl"] as? String) ?? ""
|
|
67
|
+
|
|
68
|
+
// Skip enable entirely if the consumer's config didn't reach us —
|
|
69
|
+
// proceeding with empty strings would let the SDK silently fall back
|
|
70
|
+
// to its bundled demo collector, which is exactly the bug this flow
|
|
71
|
+
// is designed to prevent. Most likely cause: missing or malformed
|
|
72
|
+
// ConnectConfig.json at the consumer's project root, or `pod install`
|
|
73
|
+
// didn't run after the file was added.
|
|
74
|
+
guard !appKey.isEmpty, !postURL.isEmpty else {
|
|
75
|
+
print("[AcousticConnectRN] SDK NOT ENABLED — empty AppKey or PostMessageUrl. " +
|
|
76
|
+
"Verify ConnectConfig.json at your project root contains both fields, " +
|
|
77
|
+
"then re-run `pod install`.")
|
|
78
|
+
return
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
let helper = ConnectApplicationHelper.sharedInstance()
|
|
82
|
+
helper.isReactNative(true, wrapNavigationContainer: true)
|
|
83
|
+
|
|
84
|
+
// Seed bundle defaults via the new internal selector when available.
|
|
85
|
+
// Required on merged Debug 2.1.2+ SDKs where EOCoreSettings.bundle /
|
|
86
|
+
// TLFResources.bundle aren't on the app target's resource path; without
|
|
87
|
+
// it the SDK fails to enable. Runtime-dispatched so older SDKs that
|
|
88
|
+
// don't expose this method skip cleanly.
|
|
89
|
+
let applyDefaults = NSSelectorFromString("_connectApplyBundleDefaults")
|
|
90
|
+
if helper.responds(to: applyDefaults) {
|
|
91
|
+
helper.perform(applyDefaults)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Enable with explicit appKey/postURL via the new internal selector
|
|
95
|
+
// when present. The zero-arg `enableFramework()` and the deprecated
|
|
96
|
+
// 2-arg public form both empirically ignore explicit values on merged
|
|
97
|
+
// SDKs (they re-read from Connect.framework's bundled demo defaults).
|
|
98
|
+
// The new `_connectEnableWithAppKey:postURL:` honours the args — same
|
|
99
|
+
// path the SDK's own ConnectSDK.shared.enable(...) wrapper uses.
|
|
100
|
+
// Falls back to the deprecated public 2-arg form on older SDKs.
|
|
101
|
+
let connectEnableSel = NSSelectorFromString("_connectEnableWithAppKey:postURL:")
|
|
102
|
+
if helper.responds(to: connectEnableSel) {
|
|
103
|
+
typealias EnableFn = @convention(c) (AnyObject, Selector, NSString, NSString) -> Bool
|
|
104
|
+
let imp = helper.method(for: connectEnableSel)
|
|
105
|
+
let fn = unsafeBitCast(imp, to: EnableFn.self)
|
|
106
|
+
_ = fn(helper, connectEnableSel, appKey as NSString, postURL as NSString)
|
|
107
|
+
} else {
|
|
108
|
+
// Older SDK build that doesn't expose the underscored category. The
|
|
109
|
+
// deprecated 2-arg public form may not honor explicit values on every
|
|
110
|
+
// SDK version — log so the consumer can tell which path fired if they
|
|
111
|
+
// see unexpected routing on their dashboard.
|
|
112
|
+
print("[AcousticConnectRN] Using deprecated enableFramework(_:withPostMessageUrl:) — " +
|
|
113
|
+
"the new internal selector is not exposed by this SDK build. " +
|
|
114
|
+
"If sessions appear on the wrong dashboard, upgrade the AcousticConnect pod.")
|
|
115
|
+
_ = helper.enableFramework(appKey, withPostMessageUrl: postURL)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Apply remaining programmatic overrides (everything other than the
|
|
119
|
+
// two enable parameters) AFTER enable — matches the order in the SDK's
|
|
120
|
+
// own ConnectSDK.shared.enable(with:) implementation.
|
|
121
|
+
if let connectData = connectData {
|
|
122
|
+
self.applyConnectConfig(connectData)
|
|
123
|
+
}
|
|
69
124
|
}
|
|
70
125
|
}
|
|
126
|
+
|
|
127
|
+
/// Reads and returns the `Connect` dictionary from the bundled
|
|
128
|
+
/// `AcousticConnectRNConfig.json`. The bundle is populated at pod install
|
|
129
|
+
/// time by the podspec — see `AcousticConnectRN.podspec`. Returns nil when
|
|
130
|
+
/// the bundle or file is missing; callers fall back to empty values.
|
|
131
|
+
private func parseConnectConfigJSON() -> [String: Any]? {
|
|
132
|
+
let bundle = Bundle(for: Self.self)
|
|
133
|
+
let bundleURL = bundle.resourceURL?.appendingPathComponent("AcousticConnectRNConfig.bundle")
|
|
134
|
+
let resourceBundle = bundleURL.flatMap { Bundle(url: $0) }
|
|
135
|
+
let path = resourceBundle?.path(forResource: "AcousticConnectRNConfig", ofType: "json")
|
|
136
|
+
let data = path.flatMap { try? Data(contentsOf: URL(fileURLWithPath: $0)) }
|
|
137
|
+
let jsonData = data.flatMap { try? JSONSerialization.jsonObject(with: $0, options: []) as? [String: Any] }
|
|
138
|
+
return jsonData?["Connect"] as? [String: Any]
|
|
139
|
+
}
|
|
71
140
|
|
|
72
|
-
///
|
|
73
|
-
///
|
|
74
|
-
|
|
141
|
+
/// Applies every recognised key from the parsed `Connect` config as a
|
|
142
|
+
/// programmatic override. Called by `load()` AFTER enable so values land on
|
|
143
|
+
/// a fully-initialised SDK. AppKey and PostMessageUrl are skipped here —
|
|
144
|
+
/// they're passed to enable directly because the SDK's bundle-read
|
|
145
|
+
/// short-circuits `tempConfigDict` for those two specifically.
|
|
146
|
+
private func applyConnectConfig(_ connectData: [String: Any]) {
|
|
75
147
|
let eocoreKeys = [
|
|
76
148
|
"CachingLevel", "DoPostAppComesFromBackground", "DoPostAppGoesToBackground", "DoPostAppGoesToClose",
|
|
77
149
|
"DoPostAppIsLaunched", "DoPostOnIntervals", "DynamicConfigurationEnabled", "HasToPersistLocalCache",
|
|
@@ -106,27 +178,20 @@ class HybridAcousticConnectRN: HybridAcousticConnectRNSpec {
|
|
|
106
178
|
"textBox:_searchFieldBeginChanged", "textBox:_searchFieldBeginEditing", "textBox:_searchFieldEditingChanged",
|
|
107
179
|
"textBox:textChange", "textBox:textChanged", "textBox:textFieldDidChange", "toggleButton:click"
|
|
108
180
|
]
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
let layoutConfig = value as? [String: Any] {
|
|
124
|
-
if let autoLayout = layoutConfig["AutoLayout"] {
|
|
125
|
-
ConnectConfigStore.set("AutoLayout", value: autoLayout)
|
|
126
|
-
}
|
|
127
|
-
if let appendMapIds = layoutConfig["AppendMapIds"] {
|
|
128
|
-
ConnectConfigStore.set("AppendMapIds", value: appendMapIds)
|
|
129
|
-
}
|
|
181
|
+
|
|
182
|
+
for (key, value) in connectData {
|
|
183
|
+
// Skip keys load() passes directly to enable — re-applying is harmless but redundant.
|
|
184
|
+
if key == "AppKey" || key == "PostMessageUrl" { continue }
|
|
185
|
+
|
|
186
|
+
if tealeafKeys.contains(key) || eocoreKeys.contains(key) {
|
|
187
|
+
ConnectConfigStore.set(key, value: value)
|
|
188
|
+
} else if key == "layoutConfig",
|
|
189
|
+
let layoutConfig = value as? [String: Any] {
|
|
190
|
+
if let autoLayout = layoutConfig["AutoLayout"] {
|
|
191
|
+
ConnectConfigStore.set("AutoLayout", value: autoLayout)
|
|
192
|
+
}
|
|
193
|
+
if let appendMapIds = layoutConfig["AppendMapIds"] {
|
|
194
|
+
ConnectConfigStore.set("AppendMapIds", value: appendMapIds)
|
|
130
195
|
}
|
|
131
196
|
}
|
|
132
197
|
}
|
package/package.json
CHANGED
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"ios/**/*.mm",
|
|
67
67
|
"ios/**/*.cpp",
|
|
68
68
|
"ios/**/*.swift",
|
|
69
|
-
"ios/
|
|
69
|
+
"ios/AcousticConnectRNConfig.json",
|
|
70
70
|
"app.plugin.js",
|
|
71
71
|
"*.podspec",
|
|
72
72
|
"README.md",
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
"source": "src/index",
|
|
193
193
|
"summary": "react-native ios android tealeaf connect cxa wxca er enhanced-replay",
|
|
194
194
|
"types": "./lib/typescript/src/index.d.ts",
|
|
195
|
-
"version": "18.0.
|
|
195
|
+
"version": "18.0.22",
|
|
196
196
|
"workspaces": [
|
|
197
197
|
"example"
|
|
198
198
|
]
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
require 'json'
|
|
3
|
-
|
|
4
|
-
#--------------------------------------------------------------------------------------------
|
|
5
|
-
# Copyright (C) 2025 Acoustic, L.P. All rights reserved.
|
|
6
|
-
#
|
|
7
|
-
# NOTICE: This file contains material that is confidential and proprietary to
|
|
8
|
-
# Acoustic, L.P. and/or other developers. No license is granted under any intellectual or
|
|
9
|
-
# industrial property rights of Acoustic, L.P. except as may be provided in an agreement with
|
|
10
|
-
# Acoustic, L.P. Any unauthorized copying or distribution of content from this file is
|
|
11
|
-
# prohibited.
|
|
12
|
-
#--------------------------------------------------------------------------------------------
|
|
13
|
-
|
|
14
|
-
pods_root = ARGV[0]
|
|
15
|
-
config_file = ARGV[1]
|
|
16
|
-
lib_root = ARGV[2]
|
|
17
|
-
|
|
18
|
-
begin
|
|
19
|
-
puts "*********Build_Config.rb*********"
|
|
20
|
-
puts "Pods root:#{pods_root}"
|
|
21
|
-
puts "Config file:#{config_file}"
|
|
22
|
-
puts "Lib root:#{lib_root}"
|
|
23
|
-
puts "**********************************"
|
|
24
|
-
config_path = "#{pods_root}/../../#{config_file}"
|
|
25
|
-
if !File.exist?(config_path)
|
|
26
|
-
config_path = "#{pods_root}/../#{config_file}"
|
|
27
|
-
lib_root = "#{pods_root}/../#{lib_root}"
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
if File.exist?(config_path)
|
|
31
|
-
puts "Read from ConnectConfig.json at:#{config_path}"
|
|
32
|
-
json = JSON.parse(File.read(config_path))
|
|
33
|
-
puts JSON.pretty_generate(json)
|
|
34
|
-
else
|
|
35
|
-
puts "ConnectConfig.json does not exist at:#{config_path}"
|
|
36
|
-
exit
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
libConfigPath = "#{lib_root}/ios/ConnectConfig.json"
|
|
40
|
-
if File.exist?(libConfigPath)
|
|
41
|
-
puts "Read from ConnectConfig.json at:#{libConfigPath}"
|
|
42
|
-
libConfig = File.read(libConfigPath)
|
|
43
|
-
puts libConfig
|
|
44
|
-
|
|
45
|
-
File.open(libConfigPath, 'w') do |f|
|
|
46
|
-
f.write(JSON.pretty_generate(json))
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
libConfig = File.read(libConfigPath)
|
|
50
|
-
puts "Update #{libConfigPath} to"
|
|
51
|
-
puts "#{libConfig}"
|
|
52
|
-
else
|
|
53
|
-
puts "ConnectConfig.json does not exist at:#{libConfigPath}"
|
|
54
|
-
exit
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
rescue Errno::ENOENT
|
|
58
|
-
exit
|
|
59
|
-
end
|