@dashx/react-native 1.0.6 → 1.0.8
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.
- package/DashXReactNative.podspec +31 -10
- package/android/build.gradle +21 -9
- package/android/gradle/wrapper/gradle-wrapper.properties +2 -1
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/dashx/rn/sdk/DashXReactNativeModule.kt +29 -46
- package/android/src/main/java/com/dashx/rn/sdk/util/Utils.kt +20 -1
- package/index.js +57 -64
- package/ios/DashXEventEmitter.swift +2 -4
- package/ios/DashXRCTAppDelegate.h +3 -0
- package/ios/DashXRCTAppDelegate.swift +200 -0
- package/ios/DashXReactNative-Bridging-Header.h +3 -4
- package/ios/DashXReactNative.mm +28 -0
- package/ios/DashXReactNative.swift +105 -0
- package/ios/DashXReactNative.xcodeproj/project.pbxproj +6 -6
- package/package.json +72 -9
- package/android/gradlew +0 -185
- package/android/gradlew.bat +0 -89
- package/ios/DashX-Bridging-Header.h +0 -7
- package/ios/DashX.swift +0 -174
- package/ios/DashXReactNative.m +0 -25
package/DashXReactNative.podspec
CHANGED
|
@@ -1,24 +1,45 @@
|
|
|
1
1
|
require "json"
|
|
2
2
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
4
5
|
|
|
5
6
|
Pod::Spec.new do |s|
|
|
6
7
|
s.name = "DashXReactNative"
|
|
7
8
|
s.version = package["version"]
|
|
8
9
|
s.summary = package["description"]
|
|
9
|
-
s.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
# brief license entry:
|
|
14
|
-
s.license = "MIT"
|
|
15
|
-
s.authors = { "DashXDev" => "dev@dashx.com" }
|
|
10
|
+
s.homepage = package["homepage"]
|
|
11
|
+
s.license = package["license"]
|
|
12
|
+
s.authors = package["author"]
|
|
13
|
+
|
|
16
14
|
s.platforms = { :ios => "12.0" }
|
|
17
15
|
s.source = { :git => "https://github.com/dashxhq/dashx-react-native.git", :tag => "#{s.version}" }
|
|
18
16
|
|
|
19
|
-
s.source_files = "ios/**/*.{h,
|
|
17
|
+
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
20
18
|
s.requires_arc = true
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
21
|
+
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
22
|
+
if respond_to?(:install_modules_dependencies, true)
|
|
23
|
+
install_modules_dependencies(s)
|
|
24
|
+
else
|
|
25
|
+
s.dependency "React-Core"
|
|
26
|
+
|
|
27
|
+
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
28
|
+
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
29
|
+
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
30
|
+
s.pod_target_xcconfig = {
|
|
31
|
+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
32
|
+
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
33
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
34
|
+
}
|
|
35
|
+
s.dependency "React-Codegen"
|
|
36
|
+
s.dependency "RCT-Folly"
|
|
37
|
+
s.dependency "RCTRequired"
|
|
38
|
+
s.dependency "RCTTypeSafety"
|
|
39
|
+
s.dependency "ReactCommon/turbomodule/core"
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
s.dependency "DashX", "1.0.19"
|
|
44
|
+
s.dependency "React-RCTAppDelegate"
|
|
24
45
|
end
|
package/android/build.gradle
CHANGED
|
@@ -2,8 +2,8 @@ import groovy.json.JsonSlurper
|
|
|
2
2
|
|
|
3
3
|
buildscript {
|
|
4
4
|
ext {
|
|
5
|
-
kotlinVersion = '1.
|
|
6
|
-
androidToolsVersion = '7.
|
|
5
|
+
kotlinVersion = '1.8.0'
|
|
6
|
+
androidToolsVersion = '7.1.1'
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
repositories {
|
|
@@ -22,20 +22,19 @@ apply plugin: 'kotlin-android'
|
|
|
22
22
|
|
|
23
23
|
def getVersionFromNpm() {
|
|
24
24
|
// Read and parse package.json file from project root
|
|
25
|
-
def inputFile = new File("../
|
|
25
|
+
def inputFile = new File("../package.json")
|
|
26
26
|
def packageJson = new JsonSlurper().parseText(inputFile.text)
|
|
27
27
|
|
|
28
28
|
return packageJson["version"]
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
android {
|
|
32
|
-
compileSdkVersion
|
|
33
|
-
buildToolsVersion '28.0.3'
|
|
32
|
+
compileSdkVersion 33
|
|
34
33
|
|
|
35
34
|
defaultConfig {
|
|
36
|
-
minSdkVersion
|
|
37
|
-
targetSdkVersion
|
|
38
|
-
compileSdkVersion
|
|
35
|
+
minSdkVersion 21
|
|
36
|
+
targetSdkVersion 33
|
|
37
|
+
compileSdkVersion 33
|
|
39
38
|
versionCode 1
|
|
40
39
|
versionName getVersionFromNpm()
|
|
41
40
|
|
|
@@ -44,9 +43,21 @@ android {
|
|
|
44
43
|
lintOptions {
|
|
45
44
|
abortOnError false
|
|
46
45
|
}
|
|
46
|
+
|
|
47
|
+
packagingOptions {
|
|
48
|
+
pickFirst 'lib/arm64-v8a/libc++_shared.so'
|
|
49
|
+
pickFirst 'lib/arm64-v8a/libfbjni.so'
|
|
50
|
+
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
|
|
51
|
+
pickFirst 'lib/armeabi-v7a/libfbjni.so'
|
|
52
|
+
pickFirst 'lib/x86/libc++_shared.so'
|
|
53
|
+
pickFirst 'lib/x86/libfbjni.so'
|
|
54
|
+
pickFirst 'lib/x86_64/libc++_shared.so'
|
|
55
|
+
pickFirst 'lib/x86_64/libfbjni.so'
|
|
56
|
+
}
|
|
47
57
|
}
|
|
48
58
|
|
|
49
59
|
repositories {
|
|
60
|
+
jcenter()
|
|
50
61
|
mavenCentral()
|
|
51
62
|
google()
|
|
52
63
|
}
|
|
@@ -55,6 +66,7 @@ dependencies {
|
|
|
55
66
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${project.ext.kotlinVersion}"
|
|
56
67
|
implementation 'com.facebook.react:react-native:+'
|
|
57
68
|
implementation 'com.google.code.gson:gson:2.9.0'
|
|
69
|
+
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0'
|
|
58
70
|
|
|
59
|
-
implementation "com.dashx:dashx-android:1.0.
|
|
71
|
+
implementation "com.dashx:dashx-android:1.0.13"
|
|
60
72
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
#Mon Oct 30 16:24:27 IST 2023
|
|
1
2
|
distributionBase=GRADLE_USER_HOME
|
|
2
3
|
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.
|
|
4
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
|
|
4
5
|
zipStoreBase=GRADLE_USER_HOME
|
|
5
6
|
zipStorePath=wrapper/dists
|
|
@@ -4,14 +4,16 @@ import android.content.pm.PackageInfo
|
|
|
4
4
|
import android.content.pm.PackageManager.NameNotFoundException
|
|
5
5
|
import android.net.Uri
|
|
6
6
|
import com.dashx.rn.sdk.util.*
|
|
7
|
+
import com.dashx.sdk.DashXClient as DashX
|
|
7
8
|
import com.dashx.sdk.DashXLog
|
|
8
|
-
import com.dashx.sdk.
|
|
9
|
+
import com.dashx.sdk.DashXLog.LogLevel
|
|
9
10
|
import com.dashx.sdk.data.LibraryInfo
|
|
10
11
|
import com.facebook.react.bridge.*
|
|
11
|
-
import com.google.gson.Gson
|
|
12
12
|
import java.io.File
|
|
13
|
-
import
|
|
14
|
-
|
|
13
|
+
import kotlinx.serialization.decodeFromString
|
|
14
|
+
import kotlinx.serialization.encodeToString
|
|
15
|
+
import kotlinx.serialization.json.Json
|
|
16
|
+
import kotlinx.serialization.json.JsonObject
|
|
15
17
|
|
|
16
18
|
class DashXReactNativeModule(private val reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
|
|
17
19
|
private val tag = DashXReactNativeModule::class.java.simpleName
|
|
@@ -22,7 +24,8 @@ class DashXReactNativeModule(private val reactContext: ReactApplicationContext)
|
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
@ReactMethod
|
|
25
|
-
fun setLogLevel(
|
|
27
|
+
fun setLogLevel(level: Int) {
|
|
28
|
+
val logLevel = LogLevel.values().firstOrNull { it.code == level } ?: LogLevel.OFF
|
|
26
29
|
DashXLog.setLogLevel(logLevel)
|
|
27
30
|
}
|
|
28
31
|
|
|
@@ -56,7 +59,7 @@ class DashXReactNativeModule(private val reactContext: ReactApplicationContext)
|
|
|
56
59
|
@ReactMethod
|
|
57
60
|
fun track(event: String, data: ReadableMap?) {
|
|
58
61
|
val jsonData = try {
|
|
59
|
-
data?.toHashMap() as HashMap<String, String
|
|
62
|
+
data?.toHashMap() as HashMap<String, String>?
|
|
60
63
|
} catch (e: Exception) {
|
|
61
64
|
DashXLog.d(tag, e.message)
|
|
62
65
|
return
|
|
@@ -83,7 +86,7 @@ class DashXReactNativeModule(private val reactContext: ReactApplicationContext)
|
|
|
83
86
|
promise.reject("EUNSPECIFIED", it)
|
|
84
87
|
},
|
|
85
88
|
onSuccess = {
|
|
86
|
-
promise.resolve(convertJsonToMap(it))
|
|
89
|
+
promise.resolve(convertJsonToMap(convertKJsonToJson(it)))
|
|
87
90
|
}
|
|
88
91
|
)
|
|
89
92
|
}
|
|
@@ -107,8 +110,8 @@ class DashXReactNativeModule(private val reactContext: ReactApplicationContext)
|
|
|
107
110
|
dashXClient?.searchContent(
|
|
108
111
|
contentType,
|
|
109
112
|
options?.getString("returnType") ?: "all",
|
|
110
|
-
jsonFilter,
|
|
111
|
-
jsonOrder,
|
|
113
|
+
convertJsonToKJson(jsonFilter),
|
|
114
|
+
convertJsonToKJson(jsonOrder),
|
|
112
115
|
options?.getIntIfPresent("limit"),
|
|
113
116
|
options?.getBooleanIfPresent("preview"),
|
|
114
117
|
options?.getStringIfPresent("language"),
|
|
@@ -121,7 +124,7 @@ class DashXReactNativeModule(private val reactContext: ReactApplicationContext)
|
|
|
121
124
|
onSuccess = { content ->
|
|
122
125
|
val readableArray = Arguments.createArray()
|
|
123
126
|
content.forEach {
|
|
124
|
-
readableArray.pushMap(convertJsonToMap(it))
|
|
127
|
+
readableArray.pushMap(convertJsonToMap(convertKJsonToJson(it)))
|
|
125
128
|
}
|
|
126
129
|
promise.resolve(readableArray)
|
|
127
130
|
}
|
|
@@ -149,12 +152,12 @@ class DashXReactNativeModule(private val reactContext: ReactApplicationContext)
|
|
|
149
152
|
pricingId,
|
|
150
153
|
quantity,
|
|
151
154
|
reset ?: false,
|
|
152
|
-
jsonCustom,
|
|
155
|
+
convertJsonToKJson(jsonCustom),
|
|
153
156
|
onError = {
|
|
154
157
|
promise.reject("EUNSPECIFIED", it)
|
|
155
158
|
},
|
|
156
159
|
onSuccess = { content ->
|
|
157
|
-
promise.resolve(convertJsonToMap(content))
|
|
160
|
+
promise.resolve(convertJsonToMap(convertKJsonToJson(Json.decodeFromString<JsonObject>(Json.encodeToString(content)))))
|
|
158
161
|
}
|
|
159
162
|
)
|
|
160
163
|
}
|
|
@@ -166,7 +169,7 @@ class DashXReactNativeModule(private val reactContext: ReactApplicationContext)
|
|
|
166
169
|
promise.reject("EUNSPECIFIED", it)
|
|
167
170
|
},
|
|
168
171
|
onSuccess = { content ->
|
|
169
|
-
promise.resolve(convertJsonToMap(content))
|
|
172
|
+
promise.resolve(convertJsonToMap(convertKJsonToJson(Json.decodeFromString<JsonObject>(Json.encodeToString(content)))))
|
|
170
173
|
}
|
|
171
174
|
)
|
|
172
175
|
}
|
|
@@ -178,7 +181,7 @@ class DashXReactNativeModule(private val reactContext: ReactApplicationContext)
|
|
|
178
181
|
promise.reject("EUNSPECIFIED", it)
|
|
179
182
|
},
|
|
180
183
|
onSuccess = { content ->
|
|
181
|
-
promise.resolve(convertJsonToMap(content))
|
|
184
|
+
promise.resolve(convertJsonToMap(convertKJsonToJson(Json.decodeFromString<JsonObject>(Json.encodeToString(content)))))
|
|
182
185
|
}
|
|
183
186
|
)
|
|
184
187
|
}
|
|
@@ -188,58 +191,38 @@ class DashXReactNativeModule(private val reactContext: ReactApplicationContext)
|
|
|
188
191
|
val preferencesString = MapUtil.toJSONElement(preferenceData).toString()
|
|
189
192
|
|
|
190
193
|
dashXClient?.saveStoredPreferences(
|
|
191
|
-
preferencesString,
|
|
194
|
+
Json.decodeFromString<JsonObject>(preferencesString),
|
|
192
195
|
onError = {
|
|
193
196
|
promise.reject("EUNSPECIFIED", it)
|
|
194
197
|
},
|
|
195
198
|
onSuccess = { content ->
|
|
196
|
-
promise.resolve(convertJsonToMap(content))
|
|
199
|
+
promise.resolve(convertJsonToMap(convertKJsonToJson(Json.decodeFromString<JsonObject>(Json.encodeToString(content)))))
|
|
197
200
|
}
|
|
198
201
|
)
|
|
199
202
|
}
|
|
200
203
|
|
|
201
204
|
@ReactMethod
|
|
202
|
-
fun
|
|
203
|
-
|
|
204
|
-
externalColumnId: String,
|
|
205
|
-
promise: Promise
|
|
206
|
-
) {
|
|
207
|
-
val jsonFile = try {
|
|
208
|
-
convertMapToJson(file)
|
|
209
|
-
} catch (e: Exception) {
|
|
210
|
-
DashXLog.d(tag, e.message)
|
|
211
|
-
throw Exception("Encountered an error while parsing file")
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
// Remove unnecessary double quotes from RN URI
|
|
215
|
-
val filePath = getFilePathFromURIString(jsonFile?.get("uri").toString())
|
|
216
|
-
val fileObject = File(filePath)
|
|
217
|
-
|
|
218
|
-
dashXClient?.uploadExternalAsset(
|
|
219
|
-
fileObject,
|
|
220
|
-
externalColumnId,
|
|
221
|
-
onError = {
|
|
222
|
-
promise.reject("EUNSPECIFIED", it)
|
|
223
|
-
},
|
|
224
|
-
onSuccess = { content ->
|
|
225
|
-
val jsonObject = Gson().toJsonTree(content, ExternalAsset::class.java).asJsonObject
|
|
226
|
-
promise.resolve(convertJsonToMap(jsonObject))
|
|
227
|
-
}
|
|
228
|
-
)
|
|
205
|
+
fun subscribe() {
|
|
206
|
+
dashXClient?.subscribe()
|
|
229
207
|
}
|
|
230
208
|
|
|
231
209
|
@ReactMethod
|
|
232
|
-
fun
|
|
233
|
-
dashXClient?.
|
|
210
|
+
fun unsubscribe() {
|
|
211
|
+
dashXClient?.unsubscribe()
|
|
234
212
|
}
|
|
235
213
|
|
|
236
214
|
//FIXME Amend the logic to work with React Native content URIs
|
|
237
215
|
fun getFilePathFromURIString(contentUriString: String): String {
|
|
238
216
|
val sanitizedURI = contentUriString.replace("\"", "")
|
|
239
217
|
val path = Uri.parse(sanitizedURI).path
|
|
218
|
+
val index = path?.indexOf(':')
|
|
219
|
+
|
|
220
|
+
if (index == null) {
|
|
221
|
+
return ""
|
|
222
|
+
}
|
|
240
223
|
|
|
241
224
|
// Remove unnecessary URI component
|
|
242
|
-
val filePath = path!!.substring(
|
|
225
|
+
val filePath = path!!.substring(index!! + 1)
|
|
243
226
|
|
|
244
227
|
return filePath
|
|
245
228
|
}
|
|
@@ -3,9 +3,28 @@
|
|
|
3
3
|
package com.dashx.rn.sdk.util
|
|
4
4
|
|
|
5
5
|
import com.facebook.react.bridge.*
|
|
6
|
+
import com.google.gson.Gson
|
|
6
7
|
import com.google.gson.JsonArray
|
|
7
8
|
import com.google.gson.JsonObject
|
|
9
|
+
import kotlinx.serialization.encodeToString
|
|
10
|
+
import kotlinx.serialization.json.Json
|
|
11
|
+
import kotlinx.serialization.json.JsonObject as KJsonObject
|
|
8
12
|
import org.json.JSONException
|
|
13
|
+
import kotlinx.serialization.decodeFromString
|
|
14
|
+
|
|
15
|
+
fun convertKJsonToJson(kotlinxJsonObject: KJsonObject): JsonObject {
|
|
16
|
+
val jsonString = Json.encodeToString(kotlinxJsonObject)
|
|
17
|
+
return Gson().fromJson(jsonString, JsonObject::class.java)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
fun convertJsonToKJson(jsonObject: JsonObject?): KJsonObject? {
|
|
21
|
+
if (jsonObject == null) {
|
|
22
|
+
return null
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
val jsonString = jsonObject.toString()
|
|
26
|
+
return Json.decodeFromString(jsonString)
|
|
27
|
+
}
|
|
9
28
|
|
|
10
29
|
@Throws(JSONException::class)
|
|
11
30
|
fun convertMapToJson(readableMap: ReadableMap?): JsonObject? {
|
|
@@ -128,4 +147,4 @@ fun ReadableMap.getStringIfPresent(key: String): String? {
|
|
|
128
147
|
|
|
129
148
|
fun ReadableMap.getBooleanIfPresent(key: String): Boolean? {
|
|
130
149
|
return if (this.hasKey(key)) this.getBoolean(key) else null
|
|
131
|
-
}
|
|
150
|
+
}
|
package/index.js
CHANGED
|
@@ -1,85 +1,78 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
const LINKING_ERROR =
|
|
4
|
+
`The package 'dashx-react-native' doesn't seem to be linked. Make sure: \n\n` +
|
|
5
|
+
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
6
|
+
'- You rebuilt the app after installing the package\n' +
|
|
7
|
+
'- You are not using Expo Go\n';
|
|
8
|
+
|
|
9
|
+
const DashX = NativeModules.DashXReactNative
|
|
10
|
+
? NativeModules.DashXReactNative
|
|
11
|
+
: new Proxy(
|
|
12
|
+
{},
|
|
13
|
+
{
|
|
14
|
+
get() {
|
|
15
|
+
throw new Error(LINKING_ERROR);
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
);
|
|
10
19
|
|
|
11
20
|
const {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
configure,
|
|
22
|
+
identify,
|
|
23
|
+
setIdentity,
|
|
24
|
+
reset,
|
|
25
|
+
track,
|
|
26
|
+
screen,
|
|
27
|
+
fetchStoredPreferences,
|
|
28
|
+
saveStoredPreferences,
|
|
29
|
+
subscribe,
|
|
30
|
+
unsubscribe,
|
|
31
|
+
setLogLevel,
|
|
22
32
|
} = DashX;
|
|
23
33
|
|
|
34
|
+
DashX.configure = (options) => {
|
|
35
|
+
return configure(options);
|
|
36
|
+
}
|
|
37
|
+
|
|
24
38
|
DashX.identify = (options) => {
|
|
25
|
-
|
|
39
|
+
return identify(options);
|
|
26
40
|
};
|
|
27
41
|
|
|
28
42
|
DashX.setIdentity = (uid, token) => {
|
|
29
|
-
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
DashX.track = (event, data) => track(event, data || null);
|
|
33
|
-
|
|
34
|
-
DashX.searchContent = (contentType, options) => {
|
|
35
|
-
if (!options) {
|
|
36
|
-
return new ContentOptionsBuilder((wrappedOptions) =>
|
|
37
|
-
searchContent(contentType, wrappedOptions)
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const filter = parseFilterObject(options.filter);
|
|
42
|
-
|
|
43
|
-
const result = searchContent(contentType, { ...options, filter });
|
|
44
|
-
|
|
45
|
-
if (options.returnType === "all") {
|
|
46
|
-
return result;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return result.then(toContentSingleton);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
DashX.fetchContent = (contentType, options) => {
|
|
53
|
-
return fetchContent(contentType, options);
|
|
43
|
+
return setIdentity(uid, token);
|
|
54
44
|
};
|
|
55
45
|
|
|
56
|
-
DashX.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
file.uri = `file://${await getRealPathFromURI(file.uri)}`;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return uploadExternalAsset(file, externalColumnId);
|
|
63
|
-
};
|
|
46
|
+
DashX.reset = () => {
|
|
47
|
+
return reset();
|
|
48
|
+
}
|
|
64
49
|
|
|
65
|
-
DashX.
|
|
66
|
-
|
|
67
|
-
}
|
|
50
|
+
DashX.track = (event, data) => {
|
|
51
|
+
return track(event, data || null);
|
|
52
|
+
}
|
|
68
53
|
|
|
69
|
-
DashX.
|
|
70
|
-
|
|
71
|
-
}
|
|
54
|
+
DashX.screen = (screenName, data) => {
|
|
55
|
+
return screen(screenName, data || null)
|
|
56
|
+
}
|
|
72
57
|
|
|
73
58
|
DashX.fetchStoredPreferences = () => {
|
|
74
|
-
|
|
59
|
+
return fetchStoredPreferences();
|
|
75
60
|
};
|
|
76
61
|
|
|
77
62
|
DashX.saveStoredPreferences = (preferenceData) => {
|
|
78
|
-
|
|
63
|
+
return saveStoredPreferences(preferenceData);
|
|
79
64
|
};
|
|
80
65
|
|
|
81
|
-
DashX.
|
|
82
|
-
|
|
83
|
-
}
|
|
66
|
+
DashX.subscribe = () => {
|
|
67
|
+
return subscribe();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
DashX.unsubscribe = () => {
|
|
71
|
+
return unsubscribe();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
DashX.setLogLevel = (level) => {
|
|
75
|
+
return setLogLevel(level);
|
|
76
|
+
}
|
|
84
77
|
|
|
85
78
|
export default DashX;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import Foundation
|
|
2
|
-
|
|
3
1
|
class DashXEventEmitter {
|
|
4
2
|
static let instance = DashXEventEmitter()
|
|
5
|
-
private static var eventEmitter:
|
|
3
|
+
private static var eventEmitter: DashXReactNative!
|
|
6
4
|
|
|
7
5
|
private init() {}
|
|
8
6
|
|
|
9
|
-
func registerEventEmitter(eventEmitter:
|
|
7
|
+
func registerEventEmitter(eventEmitter: DashXReactNative) {
|
|
10
8
|
DashXEventEmitter.eventEmitter = eventEmitter
|
|
11
9
|
}
|
|
12
10
|
|