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 @@ -22,6 +22,13 @@ export const Utility = () => {
2222 } } >
2323 < Text style = { styles . buttonText } > Iterable.getUserId()</ Text >
2424 </ TouchableOpacity >
25+ < TouchableOpacity style = { styles . button } onPress = { ( ) => {
26+ Iterable . getAttributionInfo ( ) . then ( ( attributionInfo ) => {
27+ console . log ( 'Iterable.getAttributionInfo() --> attributionInfo' , attributionInfo ) ;
28+ } ) ;
29+ } } >
30+ < Text style = { styles . buttonText } > Iterable.getAttributionInfo()</ Text >
31+ </ TouchableOpacity >
2532 </ View >
2633 ) ;
2734} ;
Original file line number Diff line number Diff line change @@ -232,6 +232,13 @@ - (void)updateEmail:(NSString *)email
232232 [_swiftAPI updateEmail: email authToken: authToken];
233233}
234234
235+ - (void )getAttributionInfo : (RCTPromiseResolveBlock)resolve
236+ reject : (RCTPromiseRejectBlock)reject
237+ {
238+ NSLog (@" ReactNativeSdk getAttributionInfo" );
239+ [_swiftAPI getAttributionInfo: resolve rejecter: reject];
240+ }
241+
235242@end
236243
237244
Original file line number Diff line number Diff line change @@ -165,7 +165,8 @@ open class ReactIterableAPI: RCTEventEmitter {
165165 }
166166
167167 @objc ( getAttributionInfo: rejecter: )
168- func getAttributionInfo( resolver: RCTPromiseResolveBlock , rejecter: RCTPromiseRejectBlock ) {
168+ public func getAttributionInfo( resolver: RCTPromiseResolveBlock , rejecter: RCTPromiseRejectBlock )
169+ {
169170 ITBInfo ( )
170171 resolver ( IterableAPI . attributionInfo. map ( SerializationUtil . encodableToDictionary) )
171172 }
Original file line number Diff line number Diff line change @@ -94,10 +94,10 @@ export interface Spec extends TurboModule {
9494 ) : void ;
9595 updateEmail ( email : string , authToken ?: string ) : void ;
9696
97- // // Attribution
98- // getAttributionInfo(): Promise<{
99- // [key: string]: string | number | boolean;
100- // } | null>;
97+ // Attribution
98+ getAttributionInfo ( ) : Promise < {
99+ [ key : string ] : string | number | boolean ;
100+ } | null > ;
101101 // setAttributionInfo(
102102 // dict: { [key: string]: string | number | boolean } | null
103103 // ): void;
Original file line number Diff line number Diff line change @@ -326,8 +326,8 @@ export class Iterable {
326326 static getAttributionInfo ( ) : Promise < IterableAttributionInfo | undefined > {
327327 Iterable ?. logger ?. log ( 'getAttributionInfo' ) ;
328328
329- return RNIterableAPI . getAttributionInfo ( ) . then (
330- ( dict ?: IterableAttributionInfo ) => {
329+ return api . getAttributionInfo ( ) . then (
330+ ( dict ?: { [ key : string ] : string | number | boolean } | null ) => {
331331 if ( dict ) {
332332 return new IterableAttributionInfo (
333333 dict . campaignId ,
You can’t perform that action at this time.
0 commit comments