react-native-incognia 6.18.0 → 6.19.0
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/android/build.gradle +2 -2
- package/android/src/main/java/com/incognia/reactnative/IncogniaModule.java +15 -0
- package/ios/ICGIncogniaModule.m +10 -0
- package/lib/commonjs/index.js +4 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/index.d.ts +2 -0
- package/package.json +2 -2
- package/react-native-incognia.podspec +3 -3
- package/src/index.tsx +3 -0
package/android/build.gradle
CHANGED
|
@@ -57,6 +57,6 @@ dependencies {
|
|
|
57
57
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
58
58
|
implementation "com.google.android.gms:play-services-ads-identifier:${safeExtGet('googlePlayServicesAdsIdentifierVersion', '17.0.0')}"
|
|
59
59
|
implementation "com.google.android.gms:play-services-location:${safeExtGet('googlePlayServicesLocationVersion', '17.0.0')}"
|
|
60
|
-
api 'com.incognia:incognia-br:6.
|
|
61
|
-
api 'com.incognia:incognia-trial-br:6.
|
|
60
|
+
api 'com.incognia:incognia-br:6.26.+'
|
|
61
|
+
api 'com.incognia:incognia-trial-br:6.26.+'
|
|
62
62
|
}
|
|
@@ -126,6 +126,21 @@ public class IncogniaModule extends ReactContextBaseJavaModule {
|
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
@ReactMethod
|
|
130
|
+
public void generateRequestToken(final Promise promise) {
|
|
131
|
+
Incognia.generateRequestToken(new IncogniaListener<String>() {
|
|
132
|
+
@Override
|
|
133
|
+
public void onResult(Result<String> result) {
|
|
134
|
+
if (result.isSuccessful()) {
|
|
135
|
+
String requestToken = result.getResult();
|
|
136
|
+
promise.resolve(requestToken);
|
|
137
|
+
} else {
|
|
138
|
+
promise.reject(new Exception("Error while generating a request token."));
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
129
144
|
@ReactMethod
|
|
130
145
|
public void requestPrivacyConsent(final ReadableMap consentDialogOptionsMap, final Promise promise) {
|
|
131
146
|
ConsentDialogOptions.Builder consentDialogOptions = new ConsentDialogOptions.Builder(getCurrentActivity());
|
package/ios/ICGIncogniaModule.m
CHANGED
|
@@ -175,6 +175,16 @@ RCT_EXPORT_METHOD(trackPaymentSent:(NSDictionary *)parameters) {
|
|
|
175
175
|
[ICGIncogniaTrial trackPaymentSentWithId:transactionId eventProperties:properties transactionAddresses:transactionAddresses];
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
+
RCT_EXPORT_METHOD(generateRequestToken:(RCTPromiseResolveBlock)resolve withRejecter:(RCTPromiseRejectBlock)reject) {
|
|
179
|
+
[ICGIncognia generateRequestToken:^(NSString *requestToken) {
|
|
180
|
+
if (resolve && requestToken) {
|
|
181
|
+
resolve(requestToken);
|
|
182
|
+
} else {
|
|
183
|
+
reject(nil, @"Incognia: error while generating a request token", nil);
|
|
184
|
+
}
|
|
185
|
+
}];
|
|
186
|
+
}
|
|
187
|
+
|
|
178
188
|
- (NSDictionary *)constantsToExport {
|
|
179
189
|
NSMutableDictionary *constants = [[NSMutableDictionary alloc] init];
|
|
180
190
|
|
package/lib/commonjs/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.Trial = exports.ConsentTypes = exports.notifyAppInForeground = exports.setLocationEnabled = exports.fetchInstallationId = exports.denyConsentTypes = exports.allowConsentTypes = exports.checkConsent = exports.requestPrivacyConsent = exports.trackLocalizedEvent = exports.trackEvent = exports.clearAccountId = exports.setAccountId = void 0;
|
|
6
|
+
exports.default = exports.Trial = exports.ConsentTypes = exports.notifyAppInForeground = exports.generateRequestToken = exports.setLocationEnabled = exports.fetchInstallationId = exports.denyConsentTypes = exports.allowConsentTypes = exports.checkConsent = exports.requestPrivacyConsent = exports.trackLocalizedEvent = exports.trackEvent = exports.clearAccountId = exports.setAccountId = void 0;
|
|
7
7
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
|
|
@@ -30,6 +30,8 @@ const fetchInstallationId = IncogniaModule.fetchInstallationId;
|
|
|
30
30
|
exports.fetchInstallationId = fetchInstallationId;
|
|
31
31
|
const setLocationEnabled = IncogniaModule.setLocationEnabled;
|
|
32
32
|
exports.setLocationEnabled = setLocationEnabled;
|
|
33
|
+
const generateRequestToken = IncogniaModule.generateRequestToken;
|
|
34
|
+
exports.generateRequestToken = generateRequestToken;
|
|
33
35
|
|
|
34
36
|
const notifyAppInForeground = () => {
|
|
35
37
|
if (_reactNative.Platform.OS === 'android') {
|
|
@@ -72,6 +74,7 @@ var _default = {
|
|
|
72
74
|
fetchInstallationId,
|
|
73
75
|
setLocationEnabled,
|
|
74
76
|
notifyAppInForeground,
|
|
77
|
+
generateRequestToken,
|
|
75
78
|
Trial,
|
|
76
79
|
ConsentTypes
|
|
77
80
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.tsx"],"names":["IncogniaModule","NativeModules","setAccountId","clearAccountId","trackEvent","trackLocalizedEvent","requestPrivacyConsent","checkConsent","allowConsentTypes","denyConsentTypes","fetchInstallationId","setLocationEnabled","notifyAppInForeground","Platform","OS","ConsentTypes","ADDRESS_VALIDATION","CONSENT_TYPE_ADDRESS_VALIDATION","ADVERTISEMENT","CONSENT_TYPE_ADVERTISEMENT","ENGAGE","CONSENT_TYPE_ENGAGE","EVENTS","CONSENT_TYPE_EVENTS","LOCATION","CONSENT_TYPE_LOCATION","CONTEXT_PROVIDER","CONSENT_TYPE_CONTEXT_PROVIDER","ALL","CONSENT_TYPES_ALL","NONE","CONSENT_TYPES_NONE","Trial","trackSignupSent","trackLoginSucceeded","trackPaymentSent","TransactionAddressTypes","BILLING","HOME","SHIPPING"],"mappings":";;;;;;;AAAA;;
|
|
1
|
+
{"version":3,"sources":["index.tsx"],"names":["IncogniaModule","NativeModules","setAccountId","clearAccountId","trackEvent","trackLocalizedEvent","requestPrivacyConsent","checkConsent","allowConsentTypes","denyConsentTypes","fetchInstallationId","setLocationEnabled","generateRequestToken","notifyAppInForeground","Platform","OS","ConsentTypes","ADDRESS_VALIDATION","CONSENT_TYPE_ADDRESS_VALIDATION","ADVERTISEMENT","CONSENT_TYPE_ADVERTISEMENT","ENGAGE","CONSENT_TYPE_ENGAGE","EVENTS","CONSENT_TYPE_EVENTS","LOCATION","CONSENT_TYPE_LOCATION","CONTEXT_PROVIDER","CONSENT_TYPE_CONTEXT_PROVIDER","ALL","CONSENT_TYPES_ALL","NONE","CONSENT_TYPES_NONE","Trial","trackSignupSent","trackLoginSucceeded","trackPaymentSent","TransactionAddressTypes","BILLING","HOME","SHIPPING"],"mappings":";;;;;;;AAAA;;AA8FA,MAAM;AAAEA,EAAAA;AAAF,IAAqBC,0BAA3B;AAEO,MAAMC,YAAY,GAAGF,cAAc,CAACE,YAApC;;AACA,MAAMC,cAAc,GAAGH,cAAc,CAACG,cAAtC;;AACA,MAAMC,UAAU,GAAGJ,cAAc,CAACI,UAAlC;;AACA,MAAMC,mBAAmB,GAAGL,cAAc,CAACK,mBAA3C;;AACA,MAAMC,qBAAqB,GAAGN,cAAc,CAACM,qBAA7C;;AACA,MAAMC,YAAY,GAAGP,cAAc,CAACO,YAApC;;AACA,MAAMC,iBAAiB,GAAGR,cAAc,CAACQ,iBAAzC;;AACA,MAAMC,gBAAgB,GAAGT,cAAc,CAACS,gBAAxC;;AACA,MAAMC,mBAAmB,GAAGV,cAAc,CAACU,mBAA3C;;AACA,MAAMC,kBAAkB,GAAGX,cAAc,CAACW,kBAA1C;;AACA,MAAMC,oBAAoB,GAAGZ,cAAc,CAACY,oBAA5C;;;AACA,MAAMC,qBAAqB,GAAG,MAAM;AACzC,MAAIC,sBAASC,EAAT,KAAgB,SAApB,EAA+B;AAC7Bf,IAAAA,cAAc,CAACa,qBAAf;AACD;AACF,CAJM;;;AAMA,MAAMG,YAA8B,GAAG;AAC5CC,EAAAA,kBAAkB,EAAEjB,cAAc,CAACkB,+BADS;AAE5CC,EAAAA,aAAa,EAAEnB,cAAc,CAACoB,0BAFc;AAG5CC,EAAAA,MAAM,EAAErB,cAAc,CAACsB,mBAHqB;AAI5CC,EAAAA,MAAM,EAAEvB,cAAc,CAACwB,mBAJqB;AAK5CC,EAAAA,QAAQ,EAAEzB,cAAc,CAAC0B,qBALmB;AAM5CC,EAAAA,gBAAgB,EAAE3B,cAAc,CAAC4B,6BANW;AAO5CC,EAAAA,GAAG,EAAE7B,cAAc,CAAC8B,iBAPwB;AAQ5CC,EAAAA,IAAI,EAAE/B,cAAc,CAACgC;AARuB,CAAvC;;AAWA,MAAMC,KAAwB,GAAG;AACtCC,EAAAA,eAAe,EAAElC,cAAc,CAACkC,eADM;AAEtCC,EAAAA,mBAAmB,EAAEnC,cAAc,CAACmC,mBAFE;AAGtCC,EAAAA,gBAAgB,EAAEpC,cAAc,CAACoC,gBAHK;AAItCC,EAAAA,uBAAuB,EAAE;AACvBC,IAAAA,OAAO,EAAE,SADc;AAEvBC,IAAAA,IAAI,EAAE,MAFiB;AAGvBC,IAAAA,QAAQ,EAAE;AAHa;AAJa,CAAjC;;eAWQ;AACbtC,EAAAA,YADa;AAEbC,EAAAA,cAFa;AAGbC,EAAAA,UAHa;AAIbC,EAAAA,mBAJa;AAKbC,EAAAA,qBALa;AAMbC,EAAAA,YANa;AAObC,EAAAA,iBAPa;AAQbC,EAAAA,gBARa;AASbC,EAAAA,mBATa;AAUbC,EAAAA,kBAVa;AAWbE,EAAAA,qBAXa;AAYbD,EAAAA,oBAZa;AAabqB,EAAAA,KAba;AAcbjB,EAAAA;AAda,C","sourcesContent":["import { NativeModules, Platform } from 'react-native';\n\ntype IncogniaType = {\n setAccountId(accountId: string): void;\n clearAccountId(): void;\n trackEvent(params: TrackEventParamsType): void;\n trackLocalizedEvent(params: TrackEventParamsType): void;\n requestPrivacyConsent(params: ConsentRequestParamsType): Promise<any>;\n checkConsent(consentTypes: Array<string>): Promise<any>;\n allowConsentTypes(consentTypes: Array<string>): void;\n denyConsentTypes(consentTypes: Array<string>): void;\n fetchInstallationId(): Promise<string>;\n setLocationEnabled(enabled: boolean): void;\n notifyAppInForeground(): void;\n generateRequestToken(): Promise<string>;\n ConsentTypes: ConsentTypesType;\n Trial: IncogniaTrialType;\n};\n\ntype IncogniaTrialType = {\n trackSignupSent(params: TrackSignupParamsType): void;\n trackLoginSucceeded(params: TrackLoginSucceededParamsType): void;\n trackPaymentSent(params: TrackPaymentParamsType): void;\n TransactionAddressTypes: TranscationAddressTypesType;\n};\n\ntype ConsentTypesType = {\n readonly ADDRESS_VALIDATION: string;\n readonly ADVERTISEMENT: string;\n readonly ENGAGE: string;\n readonly EVENTS: string;\n readonly LOCATION: string;\n readonly CONTEXT_PROVIDER: string;\n readonly ALL: Array<string>;\n readonly NONE: Array<string>;\n};\n\ntype TranscationAddressTypesType = {\n readonly BILLING: string;\n readonly SHIPPING: string;\n readonly HOME: string;\n};\n\ntype TrackEventParamsType = {\n eventName: string;\n eventProperties?: Object;\n};\n\ntype TrackSignupParamsType = {\n signupId?: string;\n signupAddress?: UserAddressType;\n properties?: Object;\n};\n\ntype TrackLoginSucceededParamsType = {\n loginId?: string;\n accountId?: string;\n properties?: Object;\n};\n\ntype TrackPaymentParamsType = {\n transactionId?: string;\n transactionAddresses?: Array<TransactionAddressType>;\n properties?: Object;\n};\n\ntype UserAddressType = {\n locale?: string;\n countryName?: string;\n countryCode?: string;\n adminArea?: string;\n subAdminArea?: string;\n locality?: string;\n subLocality?: string;\n thoroughfare?: string;\n subThoroughfare?: string;\n postalCode?: string;\n latitude?: number;\n longitude?: number;\n addressLine?: string;\n};\n\ntype TransactionAddressType = UserAddressType & {\n type: string;\n};\n\ntype ConsentRequestParamsType = {\n dialogTitle: string;\n dialogMessage: string;\n dialogAcceptText: string;\n dialogDenyText: string;\n consentTypes: Array<string>;\n};\n\nconst { IncogniaModule } = NativeModules;\n\nexport const setAccountId = IncogniaModule.setAccountId;\nexport const clearAccountId = IncogniaModule.clearAccountId;\nexport const trackEvent = IncogniaModule.trackEvent;\nexport const trackLocalizedEvent = IncogniaModule.trackLocalizedEvent;\nexport const requestPrivacyConsent = IncogniaModule.requestPrivacyConsent;\nexport const checkConsent = IncogniaModule.checkConsent;\nexport const allowConsentTypes = IncogniaModule.allowConsentTypes;\nexport const denyConsentTypes = IncogniaModule.denyConsentTypes;\nexport const fetchInstallationId = IncogniaModule.fetchInstallationId;\nexport const setLocationEnabled = IncogniaModule.setLocationEnabled;\nexport const generateRequestToken = IncogniaModule.generateRequestToken;\nexport const notifyAppInForeground = () => {\n if (Platform.OS === 'android') {\n IncogniaModule.notifyAppInForeground();\n }\n};\n\nexport const ConsentTypes: ConsentTypesType = {\n ADDRESS_VALIDATION: IncogniaModule.CONSENT_TYPE_ADDRESS_VALIDATION,\n ADVERTISEMENT: IncogniaModule.CONSENT_TYPE_ADVERTISEMENT,\n ENGAGE: IncogniaModule.CONSENT_TYPE_ENGAGE,\n EVENTS: IncogniaModule.CONSENT_TYPE_EVENTS,\n LOCATION: IncogniaModule.CONSENT_TYPE_LOCATION,\n CONTEXT_PROVIDER: IncogniaModule.CONSENT_TYPE_CONTEXT_PROVIDER,\n ALL: IncogniaModule.CONSENT_TYPES_ALL,\n NONE: IncogniaModule.CONSENT_TYPES_NONE,\n};\n\nexport const Trial: IncogniaTrialType = {\n trackSignupSent: IncogniaModule.trackSignupSent,\n trackLoginSucceeded: IncogniaModule.trackLoginSucceeded,\n trackPaymentSent: IncogniaModule.trackPaymentSent,\n TransactionAddressTypes: {\n BILLING: 'billing',\n HOME: 'home',\n SHIPPING: 'shipping',\n },\n};\n\nexport default {\n setAccountId,\n clearAccountId,\n trackEvent,\n trackLocalizedEvent,\n requestPrivacyConsent,\n checkConsent,\n allowConsentTypes,\n denyConsentTypes,\n fetchInstallationId,\n setLocationEnabled,\n notifyAppInForeground,\n generateRequestToken,\n Trial,\n ConsentTypes,\n} as IncogniaType;\n"]}
|
package/lib/module/index.js
CHANGED
|
@@ -12,6 +12,7 @@ export const allowConsentTypes = IncogniaModule.allowConsentTypes;
|
|
|
12
12
|
export const denyConsentTypes = IncogniaModule.denyConsentTypes;
|
|
13
13
|
export const fetchInstallationId = IncogniaModule.fetchInstallationId;
|
|
14
14
|
export const setLocationEnabled = IncogniaModule.setLocationEnabled;
|
|
15
|
+
export const generateRequestToken = IncogniaModule.generateRequestToken;
|
|
15
16
|
export const notifyAppInForeground = () => {
|
|
16
17
|
if (Platform.OS === 'android') {
|
|
17
18
|
IncogniaModule.notifyAppInForeground();
|
|
@@ -49,6 +50,7 @@ export default {
|
|
|
49
50
|
fetchInstallationId,
|
|
50
51
|
setLocationEnabled,
|
|
51
52
|
notifyAppInForeground,
|
|
53
|
+
generateRequestToken,
|
|
52
54
|
Trial,
|
|
53
55
|
ConsentTypes
|
|
54
56
|
};
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.tsx"],"names":["NativeModules","Platform","IncogniaModule","setAccountId","clearAccountId","trackEvent","trackLocalizedEvent","requestPrivacyConsent","checkConsent","allowConsentTypes","denyConsentTypes","fetchInstallationId","setLocationEnabled","notifyAppInForeground","OS","ConsentTypes","ADDRESS_VALIDATION","CONSENT_TYPE_ADDRESS_VALIDATION","ADVERTISEMENT","CONSENT_TYPE_ADVERTISEMENT","ENGAGE","CONSENT_TYPE_ENGAGE","EVENTS","CONSENT_TYPE_EVENTS","LOCATION","CONSENT_TYPE_LOCATION","CONTEXT_PROVIDER","CONSENT_TYPE_CONTEXT_PROVIDER","ALL","CONSENT_TYPES_ALL","NONE","CONSENT_TYPES_NONE","Trial","trackSignupSent","trackLoginSucceeded","trackPaymentSent","TransactionAddressTypes","BILLING","HOME","SHIPPING"],"mappings":"AAAA,SAASA,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;
|
|
1
|
+
{"version":3,"sources":["index.tsx"],"names":["NativeModules","Platform","IncogniaModule","setAccountId","clearAccountId","trackEvent","trackLocalizedEvent","requestPrivacyConsent","checkConsent","allowConsentTypes","denyConsentTypes","fetchInstallationId","setLocationEnabled","generateRequestToken","notifyAppInForeground","OS","ConsentTypes","ADDRESS_VALIDATION","CONSENT_TYPE_ADDRESS_VALIDATION","ADVERTISEMENT","CONSENT_TYPE_ADVERTISEMENT","ENGAGE","CONSENT_TYPE_ENGAGE","EVENTS","CONSENT_TYPE_EVENTS","LOCATION","CONSENT_TYPE_LOCATION","CONTEXT_PROVIDER","CONSENT_TYPE_CONTEXT_PROVIDER","ALL","CONSENT_TYPES_ALL","NONE","CONSENT_TYPES_NONE","Trial","trackSignupSent","trackLoginSucceeded","trackPaymentSent","TransactionAddressTypes","BILLING","HOME","SHIPPING"],"mappings":"AAAA,SAASA,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;AA8FA,MAAM;AAAEC,EAAAA;AAAF,IAAqBF,aAA3B;AAEA,OAAO,MAAMG,YAAY,GAAGD,cAAc,CAACC,YAApC;AACP,OAAO,MAAMC,cAAc,GAAGF,cAAc,CAACE,cAAtC;AACP,OAAO,MAAMC,UAAU,GAAGH,cAAc,CAACG,UAAlC;AACP,OAAO,MAAMC,mBAAmB,GAAGJ,cAAc,CAACI,mBAA3C;AACP,OAAO,MAAMC,qBAAqB,GAAGL,cAAc,CAACK,qBAA7C;AACP,OAAO,MAAMC,YAAY,GAAGN,cAAc,CAACM,YAApC;AACP,OAAO,MAAMC,iBAAiB,GAAGP,cAAc,CAACO,iBAAzC;AACP,OAAO,MAAMC,gBAAgB,GAAGR,cAAc,CAACQ,gBAAxC;AACP,OAAO,MAAMC,mBAAmB,GAAGT,cAAc,CAACS,mBAA3C;AACP,OAAO,MAAMC,kBAAkB,GAAGV,cAAc,CAACU,kBAA1C;AACP,OAAO,MAAMC,oBAAoB,GAAGX,cAAc,CAACW,oBAA5C;AACP,OAAO,MAAMC,qBAAqB,GAAG,MAAM;AACzC,MAAIb,QAAQ,CAACc,EAAT,KAAgB,SAApB,EAA+B;AAC7Bb,IAAAA,cAAc,CAACY,qBAAf;AACD;AACF,CAJM;AAMP,OAAO,MAAME,YAA8B,GAAG;AAC5CC,EAAAA,kBAAkB,EAAEf,cAAc,CAACgB,+BADS;AAE5CC,EAAAA,aAAa,EAAEjB,cAAc,CAACkB,0BAFc;AAG5CC,EAAAA,MAAM,EAAEnB,cAAc,CAACoB,mBAHqB;AAI5CC,EAAAA,MAAM,EAAErB,cAAc,CAACsB,mBAJqB;AAK5CC,EAAAA,QAAQ,EAAEvB,cAAc,CAACwB,qBALmB;AAM5CC,EAAAA,gBAAgB,EAAEzB,cAAc,CAAC0B,6BANW;AAO5CC,EAAAA,GAAG,EAAE3B,cAAc,CAAC4B,iBAPwB;AAQ5CC,EAAAA,IAAI,EAAE7B,cAAc,CAAC8B;AARuB,CAAvC;AAWP,OAAO,MAAMC,KAAwB,GAAG;AACtCC,EAAAA,eAAe,EAAEhC,cAAc,CAACgC,eADM;AAEtCC,EAAAA,mBAAmB,EAAEjC,cAAc,CAACiC,mBAFE;AAGtCC,EAAAA,gBAAgB,EAAElC,cAAc,CAACkC,gBAHK;AAItCC,EAAAA,uBAAuB,EAAE;AACvBC,IAAAA,OAAO,EAAE,SADc;AAEvBC,IAAAA,IAAI,EAAE,MAFiB;AAGvBC,IAAAA,QAAQ,EAAE;AAHa;AAJa,CAAjC;AAWP,eAAe;AACbrC,EAAAA,YADa;AAEbC,EAAAA,cAFa;AAGbC,EAAAA,UAHa;AAIbC,EAAAA,mBAJa;AAKbC,EAAAA,qBALa;AAMbC,EAAAA,YANa;AAObC,EAAAA,iBAPa;AAQbC,EAAAA,gBARa;AASbC,EAAAA,mBATa;AAUbC,EAAAA,kBAVa;AAWbE,EAAAA,qBAXa;AAYbD,EAAAA,oBAZa;AAaboB,EAAAA,KAba;AAcbjB,EAAAA;AAda,CAAf","sourcesContent":["import { NativeModules, Platform } from 'react-native';\n\ntype IncogniaType = {\n setAccountId(accountId: string): void;\n clearAccountId(): void;\n trackEvent(params: TrackEventParamsType): void;\n trackLocalizedEvent(params: TrackEventParamsType): void;\n requestPrivacyConsent(params: ConsentRequestParamsType): Promise<any>;\n checkConsent(consentTypes: Array<string>): Promise<any>;\n allowConsentTypes(consentTypes: Array<string>): void;\n denyConsentTypes(consentTypes: Array<string>): void;\n fetchInstallationId(): Promise<string>;\n setLocationEnabled(enabled: boolean): void;\n notifyAppInForeground(): void;\n generateRequestToken(): Promise<string>;\n ConsentTypes: ConsentTypesType;\n Trial: IncogniaTrialType;\n};\n\ntype IncogniaTrialType = {\n trackSignupSent(params: TrackSignupParamsType): void;\n trackLoginSucceeded(params: TrackLoginSucceededParamsType): void;\n trackPaymentSent(params: TrackPaymentParamsType): void;\n TransactionAddressTypes: TranscationAddressTypesType;\n};\n\ntype ConsentTypesType = {\n readonly ADDRESS_VALIDATION: string;\n readonly ADVERTISEMENT: string;\n readonly ENGAGE: string;\n readonly EVENTS: string;\n readonly LOCATION: string;\n readonly CONTEXT_PROVIDER: string;\n readonly ALL: Array<string>;\n readonly NONE: Array<string>;\n};\n\ntype TranscationAddressTypesType = {\n readonly BILLING: string;\n readonly SHIPPING: string;\n readonly HOME: string;\n};\n\ntype TrackEventParamsType = {\n eventName: string;\n eventProperties?: Object;\n};\n\ntype TrackSignupParamsType = {\n signupId?: string;\n signupAddress?: UserAddressType;\n properties?: Object;\n};\n\ntype TrackLoginSucceededParamsType = {\n loginId?: string;\n accountId?: string;\n properties?: Object;\n};\n\ntype TrackPaymentParamsType = {\n transactionId?: string;\n transactionAddresses?: Array<TransactionAddressType>;\n properties?: Object;\n};\n\ntype UserAddressType = {\n locale?: string;\n countryName?: string;\n countryCode?: string;\n adminArea?: string;\n subAdminArea?: string;\n locality?: string;\n subLocality?: string;\n thoroughfare?: string;\n subThoroughfare?: string;\n postalCode?: string;\n latitude?: number;\n longitude?: number;\n addressLine?: string;\n};\n\ntype TransactionAddressType = UserAddressType & {\n type: string;\n};\n\ntype ConsentRequestParamsType = {\n dialogTitle: string;\n dialogMessage: string;\n dialogAcceptText: string;\n dialogDenyText: string;\n consentTypes: Array<string>;\n};\n\nconst { IncogniaModule } = NativeModules;\n\nexport const setAccountId = IncogniaModule.setAccountId;\nexport const clearAccountId = IncogniaModule.clearAccountId;\nexport const trackEvent = IncogniaModule.trackEvent;\nexport const trackLocalizedEvent = IncogniaModule.trackLocalizedEvent;\nexport const requestPrivacyConsent = IncogniaModule.requestPrivacyConsent;\nexport const checkConsent = IncogniaModule.checkConsent;\nexport const allowConsentTypes = IncogniaModule.allowConsentTypes;\nexport const denyConsentTypes = IncogniaModule.denyConsentTypes;\nexport const fetchInstallationId = IncogniaModule.fetchInstallationId;\nexport const setLocationEnabled = IncogniaModule.setLocationEnabled;\nexport const generateRequestToken = IncogniaModule.generateRequestToken;\nexport const notifyAppInForeground = () => {\n if (Platform.OS === 'android') {\n IncogniaModule.notifyAppInForeground();\n }\n};\n\nexport const ConsentTypes: ConsentTypesType = {\n ADDRESS_VALIDATION: IncogniaModule.CONSENT_TYPE_ADDRESS_VALIDATION,\n ADVERTISEMENT: IncogniaModule.CONSENT_TYPE_ADVERTISEMENT,\n ENGAGE: IncogniaModule.CONSENT_TYPE_ENGAGE,\n EVENTS: IncogniaModule.CONSENT_TYPE_EVENTS,\n LOCATION: IncogniaModule.CONSENT_TYPE_LOCATION,\n CONTEXT_PROVIDER: IncogniaModule.CONSENT_TYPE_CONTEXT_PROVIDER,\n ALL: IncogniaModule.CONSENT_TYPES_ALL,\n NONE: IncogniaModule.CONSENT_TYPES_NONE,\n};\n\nexport const Trial: IncogniaTrialType = {\n trackSignupSent: IncogniaModule.trackSignupSent,\n trackLoginSucceeded: IncogniaModule.trackLoginSucceeded,\n trackPaymentSent: IncogniaModule.trackPaymentSent,\n TransactionAddressTypes: {\n BILLING: 'billing',\n HOME: 'home',\n SHIPPING: 'shipping',\n },\n};\n\nexport default {\n setAccountId,\n clearAccountId,\n trackEvent,\n trackLocalizedEvent,\n requestPrivacyConsent,\n checkConsent,\n allowConsentTypes,\n denyConsentTypes,\n fetchInstallationId,\n setLocationEnabled,\n notifyAppInForeground,\n generateRequestToken,\n Trial,\n ConsentTypes,\n} as IncogniaType;\n"]}
|
|
@@ -10,6 +10,7 @@ declare type IncogniaType = {
|
|
|
10
10
|
fetchInstallationId(): Promise<string>;
|
|
11
11
|
setLocationEnabled(enabled: boolean): void;
|
|
12
12
|
notifyAppInForeground(): void;
|
|
13
|
+
generateRequestToken(): Promise<string>;
|
|
13
14
|
ConsentTypes: ConsentTypesType;
|
|
14
15
|
Trial: IncogniaTrialType;
|
|
15
16
|
};
|
|
@@ -88,6 +89,7 @@ export declare const allowConsentTypes: any;
|
|
|
88
89
|
export declare const denyConsentTypes: any;
|
|
89
90
|
export declare const fetchInstallationId: any;
|
|
90
91
|
export declare const setLocationEnabled: any;
|
|
92
|
+
export declare const generateRequestToken: any;
|
|
91
93
|
export declare const notifyAppInForeground: () => void;
|
|
92
94
|
export declare const ConsentTypes: ConsentTypesType;
|
|
93
95
|
export declare const Trial: IncogniaTrialType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-incognia",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.19.0",
|
|
4
4
|
"description": "Incognia React Native Library",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
28
28
|
"prepare": "bob build",
|
|
29
29
|
"release": "release-it --no-increment",
|
|
30
|
-
"example": "yarn --cwd example",
|
|
30
|
+
"example": "export SET NODE_OPTIONS=--openssl-legacy-provider && yarn --cwd example",
|
|
31
31
|
"pods": "cd example && pod-install --quiet",
|
|
32
32
|
"bootstrap": "yarn example && yarn && yarn pods"
|
|
33
33
|
},
|
|
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
s.source_files = "ios/**/*.{h,m,mm}"
|
|
17
17
|
|
|
18
18
|
s.dependency "React-Core"
|
|
19
|
-
s.dependency 'IncogniaTrialBR', '~> 6.
|
|
20
|
-
s.dependency 'IncogniaBR', '~> 6.
|
|
21
|
-
s.dependency 'IncogniaCoreBR', '~> 6.
|
|
19
|
+
s.dependency 'IncogniaTrialBR', '~> 6.17.0'
|
|
20
|
+
s.dependency 'IncogniaBR', '~> 6.17.0'
|
|
21
|
+
s.dependency 'IncogniaCoreBR', '~> 6.17.0'
|
|
22
22
|
end
|
package/src/index.tsx
CHANGED
|
@@ -12,6 +12,7 @@ type IncogniaType = {
|
|
|
12
12
|
fetchInstallationId(): Promise<string>;
|
|
13
13
|
setLocationEnabled(enabled: boolean): void;
|
|
14
14
|
notifyAppInForeground(): void;
|
|
15
|
+
generateRequestToken(): Promise<string>;
|
|
15
16
|
ConsentTypes: ConsentTypesType;
|
|
16
17
|
Trial: IncogniaTrialType;
|
|
17
18
|
};
|
|
@@ -103,6 +104,7 @@ export const allowConsentTypes = IncogniaModule.allowConsentTypes;
|
|
|
103
104
|
export const denyConsentTypes = IncogniaModule.denyConsentTypes;
|
|
104
105
|
export const fetchInstallationId = IncogniaModule.fetchInstallationId;
|
|
105
106
|
export const setLocationEnabled = IncogniaModule.setLocationEnabled;
|
|
107
|
+
export const generateRequestToken = IncogniaModule.generateRequestToken;
|
|
106
108
|
export const notifyAppInForeground = () => {
|
|
107
109
|
if (Platform.OS === 'android') {
|
|
108
110
|
IncogniaModule.notifyAppInForeground();
|
|
@@ -143,6 +145,7 @@ export default {
|
|
|
143
145
|
fetchInstallationId,
|
|
144
146
|
setLocationEnabled,
|
|
145
147
|
notifyAppInForeground,
|
|
148
|
+
generateRequestToken,
|
|
146
149
|
Trial,
|
|
147
150
|
ConsentTypes,
|
|
148
151
|
} as IncogniaType;
|