File tree Expand file tree Collapse file tree
example/src/components/Utility Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,6 +29,15 @@ export const Utility = () => {
2929 } } >
3030 < Text style = { styles . buttonText } > Iterable.getAttributionInfo()</ Text >
3131 </ TouchableOpacity >
32+ < TouchableOpacity style = { styles . button } onPress = { ( ) => {
33+ Iterable . setAttributionInfo ( {
34+ campaignId : 123 ,
35+ templateId : 456 ,
36+ messageId : '789' ,
37+ } ) ;
38+ } } >
39+ < Text style = { styles . buttonText } > Iterable.setAttributionInfo()</ Text >
40+ </ TouchableOpacity >
3241 </ View >
3342 ) ;
3443} ;
Original file line number Diff line number Diff line change @@ -239,6 +239,13 @@ - (void)getAttributionInfo:(RCTPromiseResolveBlock)resolve
239239 [_swiftAPI getAttributionInfo: resolve rejecter: reject];
240240}
241241
242+ - (void )setAttributionInfo : (NSDictionary *)attributionInfo
243+ {
244+ NSLog (@" ReactNativeSdk setAttributionInfo" );
245+ [_swiftAPI setAttributionInfo: attributionInfo];
246+ }
247+
248+
242249@end
243250
244251
Original file line number Diff line number Diff line change @@ -172,13 +172,14 @@ open class ReactIterableAPI: RCTEventEmitter {
172172 }
173173
174174 @objc ( setAttributionInfo: )
175- func set ( attributionInfo dict: [ AnyHashable : Any ] ? ) {
175+ public func setAttributionInfo ( attributionInfo dict: NSDictionary ? ) {
176176 ITBInfo ( )
177177 guard let dict = dict else {
178178 IterableAPI . attributionInfo = nil
179179 return
180180 }
181- IterableAPI . attributionInfo = SerializationUtil . dictionaryToDecodable ( dict: dict)
181+ IterableAPI . attributionInfo = SerializationUtil . dictionaryToDecodable (
182+ dict: dict as! [ AnyHashable : Any ] )
182183 }
183184
184185 @objc ( trackPushOpenWithCampaignId: templateId: messageId: appAlreadyRunning: dataFields: )
Original file line number Diff line number Diff line change @@ -98,9 +98,9 @@ export interface Spec extends TurboModule {
9898 getAttributionInfo ( ) : Promise < {
9999 [ key : string ] : string | number | boolean ;
100100 } | null > ;
101- // setAttributionInfo(
102- // dict: { [key: string]: string | number | boolean } | null
103- // ): void;
101+ setAttributionInfo (
102+ dict : { [ key : string ] : string | number | boolean } | null
103+ ) : void ;
104104
105105 // // Device management
106106 // disableDeviceForCurrentUser(): void;
Original file line number Diff line number Diff line change @@ -368,7 +368,7 @@ export class Iterable {
368368 static setAttributionInfo ( attributionInfo ?: IterableAttributionInfo ) {
369369 Iterable ?. logger ?. log ( 'setAttributionInfo' ) ;
370370
371- RNIterableAPI . setAttributionInfo ( attributionInfo ) ;
371+ api . setAttributionInfo ( attributionInfo ) ;
372372 }
373373
374374 /**
You can’t perform that action at this time.
0 commit comments