react-native-salespanda 0.4.0 → 0.4.1
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.
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { NativeModules, Platform } from 'react-native';
|
|
4
|
+
/**
|
|
5
|
+
* Get the current flavor configuration
|
|
6
|
+
* This reads from native build config on Android
|
|
7
|
+
* On iOS, you'll need to configure schemes and xcconfig files
|
|
8
|
+
*/
|
|
9
|
+
export const getFlavorConfig = () => {
|
|
10
|
+
if (Platform.OS === 'android') {
|
|
11
|
+
const {
|
|
12
|
+
BuildConfig
|
|
13
|
+
} = NativeModules;
|
|
14
|
+
if (BuildConfig) {
|
|
15
|
+
return {
|
|
16
|
+
appName: BuildConfig.APP_NAME || 'Salespanda',
|
|
17
|
+
applicationId: BuildConfig.APPLICATION_ID || 'com.salespanda.app',
|
|
18
|
+
host: BuildConfig.HOST || '',
|
|
19
|
+
clevertapAccountId: BuildConfig.CLEVERTAP_ACCOUNT_ID || '',
|
|
20
|
+
clevertapToken: BuildConfig.CLEVERTAP_TOKEN || '',
|
|
21
|
+
twScheme: BuildConfig.TWSCHEME || '',
|
|
22
|
+
fileProviderAuthority: BuildConfig.FILE_PROVIDER_AUTHORITY || '',
|
|
23
|
+
freshchatFileProviderAuthority: BuildConfig.FRESHCHAT_FILE_PROVIDER_AUTHORITY || '',
|
|
24
|
+
defaultNotificationChannelId: BuildConfig.DEFAULT_NOTIFICATION_CHANNEL_ID || ''
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Default configuration for iOS or if BuildConfig is not available
|
|
30
|
+
return {
|
|
31
|
+
appName: 'Salespanda',
|
|
32
|
+
applicationId: 'com.salespanda.app',
|
|
33
|
+
host: '',
|
|
34
|
+
clevertapAccountId: '',
|
|
35
|
+
clevertapToken: '',
|
|
36
|
+
twScheme: '',
|
|
37
|
+
fileProviderAuthority: '',
|
|
38
|
+
freshchatFileProviderAuthority: '',
|
|
39
|
+
defaultNotificationChannelId: ''
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export default getFlavorConfig();
|
|
43
|
+
//# sourceMappingURL=FlavorConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","getFlavorConfig","OS","BuildConfig","appName","APP_NAME","applicationId","APPLICATION_ID","host","HOST","clevertapAccountId","CLEVERTAP_ACCOUNT_ID","clevertapToken","CLEVERTAP_TOKEN","twScheme","TWSCHEME","fileProviderAuthority","FILE_PROVIDER_AUTHORITY","freshchatFileProviderAuthority","FRESHCHAT_FILE_PROVIDER_AUTHORITY","defaultNotificationChannelId","DEFAULT_NOTIFICATION_CHANNEL_ID"],"sourceRoot":"../../../src","sources":["config/FlavorConfig.ts"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AActD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAoB;EACjD,IAAID,QAAQ,CAACE,EAAE,KAAK,SAAS,EAAE;IAC7B,MAAM;MAAEC;IAAY,CAAC,GAAGJ,aAAa;IAErC,IAAII,WAAW,EAAE;MACf,OAAO;QACLC,OAAO,EAAED,WAAW,CAACE,QAAQ,IAAI,YAAY;QAC7CC,aAAa,EAAEH,WAAW,CAACI,cAAc,IAAI,oBAAoB;QACjEC,IAAI,EAAEL,WAAW,CAACM,IAAI,IAAI,EAAE;QAC5BC,kBAAkB,EAAEP,WAAW,CAACQ,oBAAoB,IAAI,EAAE;QAC1DC,cAAc,EAAET,WAAW,CAACU,eAAe,IAAI,EAAE;QACjDC,QAAQ,EAAEX,WAAW,CAACY,QAAQ,IAAI,EAAE;QACpCC,qBAAqB,EAAEb,WAAW,CAACc,uBAAuB,IAAI,EAAE;QAChEC,8BAA8B,EAAEf,WAAW,CAACgB,iCAAiC,IAAI,EAAE;QACnFC,4BAA4B,EAAEjB,WAAW,CAACkB,+BAA+B,IAAI;MAC/E,CAAC;IACH;EACF;;EAEA;EACA,OAAO;IACLjB,OAAO,EAAE,YAAY;IACrBE,aAAa,EAAE,oBAAoB;IACnCE,IAAI,EAAE,EAAE;IACRE,kBAAkB,EAAE,EAAE;IACtBE,cAAc,EAAE,EAAE;IAClBE,QAAQ,EAAE,EAAE;IACZE,qBAAqB,EAAE,EAAE;IACzBE,8BAA8B,EAAE,EAAE;IAClCE,4BAA4B,EAAE;EAChC,CAAC;AACH,CAAC;AAED,eAAenB,eAAe,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface FlavorConfig {
|
|
2
|
+
appName: string;
|
|
3
|
+
applicationId: string;
|
|
4
|
+
host: string;
|
|
5
|
+
clevertapAccountId: string;
|
|
6
|
+
clevertapToken: string;
|
|
7
|
+
twScheme: string;
|
|
8
|
+
fileProviderAuthority: string;
|
|
9
|
+
freshchatFileProviderAuthority: string;
|
|
10
|
+
defaultNotificationChannelId: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get the current flavor configuration
|
|
14
|
+
* This reads from native build config on Android
|
|
15
|
+
* On iOS, you'll need to configure schemes and xcconfig files
|
|
16
|
+
*/
|
|
17
|
+
export declare const getFlavorConfig: () => FlavorConfig;
|
|
18
|
+
declare const _default: FlavorConfig;
|
|
19
|
+
export default _default;
|
|
20
|
+
//# sourceMappingURL=FlavorConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlavorConfig.d.ts","sourceRoot":"","sources":["../../../../src/config/FlavorConfig.ts"],"names":[],"mappings":"AAEA,UAAU,YAAY;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,8BAA8B,EAAE,MAAM,CAAC;IACvC,4BAA4B,EAAE,MAAM,CAAC;CACtC;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,QAAO,YA+BlC,CAAC;;AAEF,wBAAiC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
interface FlavorConfig {
|
|
4
|
+
appName: string;
|
|
5
|
+
applicationId: string;
|
|
6
|
+
host: string;
|
|
7
|
+
clevertapAccountId: string;
|
|
8
|
+
clevertapToken: string;
|
|
9
|
+
twScheme: string;
|
|
10
|
+
fileProviderAuthority: string;
|
|
11
|
+
freshchatFileProviderAuthority: string;
|
|
12
|
+
defaultNotificationChannelId: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Get the current flavor configuration
|
|
17
|
+
* This reads from native build config on Android
|
|
18
|
+
* On iOS, you'll need to configure schemes and xcconfig files
|
|
19
|
+
*/
|
|
20
|
+
export const getFlavorConfig = (): FlavorConfig => {
|
|
21
|
+
if (Platform.OS === 'android') {
|
|
22
|
+
const { BuildConfig } = NativeModules;
|
|
23
|
+
|
|
24
|
+
if (BuildConfig) {
|
|
25
|
+
return {
|
|
26
|
+
appName: BuildConfig.APP_NAME || 'Salespanda',
|
|
27
|
+
applicationId: BuildConfig.APPLICATION_ID || 'com.salespanda.app',
|
|
28
|
+
host: BuildConfig.HOST || '',
|
|
29
|
+
clevertapAccountId: BuildConfig.CLEVERTAP_ACCOUNT_ID || '',
|
|
30
|
+
clevertapToken: BuildConfig.CLEVERTAP_TOKEN || '',
|
|
31
|
+
twScheme: BuildConfig.TWSCHEME || '',
|
|
32
|
+
fileProviderAuthority: BuildConfig.FILE_PROVIDER_AUTHORITY || '',
|
|
33
|
+
freshchatFileProviderAuthority: BuildConfig.FRESHCHAT_FILE_PROVIDER_AUTHORITY || '',
|
|
34
|
+
defaultNotificationChannelId: BuildConfig.DEFAULT_NOTIFICATION_CHANNEL_ID || '',
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Default configuration for iOS or if BuildConfig is not available
|
|
40
|
+
return {
|
|
41
|
+
appName: 'Salespanda',
|
|
42
|
+
applicationId: 'com.salespanda.app',
|
|
43
|
+
host: '',
|
|
44
|
+
clevertapAccountId: '',
|
|
45
|
+
clevertapToken: '',
|
|
46
|
+
twScheme: '',
|
|
47
|
+
fileProviderAuthority: '',
|
|
48
|
+
freshchatFileProviderAuthority: '',
|
|
49
|
+
defaultNotificationChannelId: '',
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default getFlavorConfig();
|