@dashx/react-native 1.1.0 → 1.1.2
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/README.md +79 -7
- package/android/.gitignore +10 -0
- package/android/build/.transforms/9dceace6c3787533d2dbb1a387e9284c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/dashx/rn/sdk/DashXReactNativeFirebaseMessagingService.dex +0 -0
- package/android/build/.transforms/9dceace6c3787533d2dbb1a387e9284c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/dashx/rn/sdk/DashXReactNativeModule.dex +0 -0
- package/android/build/.transforms/9dceace6c3787533d2dbb1a387e9284c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/dashx/rn/sdk/MessageReceivedEventHolder.dex +0 -0
- package/android/build/.transforms/9dceace6c3787533d2dbb1a387e9284c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/dashx/rn/sdk/ReactNativeLibraryInfoProvider.dex +0 -0
- package/android/build/.transforms/9dceace6c3787533d2dbb1a387e9284c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/dashx/rn/sdk/util/Utils$WhenMappings.dex +0 -0
- package/android/build/.transforms/9dceace6c3787533d2dbb1a387e9284c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/dashx/rn/sdk/util/Utils.dex +0 -0
- package/android/build/.transforms/9dceace6c3787533d2dbb1a387e9284c/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/f3c6049e7ab4bb564c79f3a246b8575e/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +16 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -1
- package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/services/com.dashx.android.DashXLibraryInfoProvider +1 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +31 -5
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +16 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/dashx/rn/sdk/DashXReactNativeFirebaseMessagingService.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/dashx/rn/sdk/DashXReactNativeModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/dashx/rn/sdk/MessageReceivedEventHolder.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/dashx/rn/sdk/ReactNativeLibraryInfoProvider.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/dashx/rn/sdk/util/Utils$WhenMappings.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/dashx/rn/sdk/util/Utils.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +1 -1
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +25 -3
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/dashx/rn/sdk/DashXReactNativeFirebaseMessagingService.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/dashx/rn/sdk/DashXReactNativeModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/dashx/rn/sdk/MessageReceivedEventHolder.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/dashx/rn/sdk/ReactNativeLibraryInfoProvider.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/dashx/rn/sdk/util/Utils$WhenMappings.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/dashx/rn/sdk/util/Utils.class +0 -0
- package/android/build.gradle +6 -4
- package/android/src/main/AndroidManifest.xml +15 -3
- package/android/src/main/java/com/dashx/rn/sdk/DashXReactNativeFirebaseMessagingService.kt +72 -0
- package/android/src/main/java/com/dashx/rn/sdk/DashXReactNativeModule.kt +97 -19
- package/android/src/main/java/com/dashx/rn/sdk/MessageReceivedEventHolder.kt +14 -0
- package/android/src/main/java/com/dashx/rn/sdk/ReactNativeLibraryInfoProvider.kt +8 -0
- package/android/src/main/java/com/dashx/rn/sdk/util/Utils.kt +14 -0
- package/android/src/main/resources/META-INF/services/com.dashx.android.DashXLibraryInfoProvider +1 -0
- package/index.d.ts +129 -0
- package/index.js +124 -63
- package/ios/DashXEventEmitter.swift +3 -2
- package/ios/DashXRCTAppDelegate.swift +38 -0
- package/ios/DashXReactNative.mm +4 -0
- package/ios/DashXReactNative.swift +15 -3
- package/package.json +7 -12
- package/yarn.lock +1555 -2562
- package/ContentOptionsBuilder.js +0 -62
- package/android/build/.transforms/103e3bf16f310520880af8bd348f4f94/results.bin +0 -1
- package/android/build/.transforms/103e3bf16f310520880af8bd348f4f94/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/1a91a107d670af17a51b8ccf1674f99e/results.bin +0 -1
- package/android/build/.transforms/1a91a107d670af17a51b8ccf1674f99e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/dashx/rn/sdk/BuildConfig.dex +0 -0
- package/android/build/.transforms/1a91a107d670af17a51b8ccf1674f99e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/dashx/rn/sdk/DashXPackage.dex +0 -0
- package/android/build/.transforms/1a91a107d670af17a51b8ccf1674f99e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/dashx/rn/sdk/DashXReactNativeModule.dex +0 -0
- package/android/build/.transforms/1a91a107d670af17a51b8ccf1674f99e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/dashx/rn/sdk/util/ArrayUtil$1.dex +0 -0
- package/android/build/.transforms/1a91a107d670af17a51b8ccf1674f99e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/dashx/rn/sdk/util/ArrayUtil.dex +0 -0
- package/android/build/.transforms/1a91a107d670af17a51b8ccf1674f99e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/dashx/rn/sdk/util/MapUtil$1.dex +0 -0
- package/android/build/.transforms/1a91a107d670af17a51b8ccf1674f99e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/dashx/rn/sdk/util/MapUtil.dex +0 -0
- package/android/build/.transforms/1a91a107d670af17a51b8ccf1674f99e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/dashx/rn/sdk/util/Utils$WhenMappings.dex +0 -0
- package/android/build/.transforms/1a91a107d670af17a51b8ccf1674f99e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/dashx/rn/sdk/util/Utils.dex +0 -0
- package/android/build/.transforms/1a91a107d670af17a51b8ccf1674f99e/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
- package/utils/RestAPIClient.js +0 -154
- package/utils.js +0 -21
|
@@ -70,6 +70,8 @@ open class DashXRCTAppDelegate: RCTAppDelegate, MessagingDelegate, UNUserNotific
|
|
|
70
70
|
|
|
71
71
|
DashX.trackNotification(message: message, event: .delivered)
|
|
72
72
|
|
|
73
|
+
DashXEventEmitter.instance.dispatch(name: "messageReceived", body: bridgeSafePayload(from: message))
|
|
74
|
+
|
|
73
75
|
let presentationOptions = notificationDeliveredInForeground(message: message)
|
|
74
76
|
|
|
75
77
|
completionHandler(presentationOptions)
|
|
@@ -81,6 +83,8 @@ open class DashXRCTAppDelegate: RCTAppDelegate, MessagingDelegate, UNUserNotific
|
|
|
81
83
|
// Pass notification reciept information to Firebase
|
|
82
84
|
Messaging.messaging().appDidReceiveMessage(message)
|
|
83
85
|
|
|
86
|
+
DashXEventEmitter.instance.dispatch(name: "messageReceived", body: bridgeSafePayload(from: message))
|
|
87
|
+
|
|
84
88
|
if response.actionIdentifier == UNNotificationDismissActionIdentifier {
|
|
85
89
|
DashX.trackNotification(message: message, event: .dismissed)
|
|
86
90
|
} else {
|
|
@@ -100,6 +104,8 @@ open class DashXRCTAppDelegate: RCTAppDelegate, MessagingDelegate, UNUserNotific
|
|
|
100
104
|
// Pass notification reciept information to Firebase
|
|
101
105
|
Messaging.messaging().appDidReceiveMessage(userInfo)
|
|
102
106
|
|
|
107
|
+
DashXEventEmitter.instance.dispatch(name: "messageReceived", body: bridgeSafePayload(from: userInfo))
|
|
108
|
+
|
|
103
109
|
guard let dashxData = userInfo.dashxNotificationData() else {
|
|
104
110
|
DashXLog.d(tag: #function, "Unable to parse DashX notification data")
|
|
105
111
|
completionHandler(.failed)
|
|
@@ -154,6 +160,38 @@ open class DashXRCTAppDelegate: RCTAppDelegate, MessagingDelegate, UNUserNotific
|
|
|
154
160
|
open func notificationClicked(message: [AnyHashable: Any], actionIdentifier: String) {}
|
|
155
161
|
|
|
156
162
|
open func handleLink(url: URL) {}
|
|
163
|
+
|
|
164
|
+
/// Converts notification userInfo to a dictionary safe for the React Native bridge (string keys, JSON-serializable values).
|
|
165
|
+
private func bridgeSafePayload(from userInfo: [AnyHashable: Any]) -> [String: Any] {
|
|
166
|
+
userInfo.reduce(into: [String: Any]()) { result, pair in
|
|
167
|
+
let key = String(describing: pair.key)
|
|
168
|
+
let value = pair.value
|
|
169
|
+
if let str = value as? String {
|
|
170
|
+
result[key] = str
|
|
171
|
+
} else if let num = value as? NSNumber {
|
|
172
|
+
result[key] = num
|
|
173
|
+
} else if let dict = value as? [AnyHashable: Any] {
|
|
174
|
+
result[key] = bridgeSafePayload(from: dict)
|
|
175
|
+
} else if let arr = value as? [Any] {
|
|
176
|
+
result[key] = arr.map { item -> Any in
|
|
177
|
+
if let str = item as? String { return str }
|
|
178
|
+
if let num = item as? NSNumber { return num }
|
|
179
|
+
if let d = item as? [AnyHashable: Any] { return bridgeSafePayload(from: d) }
|
|
180
|
+
if let a = item as? [Any] {
|
|
181
|
+
return a.map { sub in
|
|
182
|
+
if let s = sub as? String { return s }
|
|
183
|
+
if let n = sub as? NSNumber { return n }
|
|
184
|
+
if let sd = sub as? [AnyHashable: Any] { return bridgeSafePayload(from: sd) }
|
|
185
|
+
return "\(sub)"
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return "\(item)"
|
|
189
|
+
}
|
|
190
|
+
} else {
|
|
191
|
+
result[key] = "\(value)"
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
157
195
|
}
|
|
158
196
|
|
|
159
197
|
extension DashXRCTAppDelegate {
|
package/ios/DashXReactNative.mm
CHANGED
|
@@ -13,6 +13,10 @@ RCT_EXTERN_METHOD(track:(NSString *)event data:(NSDictionary * _Nullable)data);
|
|
|
13
13
|
|
|
14
14
|
RCT_EXTERN_METHOD(screen:(NSString *)screenName data:(NSDictionary * _Nullable)data);
|
|
15
15
|
|
|
16
|
+
RCT_EXTERN_METHOD(fetchRecord:(NSString *)urn options:(NSDictionary * _Nullable)options resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject);
|
|
17
|
+
|
|
18
|
+
RCT_EXTERN_METHOD(searchRecords:(NSString *)resource options:(NSDictionary * _Nullable)options resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject);
|
|
19
|
+
|
|
16
20
|
RCT_EXTERN_METHOD(fetchStoredPreferences:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject);
|
|
17
21
|
|
|
18
22
|
RCT_EXTERN_METHOD(saveStoredPreferences:(NSDictionary *)preferenceData resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject);
|
|
@@ -20,9 +20,11 @@ class DashXReactNative: RCTEventEmitter {
|
|
|
20
20
|
|
|
21
21
|
@objc(configure:)
|
|
22
22
|
func configure(_ options: NSDictionary) {
|
|
23
|
-
let publicKey = options["publicKey"] as
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
guard let publicKey = options["publicKey"] as? String, !publicKey.isEmpty else {
|
|
24
|
+
return
|
|
25
|
+
}
|
|
26
|
+
let baseURI = options["baseURI"] as? String
|
|
27
|
+
let targetEnvironment = options["targetEnvironment"] as? String
|
|
26
28
|
|
|
27
29
|
DashX.configure(
|
|
28
30
|
withPublicKey: publicKey,
|
|
@@ -56,6 +58,16 @@ class DashXReactNative: RCTEventEmitter {
|
|
|
56
58
|
DashX.screen(screenName, withData: data)
|
|
57
59
|
}
|
|
58
60
|
|
|
61
|
+
@objc(fetchRecord:options:resolver:rejecter:)
|
|
62
|
+
func fetchRecord(_ urn: String, options: NSDictionary?, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
63
|
+
reject("EUNIMPLEMENTED", "fetchRecord is not yet implemented on iOS", nil)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@objc(searchRecords:options:resolver:rejecter:)
|
|
67
|
+
func searchRecords(_ resource: String, options: NSDictionary?, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
68
|
+
reject("EUNIMPLEMENTED", "searchRecords is not yet implemented on iOS", nil)
|
|
69
|
+
}
|
|
70
|
+
|
|
59
71
|
@objc(fetchStoredPreferences:rejecter:)
|
|
60
72
|
func fetchStoredPreferences(_ resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
61
73
|
DashX.fetchStoredPreferences(
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dashx/react-native",
|
|
3
3
|
"title": "DashX React Native",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.2",
|
|
5
5
|
"description": "DashX SDK for React Native",
|
|
6
6
|
"main": "index.js",
|
|
7
|
+
"types": "index.d.ts",
|
|
7
8
|
"files": [
|
|
8
9
|
"!**/__fixtures__",
|
|
9
10
|
"!**/__mocks__",
|
|
@@ -15,16 +16,13 @@
|
|
|
15
16
|
"!android/gradlew",
|
|
16
17
|
"!android/local.properties",
|
|
17
18
|
"!ios/build",
|
|
18
|
-
"!lib/typescript/example",
|
|
19
19
|
"*.podspec",
|
|
20
20
|
"android",
|
|
21
|
-
"ContentOptionsBuilder.js",
|
|
22
|
-
"cpp",
|
|
23
21
|
"DashXReactNative.podspec",
|
|
24
22
|
"index.js",
|
|
23
|
+
"index.d.ts",
|
|
25
24
|
"ios",
|
|
26
|
-
"README.md"
|
|
27
|
-
"utils.js"
|
|
25
|
+
"README.md"
|
|
28
26
|
],
|
|
29
27
|
"scripts": {
|
|
30
28
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -49,8 +47,8 @@
|
|
|
49
47
|
"registry": "https://registry.npmjs.org/"
|
|
50
48
|
},
|
|
51
49
|
"peerDependencies": {
|
|
52
|
-
"react": "
|
|
53
|
-
"react-native": "
|
|
50
|
+
"react": ">=17.0.0",
|
|
51
|
+
"react-native": ">=0.71.0"
|
|
54
52
|
},
|
|
55
53
|
"devDependencies": {
|
|
56
54
|
"@commitlint/config-conventional": "^17.0.2",
|
|
@@ -64,15 +62,12 @@
|
|
|
64
62
|
"prettier": "^2.0.5",
|
|
65
63
|
"react": "18.3.1",
|
|
66
64
|
"react-native": "0.77.3",
|
|
67
|
-
"react-native-builder-bob": "^0.21.3",
|
|
68
65
|
"turbo": "^1.10.7"
|
|
69
66
|
},
|
|
70
67
|
"engines": {
|
|
71
68
|
"node": ">= 16.0.0"
|
|
72
69
|
},
|
|
73
|
-
"dependencies": {
|
|
74
|
-
"react-native-get-real-path": "github:Wraptime/react-native-get-real-path"
|
|
75
|
-
},
|
|
70
|
+
"dependencies": {},
|
|
76
71
|
"eslintConfig": {
|
|
77
72
|
"root": true,
|
|
78
73
|
"extends": [
|