@clix-so/react-native-sdk 0.0.2-beta.5 → 1.1.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/lib/module/core/Clix.js +40 -95
- package/lib/module/core/Clix.js.map +1 -1
- package/lib/module/core/ClixInitCoordinator.js +3 -14
- package/lib/module/core/ClixInitCoordinator.js.map +1 -1
- package/lib/module/core/ClixNotification.js +25 -28
- package/lib/module/core/ClixNotification.js.map +1 -1
- package/lib/module/models/ClixDevice.js +0 -6
- package/lib/module/models/ClixDevice.js.map +1 -1
- package/lib/module/models/ClixPushNotificationPayload.js +0 -19
- package/lib/module/models/ClixPushNotificationPayload.js.map +1 -1
- package/lib/module/services/ClixAPIClient.js +50 -99
- package/lib/module/services/ClixAPIClient.js.map +1 -1
- package/lib/module/services/DeviceAPIService.js +37 -45
- package/lib/module/services/DeviceAPIService.js.map +1 -1
- package/lib/module/services/DeviceService.js +97 -116
- package/lib/module/services/DeviceService.js.map +1 -1
- package/lib/module/services/EventAPIService.js +3 -5
- package/lib/module/services/EventAPIService.js.map +1 -1
- package/lib/module/services/EventService.js +13 -20
- package/lib/module/services/EventService.js.map +1 -1
- package/lib/module/services/NotificationService.js +252 -402
- package/lib/module/services/NotificationService.js.map +1 -1
- package/lib/module/services/TokenService.js +3 -59
- package/lib/module/services/TokenService.js.map +1 -1
- package/lib/module/utils/http/HTTPClient.js +101 -0
- package/lib/module/utils/http/HTTPClient.js.map +1 -0
- package/lib/module/utils/http/HTTPMethod.js +10 -0
- package/lib/module/utils/http/HTTPMethod.js.map +1 -0
- package/lib/module/utils/http/HTTPRequest.js +4 -0
- package/lib/module/utils/http/HTTPRequest.js.map +1 -0
- package/lib/module/utils/http/HTTPResponse.js +2 -0
- package/lib/module/utils/http/HTTPResponse.js.map +1 -0
- package/lib/module/utils/types.js +2 -0
- package/lib/module/utils/types.js.map +1 -0
- package/lib/typescript/src/core/Clix.d.ts +13 -15
- package/lib/typescript/src/core/Clix.d.ts.map +1 -1
- package/lib/typescript/src/core/ClixConfig.d.ts +3 -3
- package/lib/typescript/src/core/ClixConfig.d.ts.map +1 -1
- package/lib/typescript/src/core/ClixInitCoordinator.d.ts +0 -3
- package/lib/typescript/src/core/ClixInitCoordinator.d.ts.map +1 -1
- package/lib/typescript/src/core/ClixNotification.d.ts +6 -5
- package/lib/typescript/src/core/ClixNotification.d.ts.map +1 -1
- package/lib/typescript/src/models/ClixDevice.d.ts +0 -2
- package/lib/typescript/src/models/ClixDevice.d.ts.map +1 -1
- package/lib/typescript/src/models/ClixPushNotificationPayload.d.ts +8 -21
- package/lib/typescript/src/models/ClixPushNotificationPayload.d.ts.map +1 -1
- package/lib/typescript/src/services/ClixAPIClient.d.ts +6 -22
- package/lib/typescript/src/services/ClixAPIClient.d.ts.map +1 -1
- package/lib/typescript/src/services/DeviceAPIService.d.ts +1 -1
- package/lib/typescript/src/services/DeviceAPIService.d.ts.map +1 -1
- package/lib/typescript/src/services/DeviceService.d.ts +10 -5
- package/lib/typescript/src/services/DeviceService.d.ts.map +1 -1
- package/lib/typescript/src/services/EventAPIService.d.ts.map +1 -1
- package/lib/typescript/src/services/EventService.d.ts +1 -0
- package/lib/typescript/src/services/EventService.d.ts.map +1 -1
- package/lib/typescript/src/services/NotificationService.d.ts +50 -57
- package/lib/typescript/src/services/NotificationService.d.ts.map +1 -1
- package/lib/typescript/src/services/TokenService.d.ts +1 -7
- package/lib/typescript/src/services/TokenService.d.ts.map +1 -1
- package/lib/typescript/src/utils/http/HTTPClient.d.ts +15 -0
- package/lib/typescript/src/utils/http/HTTPClient.d.ts.map +1 -0
- package/lib/typescript/src/utils/http/HTTPMethod.d.ts +7 -0
- package/lib/typescript/src/utils/http/HTTPMethod.d.ts.map +1 -0
- package/lib/typescript/src/utils/http/HTTPRequest.d.ts +9 -0
- package/lib/typescript/src/utils/http/HTTPRequest.d.ts.map +1 -0
- package/lib/typescript/src/utils/http/HTTPResponse.d.ts +6 -0
- package/lib/typescript/src/utils/http/HTTPResponse.d.ts.map +1 -0
- package/lib/typescript/src/utils/types.d.ts +5 -0
- package/lib/typescript/src/utils/types.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/core/Clix.ts +62 -115
- package/src/core/ClixConfig.ts +3 -3
- package/src/core/ClixInitCoordinator.ts +5 -17
- package/src/core/ClixNotification.ts +36 -37
- package/src/models/ClixDevice.ts +17 -25
- package/src/models/ClixPushNotificationPayload.ts +8 -37
- package/src/services/ClixAPIClient.ts +84 -144
- package/src/services/DeviceAPIService.ts +39 -47
- package/src/services/DeviceService.ts +122 -156
- package/src/services/EventAPIService.ts +3 -5
- package/src/services/EventService.ts +26 -33
- package/src/services/NotificationService.ts +318 -533
- package/src/services/TokenService.ts +4 -71
- package/src/utils/http/HTTPClient.ts +141 -0
- package/src/utils/http/HTTPMethod.ts +6 -0
- package/src/utils/http/HTTPRequest.ts +9 -0
- package/src/utils/http/HTTPResponse.ts +5 -0
- package/src/utils/types.ts +7 -0
package/lib/module/core/Clix.js
CHANGED
|
@@ -8,35 +8,45 @@ import { EventService } from "../services/EventService.js";
|
|
|
8
8
|
import { NotificationService } from "../services/NotificationService.js";
|
|
9
9
|
import { StorageService } from "../services/StorageService.js";
|
|
10
10
|
import { TokenService } from "../services/TokenService.js";
|
|
11
|
-
import { ClixError } from "../utils/ClixError.js";
|
|
12
11
|
import { ClixLogger, ClixLogLevel } from "../utils/logging/ClixLogger.js";
|
|
13
12
|
import { ClixInitCoordinator } from "./ClixInitCoordinator.js";
|
|
14
13
|
import { ClixNotification } from "./ClixNotification.js";
|
|
15
14
|
export class Clix {
|
|
16
15
|
static initCoordinator = new ClixInitCoordinator();
|
|
17
16
|
static Notification = ClixNotification.shared;
|
|
18
|
-
|
|
17
|
+
static configKey = 'clix_config';
|
|
19
18
|
|
|
20
19
|
/**
|
|
21
20
|
* Initialize Clix SDK
|
|
22
21
|
*/
|
|
23
|
-
static async initialize(
|
|
22
|
+
static async initialize(options) {
|
|
24
23
|
try {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
const config = {
|
|
25
|
+
...options,
|
|
26
|
+
endpoint: options.endpoint || 'https://api.clix.so',
|
|
27
|
+
logLevel: options.logLevel || ClixLogLevel.INFO,
|
|
28
|
+
extraHeaders: options.extraHeaders || {}
|
|
29
|
+
};
|
|
28
30
|
ClixLogger.setLogLevel(config.logLevel || ClixLogLevel.ERROR);
|
|
29
|
-
ClixLogger.debug('Initializing Clix SDK');
|
|
31
|
+
ClixLogger.debug('Initializing Clix SDK...');
|
|
30
32
|
this.shared = new Clix();
|
|
31
|
-
|
|
33
|
+
this.shared.config = config;
|
|
34
|
+
const apiClient = new ClixAPIClient(config);
|
|
35
|
+
const deviceApiService = new DeviceAPIService(apiClient);
|
|
36
|
+
const eventApiService = new EventAPIService(apiClient);
|
|
37
|
+
this.shared.storageService = new StorageService(config.projectId);
|
|
38
|
+
this.shared.tokenService = new TokenService(this.shared.storageService);
|
|
39
|
+
this.shared.deviceService = new DeviceService(this.shared.storageService, this.shared.tokenService, deviceApiService);
|
|
40
|
+
this.shared.eventService = new EventService(eventApiService, this.shared.deviceService);
|
|
41
|
+
this.shared.notificationService = new NotificationService(this.shared.deviceService, this.shared.tokenService, this.shared.eventService);
|
|
42
|
+
this.shared.storageService.set(this.configKey, config);
|
|
43
|
+
await this.shared.notificationService.initialize(); // NOTE(nyanxyz): must be initialized before any await calls
|
|
44
|
+
await this.shared.deviceService.initialize();
|
|
32
45
|
ClixLogger.debug('Clix SDK initialized successfully');
|
|
33
46
|
this.initCoordinator.completeInitialization();
|
|
34
47
|
} catch (error) {
|
|
35
48
|
const errorInstance = error instanceof Error ? error : new Error(String(error));
|
|
36
49
|
this.initCoordinator.failInitialization(errorInstance);
|
|
37
|
-
throw ClixError.notInitialized({
|
|
38
|
-
cause: errorInstance
|
|
39
|
-
});
|
|
40
50
|
}
|
|
41
51
|
}
|
|
42
52
|
|
|
@@ -46,9 +56,7 @@ export class Clix {
|
|
|
46
56
|
static async setUserId(userId) {
|
|
47
57
|
try {
|
|
48
58
|
await Clix.initCoordinator.waitForInitialization();
|
|
49
|
-
|
|
50
|
-
await this.shared.deviceService.setProjectUserId(userId);
|
|
51
|
-
}
|
|
59
|
+
await this.shared?.deviceService?.setProjectUserId(userId);
|
|
52
60
|
} catch (error) {
|
|
53
61
|
ClixLogger.error(`Failed to set user ID: ${error}`);
|
|
54
62
|
}
|
|
@@ -60,9 +68,7 @@ export class Clix {
|
|
|
60
68
|
static async removeUserId() {
|
|
61
69
|
try {
|
|
62
70
|
await Clix.initCoordinator.waitForInitialization();
|
|
63
|
-
|
|
64
|
-
await this.shared.deviceService.removeProjectUserId();
|
|
65
|
-
}
|
|
71
|
+
await this.shared?.deviceService?.removeProjectUserId();
|
|
66
72
|
} catch (error) {
|
|
67
73
|
ClixLogger.error(`Failed to remove user ID: ${error}`);
|
|
68
74
|
}
|
|
@@ -74,11 +80,9 @@ export class Clix {
|
|
|
74
80
|
static async setUserProperty(key, value) {
|
|
75
81
|
try {
|
|
76
82
|
await Clix.initCoordinator.waitForInitialization();
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
});
|
|
81
|
-
}
|
|
83
|
+
await this.shared?.deviceService?.updateUserProperties({
|
|
84
|
+
[key]: value
|
|
85
|
+
});
|
|
82
86
|
} catch (error) {
|
|
83
87
|
ClixLogger.error(`Failed to set user property: ${error}`);
|
|
84
88
|
}
|
|
@@ -87,12 +91,10 @@ export class Clix {
|
|
|
87
91
|
/**
|
|
88
92
|
* Set user properties
|
|
89
93
|
*/
|
|
90
|
-
static async setUserProperties(
|
|
94
|
+
static async setUserProperties(properties) {
|
|
91
95
|
try {
|
|
92
96
|
await Clix.initCoordinator.waitForInitialization();
|
|
93
|
-
|
|
94
|
-
await this.shared.deviceService.updateUserProperties(userProperties);
|
|
95
|
-
}
|
|
97
|
+
await this.shared?.deviceService?.updateUserProperties(properties);
|
|
96
98
|
} catch (error) {
|
|
97
99
|
ClixLogger.error(`Failed to set user properties: ${error}`);
|
|
98
100
|
}
|
|
@@ -104,9 +106,7 @@ export class Clix {
|
|
|
104
106
|
static async removeUserProperty(key) {
|
|
105
107
|
try {
|
|
106
108
|
await Clix.initCoordinator.waitForInitialization();
|
|
107
|
-
|
|
108
|
-
await this.shared.deviceService.removeUserProperties([key]);
|
|
109
|
-
}
|
|
109
|
+
await this.shared?.deviceService?.removeUserProperties([key]);
|
|
110
110
|
} catch (error) {
|
|
111
111
|
ClixLogger.error(`Failed to remove user property: ${error}`);
|
|
112
112
|
}
|
|
@@ -118,45 +118,21 @@ export class Clix {
|
|
|
118
118
|
static async removeUserProperties(keys) {
|
|
119
119
|
try {
|
|
120
120
|
await Clix.initCoordinator.waitForInitialization();
|
|
121
|
-
|
|
122
|
-
await this.shared.deviceService.removeUserProperties(keys);
|
|
123
|
-
}
|
|
121
|
+
await this.shared?.deviceService?.removeUserProperties(keys);
|
|
124
122
|
} catch (error) {
|
|
125
123
|
ClixLogger.error(`Failed to remove user properties: ${error}`);
|
|
126
124
|
}
|
|
127
125
|
}
|
|
128
126
|
|
|
129
127
|
/**
|
|
130
|
-
*
|
|
131
|
-
*/
|
|
132
|
-
static async getDeviceId() {
|
|
133
|
-
try {
|
|
134
|
-
await Clix.initCoordinator.waitForInitialization();
|
|
135
|
-
if (this.shared?.deviceService) {
|
|
136
|
-
const deviceId = await this.shared.deviceService.getCurrentDeviceId();
|
|
137
|
-
return deviceId;
|
|
138
|
-
}
|
|
139
|
-
return undefined;
|
|
140
|
-
} catch (error) {
|
|
141
|
-
ClixLogger.error(`Failed to get device ID: ${error}`);
|
|
142
|
-
return undefined;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* @deprecated Use Clix.Notification.getToken() instead.
|
|
128
|
+
* Track event
|
|
148
129
|
*/
|
|
149
|
-
static async
|
|
130
|
+
static async trackEvent(name, properties = {}) {
|
|
150
131
|
try {
|
|
151
132
|
await Clix.initCoordinator.waitForInitialization();
|
|
152
|
-
|
|
153
|
-
const token = await this.shared.notificationService.getCurrentToken();
|
|
154
|
-
return token || undefined;
|
|
155
|
-
}
|
|
156
|
-
return undefined;
|
|
133
|
+
await this.shared?.eventService?.trackEvent(name, properties);
|
|
157
134
|
} catch (error) {
|
|
158
|
-
ClixLogger.error(`Failed to
|
|
159
|
-
return undefined;
|
|
135
|
+
ClixLogger.error(`Failed to track event: ${error}`);
|
|
160
136
|
}
|
|
161
137
|
}
|
|
162
138
|
|
|
@@ -164,51 +140,20 @@ export class Clix {
|
|
|
164
140
|
* Set log level
|
|
165
141
|
*/
|
|
166
142
|
static setLogLevel(level) {
|
|
143
|
+
ClixLogger.debug(`Setting log level: ${level}`);
|
|
167
144
|
ClixLogger.setLogLevel(level);
|
|
168
145
|
}
|
|
169
146
|
|
|
170
147
|
/**
|
|
171
|
-
*
|
|
148
|
+
* Get device ID
|
|
172
149
|
*/
|
|
173
|
-
static async
|
|
150
|
+
static async getDeviceId() {
|
|
174
151
|
try {
|
|
175
152
|
await Clix.initCoordinator.waitForInitialization();
|
|
176
|
-
|
|
177
|
-
await this.shared.eventService.trackEvent(name, properties);
|
|
178
|
-
}
|
|
179
|
-
} catch (error) {
|
|
180
|
-
ClixLogger.error(`Failed to track event: ${error}`);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Set configuration
|
|
186
|
-
*/
|
|
187
|
-
async setConfig(rawConfig) {
|
|
188
|
-
const config = {
|
|
189
|
-
...rawConfig,
|
|
190
|
-
endpoint: rawConfig.endpoint || 'https://api.clix.so',
|
|
191
|
-
logLevel: rawConfig.logLevel || ClixLogLevel.INFO,
|
|
192
|
-
extraHeaders: rawConfig.extraHeaders || {}
|
|
193
|
-
};
|
|
194
|
-
this.storageService = new StorageService(config.projectId);
|
|
195
|
-
try {
|
|
196
|
-
this.storageService.set('project_id', config.projectId);
|
|
197
|
-
this.storageService.set('api_key', config.apiKey);
|
|
198
|
-
this.storageService.set('clix_config', config);
|
|
153
|
+
return this.shared?.deviceService?.getCurrentDeviceId();
|
|
199
154
|
} catch (error) {
|
|
200
|
-
ClixLogger.
|
|
201
|
-
|
|
202
|
-
const apiClient = new ClixAPIClient(config);
|
|
203
|
-
const deviceAPIService = new DeviceAPIService(apiClient);
|
|
204
|
-
const eventAPIService = new EventAPIService(apiClient);
|
|
205
|
-
const tokenService = new TokenService(this.storageService);
|
|
206
|
-
this.deviceService = new DeviceService(this.storageService, tokenService, deviceAPIService);
|
|
207
|
-
this.eventService = new EventService(eventAPIService, this.deviceService);
|
|
208
|
-
try {
|
|
209
|
-
this.notificationService = await NotificationService.getInstance().initialize(this.eventService, this.storageService, this.deviceService, tokenService);
|
|
210
|
-
} catch (error) {
|
|
211
|
-
ClixLogger.warn('Failed to fully initialize notification service, some features may be limited', error);
|
|
155
|
+
ClixLogger.error(`Failed to get device ID: ${error}`);
|
|
156
|
+
return undefined;
|
|
212
157
|
}
|
|
213
158
|
}
|
|
214
159
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ClixAPIClient","DeviceAPIService","DeviceService","EventAPIService","EventService","NotificationService","StorageService","TokenService","
|
|
1
|
+
{"version":3,"names":["ClixAPIClient","DeviceAPIService","DeviceService","EventAPIService","EventService","NotificationService","StorageService","TokenService","ClixLogger","ClixLogLevel","ClixInitCoordinator","ClixNotification","Clix","initCoordinator","Notification","shared","configKey","initialize","options","config","endpoint","logLevel","INFO","extraHeaders","setLogLevel","ERROR","debug","apiClient","deviceApiService","eventApiService","storageService","projectId","tokenService","deviceService","eventService","notificationService","set","completeInitialization","error","errorInstance","Error","String","failInitialization","setUserId","userId","waitForInitialization","setProjectUserId","removeUserId","removeProjectUserId","setUserProperty","key","value","updateUserProperties","setUserProperties","properties","removeUserProperty","removeUserProperties","keys","trackEvent","name","level","getDeviceId","getCurrentDeviceId","undefined"],"sourceRoot":"../../../src","sources":["core/Clix.ts"],"mappings":";;AA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,KAAK,EAAE,CAAC;IAC/CpD,UAAU,CAACgB,WAAW,CAACoC,KAAK,CAAC;EAC/B;;EAEA;AACF;AACA;EACE,aAAaC,WAAWA,CAAA,EAAgC;IACtD,IAAI;MACF,MAAMjD,IAAI,CAACC,eAAe,CAACgC,qBAAqB,CAAC,CAAC;MAClD,OAAO,IAAI,CAAC9B,MAAM,EAAEkB,aAAa,EAAE6B,kBAAkB,CAAC,CAAC;IACzD,CAAC,CAAC,OAAOxB,KAAK,EAAE;MACd9B,UAAU,CAAC8B,KAAK,CAAC,4BAA4BA,KAAK,EAAE,CAAC;MACrD,OAAOyB,SAAS;IAClB;EACF;AACF","ignoreList":[]}
|
|
@@ -16,14 +16,11 @@ export class ClixInitCoordinator {
|
|
|
16
16
|
if (this.isCompleted) {
|
|
17
17
|
return Promise.resolve();
|
|
18
18
|
}
|
|
19
|
+
if (this.isFailed) {
|
|
20
|
+
return Promise.reject(new Error('Clix initialization has already failed'));
|
|
21
|
+
}
|
|
19
22
|
return this.promise;
|
|
20
23
|
}
|
|
21
|
-
isInitializationFailed() {
|
|
22
|
-
return this.isFailed;
|
|
23
|
-
}
|
|
24
|
-
isInitializationCompleted() {
|
|
25
|
-
return this.isCompleted;
|
|
26
|
-
}
|
|
27
24
|
completeInitialization() {
|
|
28
25
|
if (this.isAlreadyFinalized()) {
|
|
29
26
|
return;
|
|
@@ -39,14 +36,6 @@ export class ClixInitCoordinator {
|
|
|
39
36
|
ClixLogger.warn('Clix initialization failed:', error);
|
|
40
37
|
this.reject?.(error);
|
|
41
38
|
}
|
|
42
|
-
reset() {
|
|
43
|
-
this.isCompleted = false;
|
|
44
|
-
this.isFailed = false;
|
|
45
|
-
this.promise = new Promise((resolve, reject) => {
|
|
46
|
-
this.resolve = resolve;
|
|
47
|
-
this.reject = reject;
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
39
|
isAlreadyFinalized() {
|
|
51
40
|
if (this.isCompleted || this.isFailed) {
|
|
52
41
|
ClixLogger.warn('Initialization already completed or failed');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ClixLogger","ClixInitCoordinator","resolve","reject","isCompleted","isFailed","constructor","promise","Promise","waitForInitialization","
|
|
1
|
+
{"version":3,"names":["ClixLogger","ClixInitCoordinator","resolve","reject","isCompleted","isFailed","constructor","promise","Promise","waitForInitialization","Error","completeInitialization","isAlreadyFinalized","failInitialization","error","warn"],"sourceRoot":"../../../src","sources":["core/ClixInitCoordinator.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,gCAA6B;AAExD,OAAO,MAAMC,mBAAmB,CAAC;EAEvBC,OAAO,GAAwB,IAAI;EACnCC,MAAM,GAAoC,IAAI;EAC9CC,WAAW,GAAG,KAAK;EACnBC,QAAQ,GAAG,KAAK;EAExBC,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACC,OAAO,GAAG,IAAIC,OAAO,CAAO,CAACN,OAAO,EAAEC,MAAM,KAAK;MACpD,IAAI,CAACD,OAAO,GAAGA,OAAO;MACtB,IAAI,CAACC,MAAM,GAAGA,MAAM;IACtB,CAAC,CAAC;EACJ;EAEA,MAAMM,qBAAqBA,CAAA,EAAkB;IAC3C,IAAI,IAAI,CAACL,WAAW,EAAE;MACpB,OAAOI,OAAO,CAACN,OAAO,CAAC,CAAC;IAC1B;IACA,IAAI,IAAI,CAACG,QAAQ,EAAE;MACjB,OAAOG,OAAO,CAACL,MAAM,CACnB,IAAIO,KAAK,CAAC,wCAAwC,CACpD,CAAC;IACH;IACA,OAAO,IAAI,CAACH,OAAO;EACrB;EAEAI,sBAAsBA,CAAA,EAAS;IAC7B,IAAI,IAAI,CAACC,kBAAkB,CAAC,CAAC,EAAE;MAC7B;IACF;IACA,IAAI,CAACR,WAAW,GAAG,IAAI;IACvB,IAAI,CAACF,OAAO,GAAG,CAAC;EAClB;EAEAW,kBAAkBA,CAACC,KAAY,EAAQ;IACrC,IAAI,IAAI,CAACF,kBAAkB,CAAC,CAAC,EAAE;MAC7B;IACF;IACA,IAAI,CAACP,QAAQ,GAAG,IAAI;IACpBL,UAAU,CAACe,IAAI,CAAC,6BAA6B,EAAED,KAAK,CAAC;IACrD,IAAI,CAACX,MAAM,GAAGW,KAAK,CAAC;EACtB;EAEQF,kBAAkBA,CAAA,EAAY;IACpC,IAAI,IAAI,CAACR,WAAW,IAAI,IAAI,CAACC,QAAQ,EAAE;MACrCL,UAAU,CAACe,IAAI,CAAC,4CAA4C,CAAC;MAC7D,OAAO,IAAI;IACb;IACA,OAAO,KAAK;EACd;AACF","ignoreList":[]}
|
|
@@ -16,7 +16,7 @@ export class ClixNotification {
|
|
|
16
16
|
ClixLogger.warn('Notification service is not initialized');
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
notificationService.
|
|
19
|
+
notificationService.autoHandleLandingUrl = autoHandleLandingURL;
|
|
20
20
|
if (autoRequestPermission) {
|
|
21
21
|
await notificationService.requestPermission();
|
|
22
22
|
}
|
|
@@ -27,26 +27,16 @@ export class ClixNotification {
|
|
|
27
27
|
async requestPermission() {
|
|
28
28
|
try {
|
|
29
29
|
await Clix.initCoordinator.waitForInitialization();
|
|
30
|
-
|
|
31
|
-
if (!notificationService) {
|
|
32
|
-
ClixLogger.warn('Notification service is not initialized');
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
return await notificationService.requestPermission();
|
|
30
|
+
return await Clix.shared?.notificationService?.requestPermission();
|
|
36
31
|
} catch (error) {
|
|
37
32
|
ClixLogger.error('Failed to request notification permission', error);
|
|
38
|
-
return
|
|
33
|
+
return undefined;
|
|
39
34
|
}
|
|
40
35
|
}
|
|
41
36
|
async setPermissionGranted(isGranted) {
|
|
42
37
|
try {
|
|
43
38
|
await Clix.initCoordinator.waitForInitialization();
|
|
44
|
-
|
|
45
|
-
if (!notificationService) {
|
|
46
|
-
ClixLogger.warn('Notification service is not initialized');
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
await notificationService.setPermissionGranted(isGranted);
|
|
39
|
+
return await Clix.shared?.notificationService?.setPermissionGranted(isGranted);
|
|
50
40
|
} catch (error) {
|
|
51
41
|
ClixLogger.error('Failed to update push permission status on server', error);
|
|
52
42
|
}
|
|
@@ -54,13 +44,7 @@ export class ClixNotification {
|
|
|
54
44
|
async getToken() {
|
|
55
45
|
try {
|
|
56
46
|
await Clix.initCoordinator.waitForInitialization();
|
|
57
|
-
|
|
58
|
-
if (!notificationService) {
|
|
59
|
-
ClixLogger.warn('Notification service is not initialized');
|
|
60
|
-
return undefined;
|
|
61
|
-
}
|
|
62
|
-
const token = await notificationService.getCurrentToken();
|
|
63
|
-
return token ?? undefined;
|
|
47
|
+
return Clix.shared?.tokenService?.getCurrentToken();
|
|
64
48
|
} catch (error) {
|
|
65
49
|
ClixLogger.error('Failed to get push token', error);
|
|
66
50
|
return undefined;
|
|
@@ -74,7 +58,7 @@ export class ClixNotification {
|
|
|
74
58
|
ClixLogger.warn('Notification service is not initialized');
|
|
75
59
|
return;
|
|
76
60
|
}
|
|
77
|
-
notificationService.
|
|
61
|
+
notificationService.messageHandler = handler;
|
|
78
62
|
} catch (error) {
|
|
79
63
|
ClixLogger.error('Failed to register onMessage handler', error);
|
|
80
64
|
}
|
|
@@ -87,12 +71,12 @@ export class ClixNotification {
|
|
|
87
71
|
ClixLogger.warn('Notification service is not initialized');
|
|
88
72
|
return;
|
|
89
73
|
}
|
|
90
|
-
notificationService.
|
|
74
|
+
notificationService.backgroundMessageHandler = handler;
|
|
91
75
|
} catch (error) {
|
|
92
76
|
ClixLogger.error('Failed to register onBackgroundMessage handler', error);
|
|
93
77
|
}
|
|
94
78
|
}
|
|
95
|
-
async
|
|
79
|
+
async onNotificationOpenedApp(handler) {
|
|
96
80
|
try {
|
|
97
81
|
await Clix.initCoordinator.waitForInitialization();
|
|
98
82
|
const notificationService = Clix.shared?.notificationService;
|
|
@@ -100,12 +84,25 @@ export class ClixNotification {
|
|
|
100
84
|
ClixLogger.warn('Notification service is not initialized');
|
|
101
85
|
return;
|
|
102
86
|
}
|
|
103
|
-
notificationService.
|
|
87
|
+
notificationService.notificationOpenedAppHandler = handler;
|
|
104
88
|
} catch (error) {
|
|
105
89
|
ClixLogger.error('Failed to register onNotificationOpened handler', error);
|
|
106
90
|
}
|
|
107
91
|
}
|
|
108
|
-
async
|
|
92
|
+
async onTokenRefresh(handler) {
|
|
93
|
+
try {
|
|
94
|
+
await Clix.initCoordinator.waitForInitialization();
|
|
95
|
+
const notificationService = Clix.shared?.notificationService;
|
|
96
|
+
if (!notificationService) {
|
|
97
|
+
ClixLogger.warn('Notification service is not initialized');
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
notificationService.tokenRefreshHandler = handler;
|
|
101
|
+
} catch (error) {
|
|
102
|
+
ClixLogger.error('Failed to register onTokenRefresh handler', error);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
async onForegroundEvent(handler) {
|
|
109
106
|
try {
|
|
110
107
|
await Clix.initCoordinator.waitForInitialization();
|
|
111
108
|
const notificationService = Clix.shared?.notificationService;
|
|
@@ -113,9 +110,9 @@ export class ClixNotification {
|
|
|
113
110
|
ClixLogger.warn('Notification service is not initialized');
|
|
114
111
|
return;
|
|
115
112
|
}
|
|
116
|
-
notificationService.
|
|
113
|
+
notificationService.foregroundEventHandler = handler;
|
|
117
114
|
} catch (error) {
|
|
118
|
-
ClixLogger.error('Failed to register
|
|
115
|
+
ClixLogger.error('Failed to register onForegroundEvent handler', error);
|
|
119
116
|
}
|
|
120
117
|
}
|
|
121
118
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ClixLogger","Clix","ClixNotification","shared","configure","options","autoRequestPermission","autoHandleLandingURL","initCoordinator","waitForInitialization","notificationService","warn","
|
|
1
|
+
{"version":3,"names":["ClixLogger","Clix","ClixNotification","shared","configure","options","autoRequestPermission","autoHandleLandingURL","initCoordinator","waitForInitialization","notificationService","warn","autoHandleLandingUrl","requestPermission","error","undefined","setPermissionGranted","isGranted","getToken","tokenService","getCurrentToken","onMessage","handler","messageHandler","onBackgroundMessage","backgroundMessageHandler","onNotificationOpenedApp","notificationOpenedAppHandler","onTokenRefresh","tokenRefreshHandler","onForegroundEvent","foregroundEventHandler"],"sourceRoot":"../../../src","sources":["core/ClixNotification.ts"],"mappings":";;AAQA,SAASA,UAAU,QAAQ,gCAA6B;AACxD,SAASC,IAAI,QAAQ,WAAQ;AAa7B,OAAO,MAAMC,gBAAgB,CAAC;EAC5B,OAAOC,MAAM,GAAqB,IAAID,gBAAgB,CAAC,CAAC;EAExD,MAAME,SAASA,CAACC,OAAyB,GAAG,CAAC,CAAC,EAAE;IAC9C,MAAM;MAAEC,qBAAqB,GAAG,KAAK;MAAEC,oBAAoB,GAAG;IAAK,CAAC,GAClEF,OAAO;IAET,IAAI;MACF,MAAMJ,IAAI,CAACO,eAAe,CAACC,qBAAqB,CAAC,CAAC;MAClD,MAAMC,mBAAmB,GAAGT,IAAI,CAACE,MAAM,EAAEO,mBAAmB;MAC5D,IAAI,CAACA,mBAAmB,EAAE;QACxBV,UAAU,CAACW,IAAI,CAAC,yCAAyC,CAAC;QAC1D;MACF;MAEAD,mBAAmB,CAACE,oBAAoB,GAAGL,oBAAoB;MAE/D,IAAID,qBAAqB,EAAE;QACzB,MAAMI,mBAAmB,CAACG,iBAAiB,CAAC,CAAC;MAC/C;IACF,CAAC,CAAC,OAAOC,KAAK,EAAE;MACdd,UAAU,CAACc,KAAK,CAAC,mCAAmC,EAAEA,KAAK,CAAC;IAC9D;EACF;EAEA,MAAMD,iBAAiBA,CAAA,EAA8C;IACnE,IAAI;MACF,MAAMZ,IAAI,CAACO,eAAe,CAACC,qBAAqB,CAAC,CAAC;MAClD,OAAO,MAAMR,IAAI,CAACE,MAAM,EAAEO,mBAAmB,EAAEG,iBAAiB,CAAC,CAAC;IACpE,CAAC,CAAC,OAAOC,KAAK,EAAE;MACdd,UAAU,CAACc,KAAK,CAAC,2CAA2C,EAAEA,KAAK,CAAC;MACpE,OAAOC,S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CAACA,mBAAmB,EAAE;QACxBV,UAAU,CAACW,IAAI,CAAC,yCAAyC,CAAC;QAC1D;MACF;MACAD,mBAAmB,CAACqB,sBAAsB,GAAGT,OAAO;IACtD,CAAC,CAAC,OAAOR,KAAK,EAAE;MACdd,UAAU,CAACc,KAAK,CAAC,8CAA8C,EAAEA,KAAK,CAAC;IACzE;EACF;AACF","ignoreList":[]}
|
|
@@ -41,11 +41,5 @@ export class ClixDevice {
|
|
|
41
41
|
pushTokenType: updates.pushTokenType ?? this.pushTokenType
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
equals(other) {
|
|
45
|
-
return this.id === other.id;
|
|
46
|
-
}
|
|
47
|
-
toString() {
|
|
48
|
-
return `ClixDevice(id: ${this.id}, platform: ${this.platform}, model: ${this.model})`;
|
|
49
|
-
}
|
|
50
44
|
}
|
|
51
45
|
//# sourceMappingURL=ClixDevice.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ClixDevice","constructor","device","id","platform","model","manufacturer","osName","osVersion","localeRegion","localeLanguage","timezone","appName","appVersion","sdkType","sdkVersion","adId","isPushPermissionGranted","pushToken","pushTokenType","copyWith","updates"
|
|
1
|
+
{"version":3,"names":["ClixDevice","constructor","device","id","platform","model","manufacturer","osName","osVersion","localeRegion","localeLanguage","timezone","appName","appVersion","sdkType","sdkVersion","adId","isPushPermissionGranted","pushToken","pushTokenType","copyWith","updates"],"sourceRoot":"../../../src","sources":["models/ClixDevice.ts"],"mappings":";;AAAA,OAAO,MAAMA,UAAU,CAAC;EAmBtBC,WAAWA,CAACC,MAkBX,EAAE;IACD,IAAI,CAACC,EAAE,GAAGD,MAAM,CAACC,EAAE;IACnB,IAAI,CAACC,QAAQ,GAAGF,MAAM,CAACE,QAAQ;IAC/B,IAAI,CAACC,KAAK,GAAGH,MAAM,CAACG,KAAK;IACzB,IAAI,CAACC,YAAY,GAAGJ,MAAM,CAACI,YAAY;IACvC,IAAI,CAACC,MAAM,GAAGL,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Q,EAAEU,OAAO,CAACV,QAAQ,IAAI,IAAI,CAACA,QAAQ;MAC3CC,OAAO,EAAES,OAAO,CAACT,OAAO,IAAI,IAAI,CAACA,OAAO;MACxCC,UAAU,EAAEQ,OAAO,CAACR,UAAU,IAAI,IAAI,CAACA,UAAU;MACjDC,OAAO,EAAEO,OAAO,CAACP,OAAO,IAAI,IAAI,CAACA,OAAO;MACxCC,UAAU,EAAEM,OAAO,CAACN,UAAU,IAAI,IAAI,CAACA,UAAU;MACjDC,IAAI,EAAEK,OAAO,CAACL,IAAI,IAAI,IAAI,CAACA,IAAI;MAC/BC,uBAAuB,EACrBI,OAAO,CAACJ,uBAAuB,IAAI,IAAI,CAACA,uBAAuB;MACjEC,SAAS,EAAEG,OAAO,CAACH,SAAS,IAAI,IAAI,CAACA,SAAS;MAC9CC,aAAa,EAAEE,OAAO,CAACF,aAAa,IAAI,IAAI,CAACA;IAC/C,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
|
|
@@ -1,21 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
export class ClixPushNotificationPayload {
|
|
4
|
-
constructor(payload) {
|
|
5
|
-
this.messageId = payload.messageId;
|
|
6
|
-
this.campaignId = payload.campaignId;
|
|
7
|
-
this.userId = payload.userId;
|
|
8
|
-
this.deviceId = payload.deviceId;
|
|
9
|
-
this.trackingId = payload.trackingId;
|
|
10
|
-
this.landingUrl = payload.landingUrl;
|
|
11
|
-
this.imageUrl = payload.imageUrl;
|
|
12
|
-
this.customProperties = payload.customProperties;
|
|
13
|
-
}
|
|
14
|
-
equals(other) {
|
|
15
|
-
return this.messageId === other.messageId;
|
|
16
|
-
}
|
|
17
|
-
toString() {
|
|
18
|
-
return `ClixPushNotificationPayload(messageId: ${this.messageId}, campaignId: ${this.campaignId})`;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
2
|
//# sourceMappingURL=ClixPushNotificationPayload.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["models/ClixPushNotificationPayload.ts"],"mappings":"","ignoreList":[]}
|