11import {
22 Linking ,
3- NativeEventEmitter ,
4- NativeModules ,
3+ // NativeEventEmitter,
4+ // NativeModules,
55 Platform ,
66} from 'react-native' ;
77
@@ -199,7 +199,7 @@ export class Iterable {
199199 * });
200200 * ```
201201 */
202- static getEmail ( ) : Promise < string | undefined > {
202+ static getEmail ( ) : Promise < string | null | undefined > {
203203 Iterable ?. logger ?. log ( 'getEmail' ) ;
204204
205205 return RNIterableAPI . getEmail ( ) ;
@@ -264,7 +264,7 @@ export class Iterable {
264264 * });
265265 * ```
266266 */
267- static getUserId ( ) : Promise < string | undefined > {
267+ static getUserId ( ) : Promise < string | undefined | null > {
268268 Iterable ?. logger ?. log ( 'getUserId' ) ;
269269
270270 return RNIterableAPI . getUserId ( ) ;
@@ -327,12 +327,12 @@ export class Iterable {
327327 Iterable ?. logger ?. log ( 'getAttributionInfo' ) ;
328328
329329 return RNIterableAPI . getAttributionInfo ( ) . then (
330- ( dict ?: IterableAttributionInfo ) => {
330+ ( dict : { [ key : string ] : string | number | boolean | null } | null ) => {
331331 if ( dict ) {
332332 return new IterableAttributionInfo (
333- dict . campaignId ,
334- dict . templateId ,
335- dict . messageId
333+ dict . campaignId as number ,
334+ dict . templateId as number ,
335+ dict . messageId as string
336336 ) ;
337337 } else {
338338 return undefined ;
@@ -365,9 +365,10 @@ export class Iterable {
365365 * Iterable.setAttributionInfo(attributionInfo);
366366 * ```
367367 */
368- static setAttributionInfo ( attributionInfo ?: IterableAttributionInfo ) {
368+ static setAttributionInfo ( attributionInfo ?: IterableAttributionInfo | null ) {
369369 Iterable ?. logger ?. log ( 'setAttributionInfo' ) ;
370370
371+ // @ts -ignore
371372 RNIterableAPI . setAttributionInfo ( attributionInfo ) ;
372373 }
373374
@@ -412,9 +413,9 @@ export class Iterable {
412413 RNIterableAPI . trackPushOpenWithCampaignId (
413414 campaignId ,
414415 templateId ,
415- messageId ,
416+ messageId as string ,
416417 appAlreadyRunning ,
417- dataFields
418+ dataFields as { [ key : string ] : string | number | boolean | null } | null
418419 ) ;
419420 }
420421
@@ -447,6 +448,7 @@ export class Iterable {
447448 static updateCart ( items : IterableCommerceItem [ ] ) {
448449 Iterable ?. logger ?. log ( 'updateCart' ) ;
449450
451+ // @ts -ignore
450452 RNIterableAPI . updateCart ( items ) ;
451453 }
452454
@@ -464,6 +466,7 @@ export class Iterable {
464466 if ( Platform . OS === 'android' ) {
465467 Iterable ?. logger ?. log ( 'Attempting to wake the app' ) ;
466468
469+ // @ts -ignore
467470 RNIterableAPI . wakeApp ( ) ;
468471 }
469472 }
@@ -499,6 +502,7 @@ export class Iterable {
499502 ) {
500503 Iterable ?. logger ?. log ( 'trackPurchase' ) ;
501504
505+ // @ts -ignore
502506 RNIterableAPI . trackPurchase ( total , items , dataFields ) ;
503507 }
504508
@@ -668,6 +672,7 @@ export class Iterable {
668672 static trackEvent ( name : string , dataFields ?: unknown ) {
669673 Iterable ?. logger ?. log ( 'trackEvent' ) ;
670674
675+ // @ts -ignore
671676 RNIterableAPI . trackEvent ( name , dataFields ) ;
672677 }
673678
@@ -716,6 +721,7 @@ export class Iterable {
716721 ) {
717722 Iterable ?. logger ?. log ( 'updateUser' ) ;
718723
724+ // @ts -ignore
719725 RNIterableAPI . updateUser ( dataFields , mergeNestedObjects ) ;
720726 }
721727
@@ -736,7 +742,7 @@ export class Iterable {
736742 * Iterable.updateEmail('my.new.email@gmail.com', 'myAuthToken');
737743 * ```
738744 */
739- static updateEmail ( email : string , authToken ?: string ) {
745+ static updateEmail ( email : string , authToken ?: string | null ) {
740746 Iterable ?. logger ?. log ( 'updateEmail' ) ;
741747
742748 RNIterableAPI . updateEmail ( email , authToken ) ;
@@ -961,7 +967,7 @@ export class Iterable {
961967 // Else it will be looked for as a String.
962968 if ( typeof promiseResult === typeof new IterableAuthResponse ( ) ) {
963969 RNIterableAPI . passAlongAuthToken (
964- ( promiseResult as IterableAuthResponse ) . authToken
970+ ( promiseResult as IterableAuthResponse ) . authToken as string | null
965971 ) ;
966972
967973 setTimeout ( ( ) => {
0 commit comments