@developer_tribe/react-native-comnyx 0.7.6 → 0.8.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 +12 -6
- package/android/generated/RCTAppDependencyProvider.h +25 -0
- package/android/generated/RCTAppDependencyProvider.mm +55 -0
- package/android/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/android/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/android/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/android/generated/RCTThirdPartyComponentsProvider.mm +23 -0
- package/android/generated/ReactAppDependencyProvider.podspec +34 -0
- package/android/generated/jni/RNComnyxSpec-generated.cpp +1 -11
- package/android/generated/jni/RNComnyxSpec.h +0 -7
- package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI-generated.cpp +0 -11
- package/android/generated/jni/react/renderer/components/RNComnyxSpec/RNComnyxSpecJSI.h +0 -52
- package/android/src/main/java/com/comnyx/ComnyxModule.kt +75 -7
- package/android/src/main/java/com/comnyx/ComnyxPackage.kt +0 -3
- package/android/src/main/java/com/comnyx/src/messaging/firebase/FirebaseMessagingService.kt +1 -9
- package/android/src/main/java/com/comnyx/src/messaging/notifications/NotificationsService.kt +105 -8
- package/ios/Comnyx.m +2 -2
- package/ios/Comnyx.swift +83 -20
- package/ios/generated/RCTAppDependencyProvider.h +25 -0
- package/ios/generated/RCTAppDependencyProvider.mm +55 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.mm +23 -0
- package/ios/generated/RNComnyxSpec/RNComnyxSpec-generated.mm +0 -23
- package/ios/generated/RNComnyxSpec/RNComnyxSpec.h +0 -25
- package/ios/generated/RNComnyxSpecJSI-generated.cpp +0 -11
- package/ios/generated/RNComnyxSpecJSI.h +0 -52
- package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
- package/lib/commonjs/NativeComnyx.js.map +1 -1
- package/lib/commonjs/api/api.js +4 -0
- package/lib/commonjs/api/api.js.map +1 -1
- package/lib/commonjs/components/ChatList.js +100 -106
- package/lib/commonjs/components/ChatList.js.map +1 -1
- package/lib/commonjs/components/CustomerForm.js +173 -179
- package/lib/commonjs/components/CustomerForm.js.map +1 -1
- package/lib/commonjs/components/EmptyList.js +5 -7
- package/lib/commonjs/components/EmptyList.js.map +1 -1
- package/lib/commonjs/constants/translations.js +145 -29
- package/lib/commonjs/constants/translations.js.map +1 -1
- package/lib/commonjs/hooks/useLocalize.js +7 -0
- package/lib/commonjs/hooks/useLocalize.js.map +1 -1
- package/lib/commonjs/notifications/index.js +2 -1
- package/lib/commonjs/notifications/index.js.map +1 -1
- package/lib/commonjs/notifications/initializeNotifications.js +137 -0
- package/lib/commonjs/notifications/initializeNotifications.js.map +1 -0
- package/lib/commonjs/register/login.js +1 -1
- package/lib/commonjs/register/login.js.map +1 -1
- package/lib/commonjs/store/store.js +14 -1
- package/lib/commonjs/store/store.js.map +1 -1
- package/lib/module/NativeComnyx.js.map +1 -1
- package/lib/module/api/api.js +3 -0
- package/lib/module/api/api.js.map +1 -1
- package/lib/module/components/ChatList.js +101 -107
- package/lib/module/components/ChatList.js.map +1 -1
- package/lib/module/components/CustomerForm.js +174 -180
- package/lib/module/components/CustomerForm.js.map +1 -1
- package/lib/module/components/EmptyList.js +6 -8
- package/lib/module/components/EmptyList.js.map +1 -1
- package/lib/module/constants/translations.js +145 -29
- package/lib/module/constants/translations.js.map +1 -1
- package/lib/module/hooks/useLocalize.js +6 -0
- package/lib/module/hooks/useLocalize.js.map +1 -1
- package/lib/module/notifications/index.js +2 -1
- package/lib/module/notifications/index.js.map +1 -1
- package/lib/module/notifications/initializeNotifications.js +133 -0
- package/lib/module/notifications/initializeNotifications.js.map +1 -0
- package/lib/module/register/login.js +1 -1
- package/lib/module/register/login.js.map +1 -1
- package/lib/module/store/store.js +14 -1
- package/lib/module/store/store.js.map +1 -1
- package/lib/typescript/src/NativeComnyx.d.ts +6 -1
- package/lib/typescript/src/NativeComnyx.d.ts.map +1 -1
- package/lib/typescript/src/api/api.d.ts +1 -0
- package/lib/typescript/src/api/api.d.ts.map +1 -1
- package/lib/typescript/src/components/ChatList.d.ts.map +1 -1
- package/lib/typescript/src/components/CustomerForm.d.ts.map +1 -1
- package/lib/typescript/src/components/EmptyList.d.ts.map +1 -1
- package/lib/typescript/src/constants/translations.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useLocalize.d.ts +1 -0
- package/lib/typescript/src/hooks/useLocalize.d.ts.map +1 -1
- package/lib/typescript/src/notifications/index.d.ts +63 -4
- package/lib/typescript/src/notifications/index.d.ts.map +1 -1
- package/lib/typescript/src/notifications/initializeNotifications.d.ts +7 -0
- package/lib/typescript/src/notifications/initializeNotifications.d.ts.map +1 -0
- package/lib/typescript/src/store/store.d.ts +4 -0
- package/lib/typescript/src/store/store.d.ts.map +1 -1
- package/lib/typescript/src/types/Customer.d.ts +5 -0
- package/lib/typescript/src/types/Customer.d.ts.map +1 -1
- package/lib/typescript/src/types/LocalizationKeys.d.ts +4 -0
- package/lib/typescript/src/types/LocalizationKeys.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/NativeComnyx.ts +6 -1
- package/src/api/api.ts +4 -0
- package/src/components/ChatList.tsx +110 -123
- package/src/components/CustomerForm.tsx +194 -212
- package/src/components/EmptyList.tsx +3 -10
- package/src/constants/translations.ts +145 -0
- package/src/hooks/useLocalize.ts +6 -0
- package/src/notifications/index.ts +69 -5
- package/src/notifications/initializeNotifications.ts +180 -0
- package/src/register/login.ts +1 -1
- package/src/store/store.ts +13 -0
- package/src/types/Customer.ts +5 -0
- package/src/types/LocalizationKeys.ts +4 -0
- package/android/generated/java/com/comnyx/NativeComnyxSpec.java +0 -37
- package/lib/typescript/setup-jest.d.ts +0 -1
- package/lib/typescript/setup-jest.d.ts.map +0 -1
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Alert, AppState, Platform } from 'react-native';
|
|
4
|
+
import { ComnyxNotifications } from "./index.js";
|
|
5
|
+
import { nativeComnyx, NotificationPermissionStatus } from "../NativeComnyx.js";
|
|
6
|
+
import { useAppStore } from "../store/store.js";
|
|
7
|
+
import { isInitCalled, isLoginCalled } from "../api/api.js";
|
|
8
|
+
import { localize } from "../hooks/useLocalize.js";
|
|
9
|
+
import { accumulator } from "../register/Accumulator.js";
|
|
10
|
+
let globalSubscriptions = {
|
|
11
|
+
subscriptionsForNotification: [],
|
|
12
|
+
subscriptionsForOptIn: null
|
|
13
|
+
};
|
|
14
|
+
function showAlertDialog() {
|
|
15
|
+
Alert.alert(localize('notifications.optIn.title'), localize('notifications.optIn.description'), [{
|
|
16
|
+
text: localize('notifications.optIn.cancel'),
|
|
17
|
+
style: 'cancel'
|
|
18
|
+
}, {
|
|
19
|
+
text: localize('notifications.optIn.openSettings'),
|
|
20
|
+
onPress: () => {
|
|
21
|
+
ComnyxNotifications.linkToSettings();
|
|
22
|
+
}
|
|
23
|
+
}]);
|
|
24
|
+
}
|
|
25
|
+
function changePermissionStatus(status) {
|
|
26
|
+
const state = useAppStore.getState();
|
|
27
|
+
if (status === NotificationPermissionStatus.GRANTED) {
|
|
28
|
+
state.setPermissionGiven(true);
|
|
29
|
+
accumulator.add({
|
|
30
|
+
allow_notifications: true
|
|
31
|
+
});
|
|
32
|
+
} else {
|
|
33
|
+
state.setPermissionGiven(false);
|
|
34
|
+
accumulator.add({
|
|
35
|
+
allow_notifications: false
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async function initializeNativeNotifications() {
|
|
40
|
+
const state = useAppStore.getState();
|
|
41
|
+
return await nativeComnyx.initialize().then(res => {
|
|
42
|
+
state.setNotificationInitialized(true);
|
|
43
|
+
if (res.success) {
|
|
44
|
+
accumulator.add({
|
|
45
|
+
country: res.country,
|
|
46
|
+
language: res.language,
|
|
47
|
+
//ComnyxSupport burayı override ediyor!.
|
|
48
|
+
timezone: res.timezone
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return res.success;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
export async function initializeNotifications(params = {}) {
|
|
55
|
+
const state = useAppStore.getState();
|
|
56
|
+
if (!isInitCalled()) {
|
|
57
|
+
throw new Error('Please initialize the Comnyx SDK first');
|
|
58
|
+
}
|
|
59
|
+
if (!isLoginCalled()) {
|
|
60
|
+
throw new Error('Please call login first');
|
|
61
|
+
}
|
|
62
|
+
let result = false;
|
|
63
|
+
if (globalSubscriptions.subscriptionsForNotification.length > 0) {
|
|
64
|
+
globalSubscriptions.subscriptionsForNotification.forEach(subscription => subscription.remove());
|
|
65
|
+
}
|
|
66
|
+
if (globalSubscriptions.subscriptionsForOptIn) {
|
|
67
|
+
globalSubscriptions.subscriptionsForOptIn.remove();
|
|
68
|
+
}
|
|
69
|
+
const permissionResult = await ComnyxNotifications.checkOptIn();
|
|
70
|
+
changePermissionStatus(permissionResult);
|
|
71
|
+
if (permissionResult === NotificationPermissionStatus.GRANTED) {
|
|
72
|
+
result = await initializeNativeNotifications();
|
|
73
|
+
} else {
|
|
74
|
+
if (params.showOptIn) {
|
|
75
|
+
if (permissionResult === NotificationPermissionStatus.DENIED) {
|
|
76
|
+
const permissionResultAfterDenied = await ComnyxNotifications.optIn();
|
|
77
|
+
if (permissionResultAfterDenied === NotificationPermissionStatus.GRANTED) {} else if (permissionResultAfterDenied === NotificationPermissionStatus.BLOCKED) {
|
|
78
|
+
if (params.linkToSettings) {
|
|
79
|
+
showAlertDialog();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
} else if (permissionResult === NotificationPermissionStatus.BLOCKED) {
|
|
83
|
+
if (params.linkToSettings) {
|
|
84
|
+
showAlertDialog();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
globalSubscriptions.subscriptionsForOptIn = AppState.addEventListener('change', async nextAppState => {
|
|
90
|
+
if (nextAppState === 'active') {
|
|
91
|
+
const permissionGivenInForeground = (await ComnyxNotifications.checkOptIn()) === NotificationPermissionStatus.GRANTED;
|
|
92
|
+
if (permissionGivenInForeground) {
|
|
93
|
+
state.setPermissionGiven(true);
|
|
94
|
+
if (!state.notificationInitialized) {
|
|
95
|
+
await ComnyxNotifications.initialize().then(() => {
|
|
96
|
+
state.setNotificationInitialized(true);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
} else {
|
|
100
|
+
if (params.showOptInOnForeground) {
|
|
101
|
+
ComnyxNotifications.optIn().then(async permissionResultInner => {
|
|
102
|
+
changePermissionStatus(permissionResultInner);
|
|
103
|
+
if (permissionResultInner === NotificationPermissionStatus.GRANTED) {
|
|
104
|
+
await initializeNativeNotifications();
|
|
105
|
+
} else if (permissionResultInner === NotificationPermissionStatus.BLOCKED) {
|
|
106
|
+
if (params.linkToSettings) {
|
|
107
|
+
showAlertDialog();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
globalSubscriptions.subscriptionsForNotification = [ComnyxNotifications.addEventListener('TOKEN_INIT', data => {
|
|
116
|
+
if (Platform.OS === 'ios') {
|
|
117
|
+
accumulator.add({
|
|
118
|
+
apnsToken: data.token,
|
|
119
|
+
platform: 'ios'
|
|
120
|
+
});
|
|
121
|
+
} else if (Platform.OS === 'android') {
|
|
122
|
+
accumulator.add({
|
|
123
|
+
fcmToken: data.token,
|
|
124
|
+
platform: 'android'
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}), ComnyxNotifications.addEventListener('TOKEN_FAILED', data => {
|
|
128
|
+
//TODO: logger
|
|
129
|
+
console.error('TOKEN_FAILED', data);
|
|
130
|
+
})];
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=initializeNotifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Alert","AppState","Platform","ComnyxNotifications","nativeComnyx","NotificationPermissionStatus","useAppStore","isInitCalled","isLoginCalled","localize","accumulator","globalSubscriptions","subscriptionsForNotification","subscriptionsForOptIn","showAlertDialog","alert","text","style","onPress","linkToSettings","changePermissionStatus","status","state","getState","GRANTED","setPermissionGiven","add","allow_notifications","initializeNativeNotifications","initialize","then","res","setNotificationInitialized","success","country","language","timezone","initializeNotifications","params","Error","result","length","forEach","subscription","remove","permissionResult","checkOptIn","showOptIn","DENIED","permissionResultAfterDenied","optIn","BLOCKED","addEventListener","nextAppState","permissionGivenInForeground","notificationInitialized","showOptInOnForeground","permissionResultInner","data","OS","apnsToken","token","platform","fcmToken","console","error"],"sourceRoot":"../../../src","sources":["notifications/initializeNotifications.ts"],"mappings":";;AAAA,SACEA,KAAK,EACLC,QAAQ,EAGRC,QAAQ,QACH,cAAc;AACrB,SAASC,mBAAmB,QAAQ,YAAG;AACvC,SAASC,YAAY,EAAEC,4BAA4B,QAAQ,oBAAiB;AAC5E,SAASC,WAAW,QAAQ,mBAAgB;AAC5C,SAASC,YAAY,EAAEC,aAAa,QAAQ,eAAY;AACxD,SAASC,QAAQ,QAAQ,yBAAsB;AAC/C,SAASC,WAAW,QAAQ,4BAAyB;AAErD,IAAIC,mBAAmB,GAAG;EACxBC,4BAA4B,EAAE,EAA2B;EACzDC,qBAAqB,EAAE;AACzB,CAAC;AAQD,SAASC,eAAeA,CAAA,EAAG;EACzBd,KAAK,CAACe,KAAK,CACTN,QAAQ,CAAC,2BAA2B,CAAC,EACrCA,QAAQ,CAAC,iCAAiC,CAAC,EAC3C,CACE;IACEO,IAAI,EAAEP,QAAQ,CAAC,4BAA4B,CAAC;IAC5CQ,KAAK,EAAE;EACT,CAAC,EACD;IACED,IAAI,EAAEP,QAAQ,CAAC,kCAAkC,CAAC;IAClDS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D,EAAE,KAAK,SAAS,EAAE;MACpCjD,WAAW,CAACgB,GAAG,CAAC;QACdqC,QAAQ,EAAEL,IAAI,CAACG,KAAK;QACpBC,QAAQ,EAAE;MACZ,CAAC,CAAC;IACJ;EACF,CAAC,CAAC,EACF3D,mBAAmB,CAACiD,gBAAgB,CAAC,cAAc,EAAGM,IAAI,IAAK;IAC7D;IACAM,OAAO,CAACC,KAAK,CAAC,cAAc,EAAEP,IAAI,CAAC;EACrC,CAAC,CAAC,CACH;EACD,OAAOlB,MAAM;AACf","ignoreList":[]}
|
|
@@ -11,10 +11,10 @@ export function login(loginOptions) {
|
|
|
11
11
|
if (!loginOptions.externalId) {
|
|
12
12
|
throw new Error('External ID is required for initialization');
|
|
13
13
|
}
|
|
14
|
+
setLoginForAxios(loginOptions.externalId);
|
|
14
15
|
accumulator.clear();
|
|
15
16
|
accumulator.register(async accumulatedData => {
|
|
16
17
|
const data = await updateCustomer(accumulatedData, loginOptions.externalId);
|
|
17
|
-
setLoginForAxios(loginOptions.externalId);
|
|
18
18
|
useAppStore.getState().setCustomer(data.customer);
|
|
19
19
|
});
|
|
20
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["accumulator","isInitCalled","setLoginForAxios","useAppStore","updateCustomer","login","loginOptions","Error","externalId","clear","register","accumulatedData","data","getState","setCustomer","customer"],"sourceRoot":"../../../src","sources":["register/login.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,kBAAe;AAC3C,SAASC,YAAY,EAAEC,gBAAgB,QAAQ,eAAY;AAE3D,SAASC,WAAW,QAAQ,mBAAgB;AAC5C,SAASC,cAAc,QAAQ,qBAAkB;AAMjD,OAAO,SAASC,KAAKA,CAACC,YAA0B,EAAE;EAChD,IAAI,CAACL,YAAY,CAAC,CAAC,EAAE;IACnB,MAAM,IAAIM,KAAK,CAAC,wCAAwC,CAAC;EAC3D;EACA,IAAI,CAACD,YAAY,CAACE,UAAU,EAAE;IAC5B,MAAM,IAAID,KAAK,CAAC,4CAA4C,CAAC;EAC/D;
|
|
1
|
+
{"version":3,"names":["accumulator","isInitCalled","setLoginForAxios","useAppStore","updateCustomer","login","loginOptions","Error","externalId","clear","register","accumulatedData","data","getState","setCustomer","customer"],"sourceRoot":"../../../src","sources":["register/login.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,kBAAe;AAC3C,SAASC,YAAY,EAAEC,gBAAgB,QAAQ,eAAY;AAE3D,SAASC,WAAW,QAAQ,mBAAgB;AAC5C,SAASC,cAAc,QAAQ,qBAAkB;AAMjD,OAAO,SAASC,KAAKA,CAACC,YAA0B,EAAE;EAChD,IAAI,CAACL,YAAY,CAAC,CAAC,EAAE;IACnB,MAAM,IAAIM,KAAK,CAAC,wCAAwC,CAAC;EAC3D;EACA,IAAI,CAACD,YAAY,CAACE,UAAU,EAAE;IAC5B,MAAM,IAAID,KAAK,CAAC,4CAA4C,CAAC;EAC/D;EACAL,gBAAgB,CAACI,YAAY,CAACE,UAAU,CAAC;EACzCR,WAAW,CAACS,KAAK,CAAC,CAAC;EACnBT,WAAW,CAACU,QAAQ,CAAC,MAAOC,eAAsC,IAAK;IACrE,MAAMC,IAAI,GAAG,MAAMR,cAAc,CAACO,eAAe,EAAEL,YAAY,CAACE,UAAU,CAAC;IAC3EL,WAAW,CAACU,QAAQ,CAAC,CAAC,CAACC,WAAW,CAACF,IAAI,CAACG,QAAQ,CAAC;EACnD,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -67,6 +67,18 @@ export const storeCreator = (set, get) => ({
|
|
|
67
67
|
formSubmitted: true,
|
|
68
68
|
customer: form
|
|
69
69
|
});
|
|
70
|
+
},
|
|
71
|
+
permissionGiven: false,
|
|
72
|
+
setPermissionGiven: permissionGiven => {
|
|
73
|
+
set({
|
|
74
|
+
permissionGiven
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
notificationInitialized: false,
|
|
78
|
+
setNotificationInitialized: notificationInitialized => {
|
|
79
|
+
set({
|
|
80
|
+
notificationInitialized
|
|
81
|
+
});
|
|
70
82
|
}
|
|
71
83
|
});
|
|
72
84
|
export const useAppStore = createWithEqualityFn()(persist(storeCreator, {
|
|
@@ -75,7 +87,8 @@ export const useAppStore = createWithEqualityFn()(persist(storeCreator, {
|
|
|
75
87
|
skipHydration: false,
|
|
76
88
|
partialize: state => ({
|
|
77
89
|
customer: state.customer,
|
|
78
|
-
formSubmitted: state.formSubmitted
|
|
90
|
+
formSubmitted: state.formSubmitted,
|
|
91
|
+
permissionGiven: state.permissionGiven
|
|
79
92
|
})
|
|
80
93
|
}), shallow);
|
|
81
94
|
//# sourceMappingURL=store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createJSONStorage","persist","shallow","createWithEqualityFn","AsyncStorage","storeCreator","set","get","baseWidth","baseHeight","initialized","customer","data","language","theme","fake","themes","firstMessage","formSubmitted","setData","cb","newData","setFirstMessage","message","setCustomer","createCustomerResponse","name","setLanguage","setTheme","setFake","setThemes","updateBaseDimensions","setForm","form","useAppStore","storage","skipHydration","partialize","state"],"sourceRoot":"../../../src","sources":["store/store.ts"],"mappings":";;AAAA,SAASA,iBAAiB,EAAEC,OAAO,QAAQ,oBAAoB;AAC/D,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,oBAAoB,QAAQ,qBAAqB;AAE1D,OAAOC,YAAY,MAAM,2CAA2C;
|
|
1
|
+
{"version":3,"names":["createJSONStorage","persist","shallow","createWithEqualityFn","AsyncStorage","storeCreator","set","get","baseWidth","baseHeight","initialized","customer","data","language","theme","fake","themes","firstMessage","formSubmitted","setData","cb","newData","setFirstMessage","message","setCustomer","createCustomerResponse","name","setLanguage","setTheme","setFake","setThemes","updateBaseDimensions","setForm","form","permissionGiven","setPermissionGiven","notificationInitialized","setNotificationInitialized","useAppStore","storage","skipHydration","partialize","state"],"sourceRoot":"../../../src","sources":["store/store.ts"],"mappings":";;AAAA,SAASA,iBAAiB,EAAEC,OAAO,QAAQ,oBA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AC,CAAC;EACjB,CAAC;EACDe,oBAAoB,EAAEA,CAAC;IAAEvB,SAAS;IAAEC;EAAW,CAAC,KAAK;IACnDH,GAAG,CAAC;MAAEE,SAAS;MAAEC;IAAW,CAAC,CAAC;EAChC,CAAC;EACDuB,OAAO,EAAGC,IAAc,IAAK;IAC3B3B,GAAG,CAAC;MAAEY,aAAa,EAAE,IAAI;MAAEP,QAAQ,EAAEsB;IAAK,CAAC,CAAC;EAC9C,CAAC;EACDC,eAAe,EAAE,KAAK;EACtBC,kBAAkB,EAAGD,eAAwB,IAAK;IAChD5B,GAAG,CAAC;MAAE4B;IAAgB,CAAC,CAAC;EAC1B,CAAC;EACDE,uBAAuB,EAAE,KAAK;EAC9BC,0BAA0B,EAAGD,uBAAgC,IAAK;IAChE9B,GAAG,CAAC;MAAE8B;IAAwB,CAAC,CAAC;EAClC;AACF,CAAC,CAAC;AAEF,OAAO,MAAME,WAAW,GAAGnC,oBAAoB,CAAgB,CAAC,CAC9DF,OAAO,CAACI,YAAY,EAAE;EACpBqB,IAAI,EAAE,sBAAsB;EAC5Ba,OAAO,EAAEvC,iBAAiB,CAAC,MAAMI,YAAY,CAAC;EAC9CoC,aAAa,EAAE,KAAK;EACpBC,UAAU,EAAGC,KAAK,KAAM;IACtB/B,QAAQ,EAAE+B,KAAK,CAAC/B,QAAQ;IACxBO,aAAa,EAAEwB,KAAK,CAACxB,aAAa;IAClCgB,eAAe,EAAEQ,KAAK,CAACR;EACzB,CAAC;AACH,CAAC,CAAC,EACFhC,OACF,CAAC","ignoreList":[]}
|
|
@@ -4,7 +4,12 @@ export declare enum NotificationPermissionStatus {
|
|
|
4
4
|
BLOCKED = "blocked"
|
|
5
5
|
}
|
|
6
6
|
export interface NativeComnyx {
|
|
7
|
-
initialize(): Promise<
|
|
7
|
+
initialize(): Promise<{
|
|
8
|
+
success: boolean;
|
|
9
|
+
country: string;
|
|
10
|
+
language: string;
|
|
11
|
+
timezone: string;
|
|
12
|
+
}>;
|
|
8
13
|
checkOptIn(): Promise<NotificationPermissionStatus>;
|
|
9
14
|
optIn(): Promise<NotificationPermissionStatus>;
|
|
10
15
|
linkToSettings(): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeComnyx.d.ts","sourceRoot":"","sources":["../../../src/NativeComnyx.ts"],"names":[],"mappings":"AAEA,oBAAY,4BAA4B;IACtC,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"NativeComnyx.d.ts","sourceRoot":"","sources":["../../../src/NativeComnyx.ts"],"names":[],"mappings":"AAEA,oBAAY,4BAA4B;IACtC,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,UAAU,IAAI,OAAO,CAAC;QACpB,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;IACH,UAAU,IAAI,OAAO,CAAC,4BAA4B,CAAC,CAAC;IACpD,KAAK,IAAI,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAC/C,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CACpC;AAED,eAAO,MAAM,YAAY,cAAuC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
declare const axiosInstance: import("axios").AxiosInstance;
|
|
2
2
|
export declare function isInitCalled(): boolean;
|
|
3
|
+
export declare function isLoginCalled(): boolean;
|
|
3
4
|
export declare function initApi(token: string, baseURL?: string): void;
|
|
4
5
|
export declare function setLoginForAxios(externalId: string): void;
|
|
5
6
|
export declare function setLogoutForAxios(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/api/api.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,aAAa,+BAMjB,CAAC;AAEH,wBAAgB,YAAY,YAE3B;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,QAItD;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,QAElD;AAED,wBAAgB,iBAAiB,SAEhC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/api/api.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,aAAa,+BAMjB,CAAC;AAEH,wBAAgB,YAAY,YAE3B;AAED,wBAAgB,aAAa,YAE5B;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,QAItD;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,QAElD;AAED,wBAAgB,iBAAiB,SAEhC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatList.d.ts","sourceRoot":"","sources":["../../../../src/components/ChatList.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatList.d.ts","sourceRoot":"","sources":["../../../../src/components/ChatList.tsx"],"names":[],"mappings":"AAwCA,wBAAgB,QAAQ,CAAC,EACvB,WAAW,EACX,MAAM,GACP,EAAE;IACD,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,2CA+nBA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomerForm.d.ts","sourceRoot":"","sources":["../../../../src/components/CustomerForm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CustomerForm.d.ts","sourceRoot":"","sources":["../../../../src/components/CustomerForm.tsx"],"names":[],"mappings":"AAqCA,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,MAAM,GACP,EAAE;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,2CAuSA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyList.d.ts","sourceRoot":"","sources":["../../../../src/components/EmptyList.tsx"],"names":[],"mappings":"AAQA,wBAAgB,SAAS,
|
|
1
|
+
{"version":3,"file":"EmptyList.d.ts","sourceRoot":"","sources":["../../../../src/components/EmptyList.tsx"],"names":[],"mappings":"AAQA,wBAAgB,SAAS,4CAqBxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../../src/constants/translations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,YAAY,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../../src/constants/translations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,YAAY,EAAE,gBAAgB,CAm+C1D,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { LocalizationKeys } from '../types/LocalizationKeys';
|
|
2
2
|
export declare function useLocalize(): (localization: keyof LocalizationKeys) => string;
|
|
3
|
+
export declare function localize(localization: keyof LocalizationKeys): string;
|
|
3
4
|
//# sourceMappingURL=useLocalize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocalize.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useLocalize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAGlE,wBAAgB,WAAW,mBAMR,MAAM,gBAAgB,KAAG,MAAM,CAMjD"}
|
|
1
|
+
{"version":3,"file":"useLocalize.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useLocalize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAGlE,wBAAgB,WAAW,mBAMR,MAAM,gBAAgB,KAAG,MAAM,CAMjD;AAED,wBAAgB,QAAQ,CAAC,YAAY,EAAE,MAAM,gBAAgB,GAAG,MAAM,CAIrE"}
|
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
import { type EmitterSubscription } from 'react-native';
|
|
2
|
-
import {
|
|
2
|
+
import { NotificationPermissionStatus } from '../NativeComnyx';
|
|
3
|
+
import { type InitializeNotificationsParams } from './initializeNotifications';
|
|
3
4
|
type ComnyxNotificationsEventType = 'TOKEN_INIT' | 'TOKEN_FAILED' | 'NOTIFICATION_RECEIVED' | 'NOTIFICATION_CLICKED';
|
|
5
|
+
type IOSRawNotification = {
|
|
6
|
+
request: {
|
|
7
|
+
identifier: string;
|
|
8
|
+
content: {
|
|
9
|
+
title: string;
|
|
10
|
+
body: string;
|
|
11
|
+
subtitle: string;
|
|
12
|
+
badge: number;
|
|
13
|
+
sound: string;
|
|
14
|
+
userInfo: unknown;
|
|
15
|
+
categoryIdentifier: string;
|
|
16
|
+
threadIdentifier: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
type AndroidRawNotification = {};
|
|
21
|
+
type IOSRawNotificationResponse = {
|
|
22
|
+
request: {
|
|
23
|
+
identifier: string;
|
|
24
|
+
content: {
|
|
25
|
+
title: string;
|
|
26
|
+
body: string;
|
|
27
|
+
subtitle: string;
|
|
28
|
+
badge: number;
|
|
29
|
+
sound: string;
|
|
30
|
+
userInfo: unknown;
|
|
31
|
+
categoryIdentifier: string;
|
|
32
|
+
threadIdentifier: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
type AndroidRawNotificationResponse = {};
|
|
4
37
|
type ComnyxNotificationsEventResult = {
|
|
5
38
|
TOKEN_INIT: {
|
|
6
39
|
type: string;
|
|
@@ -10,10 +43,36 @@ type ComnyxNotificationsEventResult = {
|
|
|
10
43
|
type: string;
|
|
11
44
|
token: null;
|
|
12
45
|
};
|
|
13
|
-
NOTIFICATION_RECEIVED:
|
|
14
|
-
|
|
46
|
+
NOTIFICATION_RECEIVED: {
|
|
47
|
+
type: string;
|
|
48
|
+
notification: {
|
|
49
|
+
title: string;
|
|
50
|
+
body: string;
|
|
51
|
+
subtitle: string;
|
|
52
|
+
badge: number;
|
|
53
|
+
sound: string;
|
|
54
|
+
data: unknown;
|
|
55
|
+
raw: IOSRawNotification | AndroidRawNotification;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
NOTIFICATION_CLICKED: {
|
|
59
|
+
type: string;
|
|
60
|
+
notification: {
|
|
61
|
+
title: string;
|
|
62
|
+
body: string;
|
|
63
|
+
subtitle: string;
|
|
64
|
+
badge: number;
|
|
65
|
+
sound: string;
|
|
66
|
+
data: unknown;
|
|
67
|
+
raw: IOSRawNotificationResponse | AndroidRawNotificationResponse;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
15
70
|
};
|
|
16
|
-
interface ComnyxNotificationsType
|
|
71
|
+
interface ComnyxNotificationsType {
|
|
72
|
+
initialize: (params?: InitializeNotificationsParams) => Promise<boolean>;
|
|
73
|
+
optIn: () => Promise<NotificationPermissionStatus>;
|
|
74
|
+
checkOptIn: () => Promise<NotificationPermissionStatus>;
|
|
75
|
+
linkToSettings: () => Promise<boolean>;
|
|
17
76
|
addEventListener<T extends ComnyxNotificationsEventType>(event: T, listener: (event: ComnyxNotificationsEventResult[T]) => void): EmitterSubscription;
|
|
18
77
|
}
|
|
19
78
|
export declare const ComnyxNotifications: ComnyxNotificationsType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGlE,OAAO,EAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGlE,OAAO,EAAgB,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,2BAA2B,CAAC;AAOnC,KAAK,4BAA4B,GAC7B,YAAY,GACZ,cAAc,GACd,uBAAuB,GACvB,sBAAsB,CAAC;AAE3B,KAAK,kBAAkB,GAAG;IACxB,OAAO,EAAE;QACP,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE;YACP,KAAK,EAAE,MAAM,CAAC;YACd,IAAI,EAAE,MAAM,CAAC;YACb,QAAQ,EAAE,MAAM,CAAC;YACjB,KAAK,EAAE,MAAM,CAAC;YACd,KAAK,EAAE,MAAM,CAAC;YACd,QAAQ,EAAE,OAAO,CAAC;YAClB,kBAAkB,EAAE,MAAM,CAAC;YAC3B,gBAAgB,EAAE,MAAM,CAAC;SAC1B,CAAC;KACH,CAAC;CACH,CAAC;AACF,KAAK,sBAAsB,GAAG,EAAE,CAAC;AAEjC,KAAK,0BAA0B,GAAG;IAChC,OAAO,EAAE;QACP,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE;YACP,KAAK,EAAE,MAAM,CAAC;YACd,IAAI,EAAE,MAAM,CAAC;YACb,QAAQ,EAAE,MAAM,CAAC;YACjB,KAAK,EAAE,MAAM,CAAC;YACd,KAAK,EAAE,MAAM,CAAC;YACd,QAAQ,EA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M,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,gBAAgB,CAAC,CAAC,SAAS,4BAA4B,EACrD,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,CAAC,KAAK,EAAE,8BAA8B,CAAC,CAAC,CAAC,KAAK,IAAI,GAC3D,mBAAmB,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB,EAAE,uBAajC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface InitializeNotificationsParams {
|
|
2
|
+
showOptIn?: boolean;
|
|
3
|
+
showOptInOnForeground?: boolean;
|
|
4
|
+
linkToSettings?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function initializeNotifications(params?: InitializeNotificationsParams): Promise<boolean>;
|
|
7
|
+
//# sourceMappingURL=initializeNotifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initializeNotifications.d.ts","sourceRoot":"","sources":["../../../../src/notifications/initializeNotifications.ts"],"names":[],"mappings":"AAmBA,MAAM,WAAW,6BAA6B;IAC5C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAoDD,wBAAsB,uBAAuB,CAC3C,MAAM,GAAE,6BAAkC,oBAuG3C"}
|
|
@@ -25,6 +25,10 @@ interface AppStoreState {
|
|
|
25
25
|
}) => void;
|
|
26
26
|
formSubmitted: boolean;
|
|
27
27
|
setForm: (form: Customer) => void;
|
|
28
|
+
permissionGiven: boolean;
|
|
29
|
+
setPermissionGiven: (permissionGiven: boolean) => void;
|
|
30
|
+
notificationInitialized: boolean;
|
|
31
|
+
setNotificationInitialized: (notificationInitialized: boolean) => void;
|
|
28
32
|
}
|
|
29
33
|
export declare const storeCreator: StateCreator<AppStoreState>;
|
|
30
34
|
export declare const useAppStore: import("zustand/traditional").UseBoundStoreWithEqualityFn<Omit<import("zustand").StoreApi<AppStoreState>, "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CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;IAC5C,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,SAAS,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IACjC,oBAAoB,EAAE,CAAC,MAAM,EAAE;QAC7B,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;KACnB,KAAK,IAAI,CAAC;IACX,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAClC,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,CAAC,eAAe,EAAE,OAAO,KAAK,IAAI,CAAC;IACvD,uBAAuB,EAAE,OAAO,CAAC;IACjC,0BAA0B,EAAE,CAAC,uBAAuB,EAAE,OAAO,KAAK,IAAI,CAAC;CACxE;AAED,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,aAAa,CAmDnD,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;EAYvB,CAAC"}
|
|
@@ -17,6 +17,11 @@ export interface CreateCustomerRequest {
|
|
|
17
17
|
ipAddress?: string;
|
|
18
18
|
customParameters?: CustomParameter[];
|
|
19
19
|
integrationParameters?: IntegrationParameters;
|
|
20
|
+
apnsToken?: string;
|
|
21
|
+
fcmToken?: string;
|
|
22
|
+
allow_notifications?: boolean;
|
|
23
|
+
platform?: string;
|
|
24
|
+
timezone?: string;
|
|
20
25
|
}
|
|
21
26
|
export interface Customer {
|
|
22
27
|
id: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Customer.d.ts","sourceRoot":"","sources":["../../../../src/types/Customer.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,8BAA8B;IAC7C,WAA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AAM,CAAC;CACnB;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,sBAAsB,EAAE,qBAAqB,CAAC;CAC/C"}
|
|
@@ -39,5 +39,9 @@ export type LocalizationKeys = {
|
|
|
39
39
|
'customer.form.failed.phone.desc': string;
|
|
40
40
|
'customer.form.name': string;
|
|
41
41
|
'customer.form.cancel': string;
|
|
42
|
+
'notifications.optIn.title': string;
|
|
43
|
+
'notifications.optIn.description': string;
|
|
44
|
+
'notifications.optIn.cancel': string;
|
|
45
|
+
'notifications.optIn.openSettings': string;
|
|
42
46
|
};
|
|
43
47
|
//# sourceMappingURL=LocalizationKeys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalizationKeys.d.ts","sourceRoot":"","sources":["../../../../src/types/LocalizationKeys.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,4BA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C,EAAE,MAAM,CAAC;IAC1C,oBAAoB,EAAE,MAAM,CAAC;IAC7B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,2BAA2B,EAAE,MAAM,CAAC;IACpC,iCAAiC,EAAE,MAAM,CAAC;IAC1C,4BAA4B,EAAE,MAAM,CAAC;IACrC,kCAAkC,EAAE,MAAM,CAAC;CAC5C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@developer_tribe/react-native-comnyx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "React Native chat component with integrated support panel, enabling real-time customer communication and efficient agent workflow management.",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
package/src/NativeComnyx.ts
CHANGED
|
@@ -7,7 +7,12 @@ export enum NotificationPermissionStatus {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export interface NativeComnyx {
|
|
10
|
-
initialize(): Promise<
|
|
10
|
+
initialize(): Promise<{
|
|
11
|
+
success: boolean;
|
|
12
|
+
country: string;
|
|
13
|
+
language: string;
|
|
14
|
+
timezone: string;
|
|
15
|
+
}>;
|
|
11
16
|
checkOptIn(): Promise<NotificationPermissionStatus>;
|
|
12
17
|
optIn(): Promise<NotificationPermissionStatus>;
|
|
13
18
|
linkToSettings(): Promise<boolean>;
|
package/src/api/api.ts
CHANGED
|
@@ -11,6 +11,10 @@ export function isInitCalled() {
|
|
|
11
11
|
return !!axiosInstance.defaults.headers.common.Authorization;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
export function isLoginCalled() {
|
|
15
|
+
return !!axiosInstance.defaults.headers.common['external-id'];
|
|
16
|
+
}
|
|
17
|
+
|
|
14
18
|
export function initApi(token: string, baseURL?: string) {
|
|
15
19
|
axiosInstance.defaults.headers.common['Content-Type'] = 'application/json';
|
|
16
20
|
axiosInstance.defaults.headers.common.Authorization = 'Bearer ' + token;
|