File tree Expand file tree Collapse file tree 4 files changed +18
-6
lines changed
android/src/main/java/com/sourcepoint/reactnativecmp Expand file tree Collapse file tree 4 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -140,8 +140,8 @@ class ReactNativeCmpModule(reactContext: ReactApplicationContext) : NativeReactN
140140 vendors : ReadableArray ,
141141 categories : ReadableArray ,
142142 legIntCategories : ReadableArray ,
143- callback : Callback )
144- {
143+ callback : Callback
144+ ) {
145145 runOnMainThread {
146146 spConsentLib?.deleteCustomConsentTo(
147147 vendors.toList(),
Original file line number Diff line number Diff line change @@ -1996,4 +1996,4 @@ SPEC CHECKSUMS:
19961996
19971997PODFILE CHECKSUM: decdc7519d77aa5eae65b167fa59bcfce25e15d2
19981998
1999- COCOAPODS: 1.15 .2
1999+ COCOAPODS: 1.16 .2
Original file line number Diff line number Diff line change @@ -28,9 +28,18 @@ import React
2828 self . customActionId = customActionId
2929 }
3030
31- @ objc public func toDictionary( ) -> [ String : Any ] {
31+ func toDictionary( ) -> [ String : Any ] {
3232 [ " actionType " : type. description, " customActionId " : customActionId]
3333 }
34+
35+ @objc public func stringifiedJson( ) -> String {
36+ if let jsonData = try ? JSONSerialization . data ( withJSONObject: toDictionary ( ) ) ,
37+ let jsonString = String ( data: jsonData, encoding: . utf8) {
38+ return jsonString
39+ } else {
40+ return " { \" actionType: \" unknown \" } "
41+ }
42+ }
3443}
3544
3645@objc public protocol ReactNativeCmpImplDelegate {
Original file line number Diff line number Diff line change @@ -130,11 +130,14 @@ - (void)postDeleteCustomConsentGDPR:(NSArray *)vendors
130130
131131// MARK: SPDelegate
132132- (void )onAction : (RNAction*)action {
133- [self emitOnAction : [action toDictionary ]];
133+ [self emitInternalOnAction : [action stringifiedJson ]];
134134}
135135
136136- (void )onErrorWithDescription : (NSString * _Nonnull)description {
137- [self emitOnError: @{ @" description" : description }];
137+ NSDictionary *dict = @{@" description" : description};
138+ NSData *jsonData = [NSJSONSerialization dataWithJSONObject: dict options: 0 error: nil ];
139+ NSString *json = [[NSString alloc ] initWithData: jsonData encoding: NSUTF8StringEncoding];
140+ [self emitInternalOnError: json];
138141}
139142
140143- (void )onFinished {
You can’t perform that action at this time.
0 commit comments