indigitall-capacitor-plugin 2.17.0 → 2.18.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.
@@ -13,6 +13,6 @@ Pod::Spec.new do |s|
13
13
  s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
14
14
  s.ios.deployment_target = '12.0'
15
15
  s.dependency 'Capacitor'
16
- s.dependency 'indigitall-ios', '~> 6.19.0'
16
+ s.dependency 'indigitall-ios', '~> 6.20.0'
17
17
  s.swift_version = '5.1'
18
18
  end
@@ -57,7 +57,7 @@ dependencies {
57
57
  androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
58
58
  androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
59
59
  implementation("androidx.cardview:cardview:1.0.0")
60
- implementation('com.indigitall:android:5.24.+'){
60
+ implementation('com.indigitall:android:5.25.+'){
61
61
  exclude group: "com.indigitall", module: "android-hms"
62
62
  }
63
63
 
@@ -32,7 +32,7 @@ public class IndigitallCustomerPlugin extends Plugin {
32
32
  private String SEND_CUSTOM_EVENT = "sendCustomEvent";
33
33
 
34
34
  @PluginMethod
35
- public void getCustomer(PluginCall call){
35
+ public void getCustomer(PluginCall call) {
36
36
  CustomerCp.getCustomer(getContext(), new CustomerCallback(getContext()) {
37
37
  @Override
38
38
  public void onSuccess(@NonNull Customer customer) {
@@ -49,7 +49,7 @@ public class IndigitallCustomerPlugin extends Plugin {
49
49
  }
50
50
 
51
51
  @PluginMethod
52
- public void getCustomerInformation(PluginCall call){
52
+ public void getCustomerInformation(PluginCall call) {
53
53
  JSArray array = call.getArray(FIELD_NAMES_LIST);
54
54
  CustomerCp.getCustomerInformation(getContext(), array, new CustomerFieldCallback(getContext()) {
55
55
  @Override
@@ -142,22 +142,25 @@ public class IndigitallCustomerPlugin extends Plugin {
142
142
 
143
143
  @PluginMethod
144
144
  public void sendCustomEvent(PluginCall call) throws JSONException {
145
- String eventCode = call.getString("eventCode");
146
- JSObject customData = call.getObject("customData");
147
- CustomerCp.sendCustomEvent(getContext(), eventCode, customData, new CustomerCallback(getContext()) {
148
- @Override
149
- public void onSuccess(@NonNull Customer customer) {
150
- JSObject ret = new JSObject();
151
- ret.put(CUSTOMER, IndigitallParse.jsonFromCustomer(customer));
152
- call.resolve(ret);
153
- }
154
-
155
- @Override
156
- public void onError(ErrorModel error) {
157
- call.reject(error.getErrorMessage().getErrorMessage());
158
- }
159
- });
145
+ JSObject customerEvents = call.getObject("customerEvents");
146
+ String eventCode = customerEvents.getString("eventCode");
147
+ String eventId = customerEvents.getString("eventId");
148
+ String eventAt = customerEvents.getString("eventAt");
149
+ JSObject customData = customerEvents.getJSObject("customData");
150
+ CustomerCp.sendCustomEvent(getContext(), eventCode, eventId, eventAt, customData,
151
+ new CustomerCallback(getContext()) {
152
+ @Override
153
+ public void onSuccess(@NonNull Customer customer) {
154
+ JSObject ret = new JSObject();
155
+ ret.put(CUSTOMER, IndigitallParse.jsonFromCustomer(customer));
156
+ call.resolve(ret);
157
+ }
158
+
159
+ @Override
160
+ public void onError(ErrorModel error) {
161
+ call.reject(error.getErrorMessage().getErrorMessage());
162
+ }
163
+ });
160
164
  }
161
165
 
162
-
163
166
  }
@@ -23,21 +23,24 @@ import java.util.Objects;
23
23
 
24
24
  public class CustomerCp {
25
25
 
26
- public static void getCustomer(Context context, CustomerCallback callback){
26
+ public static void getCustomer(Context context, CustomerCallback callback) {
27
27
  CustomerIndigitall.getCustomer(context, callback);
28
28
  }
29
29
 
30
- public static void getCustomerInformation(Context context, JSArray params, final CustomerFieldCallback callback){
30
+ public static void getCustomerInformation(Context context, JSArray params, final CustomerFieldCallback callback) {
31
31
  ArrayList<String> fieldNames = IndigitallParse.parseArrayList(params);
32
32
  CustomerIndigitall.getCustomerInformation(context, fieldNames, callback);
33
33
 
34
34
  }
35
35
 
36
- public static void assignOrUpdateValueToCustomerFields(Context context, JSObject params, final CustomerCallback callback) throws JSONException {
36
+ public static void assignOrUpdateValueToCustomerFields(Context context, JSObject params,
37
+ final CustomerCallback callback) throws JSONException {
37
38
  JSONObject json = new JSONObject();
38
39
  String key = null, value = null;
39
- if (params.has("key")) key = params.getString("key");
40
- if (params.has("value")) value = params.getString("value");
40
+ if (params.has("key"))
41
+ key = params.getString("key");
42
+ if (params.has("value"))
43
+ value = params.getString("value");
41
44
  if (key != null && value != null) {
42
45
  json.put(key, value);
43
46
  CustomerIndigitall.updateValueToCustomerFields(context, json, callback);
@@ -45,23 +48,26 @@ public class CustomerCp {
45
48
 
46
49
  }
47
50
 
48
- public static void deleteValuesFromCustomerFields(Context context, JSONArray params, final CustomerCallback callback) {
51
+ public static void deleteValuesFromCustomerFields(Context context, JSONArray params,
52
+ final CustomerCallback callback) {
49
53
  ArrayList<String> fieldNames = IndigitallParse.parseArrayList(params);
50
54
  CustomerIndigitall.deleteValuesFromCustomerFields(context, fieldNames, callback);
51
55
  }
52
56
 
53
- public static void sendCustomEvent(Context context, String eventCode, JSONObject customData, final CustomerCallback callback) {
54
- CustomerIndigitall.sendCustomEvent(context, eventCode, customData, callback);
57
+ public static void sendCustomEvent(Context context, String eventCode, String eventId, String eventAt,
58
+ JSONObject customData, final CustomerCallback callback) {
59
+ CustomerIndigitall.sendCustomEvent(context, eventCode, eventId, eventAt, customData, callback);
55
60
  }
56
61
 
57
- public static void link(Context context, JSObject params, final CustomerCallback callback) throws JSONException{
62
+ public static void link(Context context, JSObject params, final CustomerCallback callback) throws JSONException {
58
63
  String JSON_EXTERNAL_ID = "externalCode";
59
64
  String JSON_CHANNEL = "channel";
60
65
  String externalId = null;
61
66
  Channel channel = Channel.PUSH;
62
67
  if (params != null && params.length() > 0) {
63
- if (params.has(JSON_EXTERNAL_ID)) externalId = params.getString(JSON_EXTERNAL_ID);
64
- if (params.has(JSON_CHANNEL) && params.getString(JSON_CHANNEL)!= null)
68
+ if (params.has(JSON_EXTERNAL_ID))
69
+ externalId = params.getString(JSON_EXTERNAL_ID);
70
+ if (params.has(JSON_CHANNEL) && params.getString(JSON_CHANNEL) != null)
65
71
  channel = IndigitallParse.parseChannel(Objects.requireNonNull(params.getString(JSON_CHANNEL)));
66
72
  }
67
73
  Channel finalChannel = channel;
@@ -70,15 +76,19 @@ public class CustomerCp {
70
76
  public void onSuccess(Device device) {
71
77
  CustomerIndigitall.link(context, finalChannel, callback);
72
78
  }
79
+
73
80
  @Override
74
- public void onFail(ErrorModel error) { callback.onFail(error); }
81
+ public void onFail(ErrorModel error) {
82
+ callback.onFail(error);
83
+ }
75
84
  });
76
85
  }
77
- public static void unlink(Context context, JSObject params, final CustomerCallback callback) throws JSONException{
86
+
87
+ public static void unlink(Context context, JSObject params, final CustomerCallback callback) throws JSONException {
78
88
  String JSON_CHANNEL = "channel";
79
89
  Channel channel = Channel.PUSH;
80
90
  if (params != null && params.length() > 0) {
81
- if (params.has(JSON_CHANNEL) && params.getString(JSON_CHANNEL)!= null)
91
+ if (params.has(JSON_CHANNEL) && params.getString(JSON_CHANNEL) != null)
82
92
  channel = IndigitallParse.parseChannel(Objects.requireNonNull(params.getString(JSON_CHANNEL)));
83
93
  }
84
94
  Channel finalChannel = channel;
@@ -89,7 +99,9 @@ public class CustomerCp {
89
99
  }
90
100
 
91
101
  @Override
92
- public void onFail(ErrorModel error) { callback.onFail(error); }
102
+ public void onFail(ErrorModel error) {
103
+ callback.onFail(error);
104
+ }
93
105
  });
94
106
  }
95
107
  }
@@ -14,6 +14,7 @@ import androidx.core.content.ContextCompat;
14
14
 
15
15
  import com.getcapacitor.JSObject;
16
16
  import com.getcapacitor.PluginCall;
17
+ import com.indigitall.android.commons.utils.CorePreferenceUtils;
17
18
  import com.indigitall.android.commons.Constants;
18
19
  import com.indigitall.android.commons.models.LogLevel;
19
20
  import com.indigitall.android.push.Configuration;
@@ -47,7 +48,8 @@ public class IndigitallCp {
47
48
  int code = Constants.REQUEST_PERMISSION_CODE;
48
49
  ArrayList<String> permissions = new ArrayList<>();
49
50
  permissions.add(permission);
50
- ActivityCompat.requestPermissions((Activity) context, permissions.toArray(new String[permissions.size()]), code);
51
+ ActivityCompat.requestPermissions((Activity) context, permissions.toArray(new String[permissions.size()]),
52
+ code);
51
53
  }
52
54
  }
53
55
 
@@ -80,6 +82,7 @@ public class IndigitallCp {
80
82
  call.reject(ex.getLocalizedMessage());
81
83
  }
82
84
  }
85
+
83
86
  public static void initialize(Context context, Activity activity, JSONObject params, InitCallBack callback) {
84
87
  final String JSON_APP_KEY = "appKey";
85
88
  final String JSON_SENDER_ID = "senderId";
@@ -119,20 +122,34 @@ public class IndigitallCp {
119
122
 
120
123
  try {
121
124
  if (params.length() > 0) {
122
- if (params.has(JSON_APP_KEY)) appKey = params.getString(JSON_APP_KEY);
123
- if (params.has(JSON_SENDER_ID)) senderId = params.getString(JSON_SENDER_ID);
124
- if (params.has(JSON_REQUEST_LOCATION)) requestLocation = params.getBoolean(JSON_REQUEST_LOCATION);
125
- if (params.has(JSON_PRODUCT_NAME)) productName = params.getString(JSON_PRODUCT_NAME);
126
- if (params.has(JSON_PRODUCT_VERSION)) productVersion = params.getString(JSON_PRODUCT_VERSION);
127
- if (params.has(JSON_WIFI_FILTER)) wifiFilterEnabled = params.getBoolean(JSON_WIFI_FILTER);
128
- if (params.has(JSON_URL_DEVICE_API)) urlDeviceApi = params.getString(JSON_URL_DEVICE_API);
129
- if (params.has(JSON_URL_INBOX_API)) urlInboxApi = params.getString(JSON_URL_INBOX_API);
130
- if (params.has(JSON_SET_ALWAYS_LAUNCH_ON_INIT)) alwaysLaunchOnInit = params.getBoolean(JSON_SET_ALWAYS_LAUNCH_ON_INIT);
131
- if (params.has(JSON_SET_AUTO_REQUEST_PUSH_PERMISSION)) autoRequestPushPermission = params.getBoolean(JSON_SET_AUTO_REQUEST_PUSH_PERMISSION);
132
- if (params.has(JSON_AVOID_CYPHER)) avoidCypher = params.getBoolean(JSON_AVOID_CYPHER);
133
- if (params.has(JSON_PUSH_DISABLED_SERVICE)) disabledPushService = params.getBoolean(JSON_PUSH_DISABLED_SERVICE);
134
- if (params.has(JSON_BACKGROUND_REQUESTS_DISABLED)) backgroundRequestsDisabled = params.getBoolean(JSON_BACKGROUND_REQUESTS_DISABLED);
135
- if (params.has(JSON_TIMEOUT_REQUESTS_IN_MILLISECONDS)) timeoutRequestsInMilliseconds = params.getInt(JSON_TIMEOUT_REQUESTS_IN_MILLISECONDS);
125
+ if (params.has(JSON_APP_KEY))
126
+ appKey = params.getString(JSON_APP_KEY);
127
+ if (params.has(JSON_SENDER_ID))
128
+ senderId = params.getString(JSON_SENDER_ID);
129
+ if (params.has(JSON_REQUEST_LOCATION))
130
+ requestLocation = params.getBoolean(JSON_REQUEST_LOCATION);
131
+ if (params.has(JSON_PRODUCT_NAME))
132
+ productName = params.getString(JSON_PRODUCT_NAME);
133
+ if (params.has(JSON_PRODUCT_VERSION))
134
+ productVersion = params.getString(JSON_PRODUCT_VERSION);
135
+ if (params.has(JSON_WIFI_FILTER))
136
+ wifiFilterEnabled = params.getBoolean(JSON_WIFI_FILTER);
137
+ if (params.has(JSON_URL_DEVICE_API))
138
+ urlDeviceApi = params.getString(JSON_URL_DEVICE_API);
139
+ if (params.has(JSON_URL_INBOX_API))
140
+ urlInboxApi = params.getString(JSON_URL_INBOX_API);
141
+ if (params.has(JSON_SET_ALWAYS_LAUNCH_ON_INIT))
142
+ alwaysLaunchOnInit = params.getBoolean(JSON_SET_ALWAYS_LAUNCH_ON_INIT);
143
+ if (params.has(JSON_SET_AUTO_REQUEST_PUSH_PERMISSION))
144
+ autoRequestPushPermission = params.getBoolean(JSON_SET_AUTO_REQUEST_PUSH_PERMISSION);
145
+ if (params.has(JSON_AVOID_CYPHER))
146
+ avoidCypher = params.getBoolean(JSON_AVOID_CYPHER);
147
+ if (params.has(JSON_PUSH_DISABLED_SERVICE))
148
+ disabledPushService = params.getBoolean(JSON_PUSH_DISABLED_SERVICE);
149
+ if (params.has(JSON_BACKGROUND_REQUESTS_DISABLED))
150
+ backgroundRequestsDisabled = params.getBoolean(JSON_BACKGROUND_REQUESTS_DISABLED);
151
+ if (params.has(JSON_TIMEOUT_REQUESTS_IN_MILLISECONDS))
152
+ timeoutRequestsInMilliseconds = params.getInt(JSON_TIMEOUT_REQUESTS_IN_MILLISECONDS);
136
153
  if (params.has(JSON_LOG_LEVEL)) {
137
154
  int logLevelNumber = params.getInt(JSON_LOG_LEVEL);
138
155
 
@@ -155,33 +172,35 @@ public class IndigitallCp {
155
172
  }
156
173
  }
157
174
 
158
- if (params.has(JSON_NOTIFICATION_CHANNEL)) {
159
- JSONObject channel = params.getJSONObject(JSON_NOTIFICATION_CHANNEL);
160
- String channelID = channel.getString(JSON_NOTIFICATION_CHANNEL_ID);
161
- String channelName = channel.getString(JSON_NOTIFICATION_CHANNEL_NAME);
175
+ if (params.has(JSON_NOTIFICATION_CHANNEL)) {
176
+ JSONObject channel = params.getJSONObject(JSON_NOTIFICATION_CHANNEL);
177
+ String channelID = channel.getString(JSON_NOTIFICATION_CHANNEL_ID);
178
+ String channelName = channel.getString(JSON_NOTIFICATION_CHANNEL_NAME);
162
179
 
163
- if (!channelID.isEmpty() && !channelName.isEmpty()) {
164
- notificationChannel = new CustomNotificationChannel(channelID, channelName);
165
- }
166
- }
180
+ if (!channelID.isEmpty() && !channelName.isEmpty()) {
181
+ notificationChannel = new CustomNotificationChannel(channelID, channelName);
182
+ }
183
+ }
167
184
  }
168
- } catch(JSONException ex) {
185
+ } catch (JSONException ex) {
169
186
  ex.printStackTrace();
170
187
  }
171
188
 
172
189
  ArrayList<String> permissions = new ArrayList<>();
173
190
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
174
191
  if (autoRequestPushPermission && Build.VERSION.SDK_INT >= 33) {
175
- if (activity.checkSelfPermission("android.permission.POST_NOTIFICATIONS") !=
176
- PackageManager.PERMISSION_GRANTED ){
192
+ if (activity.checkSelfPermission(
193
+ "android.permission.POST_NOTIFICATIONS") != PackageManager.PERMISSION_GRANTED) {
177
194
  permissions.add("android.permission.POST_NOTIFICATIONS");
178
195
  }
179
196
  }
180
- if (requestLocation && activity.checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) !=
181
- PackageManager.PERMISSION_GRANTED ){
197
+ if (requestLocation && activity.checkSelfPermission(
198
+ Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
182
199
  permissions.add(Manifest.permission.ACCESS_FINE_LOCATION);
183
200
  }
184
- if (permissions.size() > 0) ActivityCompat.requestPermissions((Activity) context, permissions.toArray(new String[permissions.size()]), Constants.REQUEST_PERMISSION_CODE);
201
+ if (permissions.size() > 0)
202
+ ActivityCompat.requestPermissions((Activity) context,
203
+ permissions.toArray(new String[permissions.size()]), Constants.REQUEST_PERMISSION_CODE);
185
204
  }
186
205
 
187
206
  if (logLevel == null) {
@@ -192,8 +211,8 @@ public class IndigitallCp {
192
211
  Configuration config = new Configuration.Builder(appKey, senderId)
193
212
  .setDefaultActivity(activity.getClass().getName())
194
213
  .setAutoRequestPermissionLocation(requestLocation)
195
- .setProductName(productName)
196
- .setProductVersion(productVersion)
214
+ // .setProductName(productName)
215
+ // .setProductVersion(productVersion)
197
216
  .wifiFilterEnabled(wifiFilterEnabled)
198
217
  .setUrlDeviceApi(urlDeviceApi)
199
218
  .setUrlInboxApi(urlInboxApi)
@@ -206,7 +225,9 @@ public class IndigitallCp {
206
225
  .setLogDebug(logLevel)
207
226
  .setCustomNotificationChannel(notificationChannel)
208
227
  .build();
209
- Indigitall.init(context,config, callback);
228
+ CorePreferenceUtils.setProductName(context, productName);
229
+ CorePreferenceUtils.setProductVersion(context, productVersion);
230
+ Indigitall.init(context, config, callback);
210
231
  }
211
232
  }
212
233
 
@@ -234,24 +255,34 @@ public class IndigitallCp {
234
255
  Indigitall.topicsUnsubscribe(context, topics, callback);
235
256
  }
236
257
 
237
- public static void sendCustomEvent(Context context, JSONObject json, EventCallback callback) throws JSONException {
258
+ public static void sendCustomEvent(Context context, JSONObject json, EventCallback callback) throws JSONException {
238
259
  String JSON_EVENT = "event";
239
260
  String JSON_EVENT_DATA = "customData";
261
+ String JSON_EVENT_ID = "eventId";
262
+ String JSON_EVENT_AT = "eventAt";
240
263
  String eventCustom = null;
264
+ String eventId = null;
265
+ String eventAt = null;
241
266
  JSONObject eventCustomData = null;
242
- if (json.has(JSON_EVENT)) eventCustom = json.getString(JSON_EVENT);
243
- if (json.has(JSON_EVENT_DATA)) eventCustomData = new JSONObject(json.getString(JSON_EVENT_DATA));
244
- Indigitall.sendCustomEvent(context, eventCustom, eventCustomData, callback);
267
+ if (json.has(JSON_EVENT))
268
+ eventCustom = json.getString(JSON_EVENT);
269
+ if (json.has(JSON_EVENT_DATA))
270
+ eventCustomData = new JSONObject(json.getString(JSON_EVENT_DATA));
271
+ if (json.has(JSON_EVENT_ID))
272
+ eventId = json.getString(JSON_EVENT_ID);
273
+ if (json.has(JSON_EVENT_AT))
274
+ eventAt = json.getString(JSON_EVENT_AT);
275
+ Indigitall.sendCustomEvent(context, eventCustom, eventId, eventAt, eventCustomData, callback);
245
276
  }
246
277
 
247
278
  public static JSONObject getPush(Context context, Intent intent) throws JSONException {
248
279
  if (intent != null && intent.getExtras() != null) {
249
280
  Bundle extras = intent.getExtras();
250
- if (extras != null && extras.containsKey(Push.EXTRA_PUSH)){
281
+ if (extras != null && extras.containsKey(Push.EXTRA_PUSH)) {
251
282
  Push push = null;
252
283
  if (context != null) {
253
284
  push = new Push(context, extras.getString(Push.EXTRA_PUSH));
254
- }else{
285
+ } else {
255
286
  push = new Push(extras.getString(Push.EXTRA_PUSH));
256
287
  }
257
288
  return IndigitallParse.jsonFromPush(push);
@@ -276,7 +307,8 @@ public class IndigitallCp {
276
307
  }
277
308
  }
278
309
 
279
- public static void isIndigitallPushNotification(Context context, JSONObject json, PluginCall call) throws JSONException {
310
+ public static void isIndigitallPushNotification(Context context, JSONObject json, PluginCall call)
311
+ throws JSONException {
280
312
  boolean isIndigitallPush = false;
281
313
  if (json != null) {
282
314
  Push push = new Push(context, json);
@@ -301,7 +333,8 @@ public class IndigitallCp {
301
333
  Indigitall.logOut(context, callback);
302
334
  }
303
335
 
304
- public static void onRequestPermissionsResult(Context context, int requestCode, String[] permissions, int[] grantResults) {
336
+ public static void onRequestPermissionsResult(Context context, int requestCode, String[] permissions,
337
+ int[] grantResults) {
305
338
  Indigitall.onRequestPermissionsResult(context, requestCode, permissions, grantResults);
306
339
  }
307
340
  }
@@ -38,8 +38,9 @@ const Customer = {
38
38
  onError(error);
39
39
  });
40
40
  },
41
- sendCustomEvent: (eventCode, customData, onSuccess, onError) => {
42
- CustomerCp.sendCustomEvent({ eventCode, customData }).then(response => {
41
+ sendCustomEvent: (customerEvents, onSuccess, onError) => {
42
+ const myCustomEvent = { customerEvents };
43
+ CustomerCp.sendCustomEvent(myCustomEvent).then(response => {
43
44
  if (onSuccess)
44
45
  onSuccess(response.customer);
45
46
  }).catch(error => {
@@ -1 +1 @@
1
- {"version":3,"file":"Customer.js","sourceRoot":"","sources":["../../src/Customer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAOjD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG9C,MAAM,UAAU,GAAG,cAAc,CAA2B,YAAY,EAAC,EAAE,CAAC,CAAC;AAE7E,MAAM,QAAQ,GAAmB;IAC7B,WAAW,EAAC,CACR,SAAgC,EAChC,OAA6B,EAC/B,EAAE;QACA,UAAU,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACrC,IAAI,SAAS;gBAAE,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;QAC/C,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YACb,IAAI,OAAO;gBAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACP,CAAC;IACD,sBAAsB,EAAC,CACnB,cAAwB,EACxB,SAAsC,EACtC,OAA6B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AC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YAClE,IAAI,SAAS;gBAAE,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YACb,IAAI,OAAO;gBAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACP,CAAC;IACD,IAAI,EAAE,CACF,MAA4B,EAC5B,SAAsB,EACtB,OAA6B,EAC/B,EAAE;QACA,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;YACxC,IAAI,SAAS;gBAAE,SAAS,EAAE,CAAC;QAC/B,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YACb,IAAI,OAAO;gBAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACP,CAAC;IACD,MAAM,EAAE,CACJ,MAA4B,EAC5B,SAAsB,EACtB,OAA6B,EAC/B,EAAE;QACA,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;YAC5C,IAAI,SAAS;gBAAE,SAAS,EAAE,CAAC;QAC/B,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YACb,IAAI,OAAO;gBAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACP,CAAC;CAEJ,CAAA;AAED,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAA","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { OnCustomerFieldSuccessType, OnCustomerSuccessType, OnErrorCallbackType } from './callbacks/callbacksType';\nimport type { \n CustomerPlugin,\n IndigitallCustomerPlugin,\n} from './definitions/customerDefinitions';\nimport { Channel } from './models/InCustomer';\nimport type { OnCustomerFieldParams, OnLinkCustomerParams } from './params/customerParams';\n\nconst CustomerCp = registerPlugin<IndigitallCustomerPlugin>('CustomerCp',{});\n\nconst Customer: CustomerPlugin = {\n getCustomer:(\n onSuccess: OnCustomerSuccessType,\n onError?: OnErrorCallbackType\n ) => {\n CustomerCp.getCustomer().then(response => {\n if (onSuccess) onSuccess(response.customer)\n }).catch(error => {\n if (onError) onError(error);\n });\n },\n getCustomerInformation:(\n fieldNamesList: string[],\n onSuccess?: OnCustomerFieldSuccessType,\n onError?: OnErrorCallbackType\n ) => {\n CustomerCp.getCustomerInformation({ fieldNamesList }).then(response => {\n if (onSuccess) onSuccess(response.customerField);\n }).catch(error => {\n if (onError) onError(error);\n });\n },\n assignOrUpdateValueToCustomerFields: (\n fields: OnCustomerFieldParams,\n onSuccess?: OnCustomerSuccessType,\n onError?: OnErrorCallbackType\n ) => {\n CustomerCp.assignOrUpdateValueToCustomerFields({ customerFields: fields }).then(response => {\n if (onSuccess) onSuccess(response.customer);\n }).catch(error => {\n if (onError) onError(error);\n });\n },\n deleteValuesFromCustomerFields: (\n fieldNamesList: string[],\n onSuccess?: OnCustomerSuccessType,\n onError?: OnErrorCallbackType\n ) => {\n CustomerCp.deleteValuesFromCustomerFields({ fieldNamesList }).then(response => {\n if (onSuccess) onSuccess(response.customer);\n }).catch(error => {\n if (onError) onError(error);\n });\n },\n sendCustomEvent: (\n eventCode: string,\n customData: any, \n onSuccess?: OnCustomerSuccessType,\n onError?: OnErrorCallbackType\n ) => {\n CustomerCp.sendCustomEvent({ eventCode, customData }).then(response => {\n if (onSuccess) onSuccess(response.customer);\n }).catch(error => {\n if (onError) onError(error);\n });\n },\n link: (\n params: OnLinkCustomerParams,\n onSuccess?: () => void,\n onError?: OnErrorCallbackType\n ) => {\n CustomerCp.link({ link: params }).then(() => {\n if (onSuccess) onSuccess();\n }).catch(error => {\n if (onError) onError(error);\n });\n },\n unlink: (\n params: OnLinkCustomerParams,\n onSuccess?: () => void,\n onError?: OnErrorCallbackType\n ) => {\n CustomerCp.unlink({ unlink: params }).then(() => {\n if (onSuccess) onSuccess();\n }).catch(error => {\n if (onError) onError(error);\n });\n }\n \n}\n\nexport { Customer, Channel }"]}
1
+ {"version":3,"file":"Customer.js","sourceRoot":"","sources":["../../src/Customer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAOjD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG9C,MAAM,UAAU,GAAG,cAAc,CAA2B,YAAY,EAAE,EAAE,CAAC,CAAC;AAE9E,MAAM,QAAQ,GAAmB;IAC7B,WAAW,EAAE,CACT,SAAgC,EAChC,OAA6B,EAC/B,EAAE;QACA,UAAU,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACrC,IAAI,SAAS;gBAAE,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;QAC/C,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YACb,IAAI,OAAO;gBAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACP,CAAC;IACD,sBAAsB,EAAE,CACpB,cAAwB,EACxB,SAAsC,EACtC,OAA6B,EAC/B,EAAE;QACA,UAAU,CAAC,sBAAsB,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YAClE,IAAI,SAAS;gBAAE,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YACb,IAAI,OAAO;gBAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACP,CAAC;IACD,mCAAmC,EAAE,CACjC,MAA6B,EAC7B,SAAiC,EACjC,OAA6B,EAC/B,EAAE;QACA,UAAU,CAAC,mCAAmC,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,CA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SAAS,EAAE,CAAC;QAC/B,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YACb,IAAI,OAAO;gBAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACP,CAAC;IACD,MAAM,EAAE,CACJ,MAA4B,EAC5B,SAAsB,EACtB,OAA6B,EAC/B,EAAE;QACA,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;YAC5C,IAAI,SAAS;gBAAE,SAAS,EAAE,CAAC;QAC/B,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YACb,IAAI,OAAO;gBAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACP,CAAC;CAEJ,CAAA;AAED,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAA","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { OnCustomerFieldSuccessType, OnCustomerSuccessType, OnErrorCallbackType } from './callbacks/callbacksType';\nimport type {\n CustomerPlugin,\n IndigitallCustomerPlugin,\n} from './definitions/customerDefinitions';\nimport { Channel } from './models/InCustomer';\nimport type { OnCustomerFieldParams, OnLinkCustomerParams, CustomerEventParams } from './params/customerParams';\n\nconst CustomerCp = registerPlugin<IndigitallCustomerPlugin>('CustomerCp', {});\n\nconst Customer: CustomerPlugin = {\n getCustomer: (\n onSuccess: OnCustomerSuccessType,\n onError?: OnErrorCallbackType\n ) => {\n CustomerCp.getCustomer().then(response => {\n if (onSuccess) onSuccess(response.customer)\n }).catch(error => {\n if (onError) onError(error);\n });\n },\n getCustomerInformation: (\n fieldNamesList: string[],\n onSuccess?: OnCustomerFieldSuccessType,\n onError?: OnErrorCallbackType\n ) => {\n CustomerCp.getCustomerInformation({ fieldNamesList }).then(response => {\n if (onSuccess) onSuccess(response.customerField);\n }).catch(error => {\n if (onError) onError(error);\n });\n },\n assignOrUpdateValueToCustomerFields: (\n fields: OnCustomerFieldParams,\n onSuccess?: OnCustomerSuccessType,\n onError?: OnErrorCallbackType\n ) => {\n CustomerCp.assignOrUpdateValueToCustomerFields({ customerFields: fields }).then(response => {\n if (onSuccess) onSuccess(response.customer);\n }).catch(error => {\n if (onError) onError(error);\n });\n },\n deleteValuesFromCustomerFields: (\n fieldNamesList: string[],\n onSuccess?: OnCustomerSuccessType,\n onError?: OnErrorCallbackType\n ) => {\n CustomerCp.deleteValuesFromCustomerFields({ fieldNamesList }).then(response => {\n if (onSuccess) onSuccess(response.customer);\n }).catch(error => {\n if (onError) onError(error);\n });\n },\n sendCustomEvent: (\n customerEvents: CustomerEventParams,\n onSuccess?: OnCustomerSuccessType,\n onError?: OnErrorCallbackType\n ) => {\n const myCustomEvent = { customerEvents };\n CustomerCp.sendCustomEvent(myCustomEvent).then(response => {\n if (onSuccess) onSuccess(response.customer);\n }).catch(error => {\n if (onError) onError(error);\n });\n },\n link: (\n params: OnLinkCustomerParams,\n onSuccess?: () => void,\n onError?: OnErrorCallbackType\n ) => {\n CustomerCp.link({ link: params }).then(() => {\n if (onSuccess) onSuccess();\n }).catch(error => {\n if (onError) onError(error);\n });\n },\n unlink: (\n params: OnLinkCustomerParams,\n onSuccess?: () => void,\n onError?: OnErrorCallbackType\n ) => {\n CustomerCp.unlink({ unlink: params }).then(() => {\n if (onSuccess) onSuccess();\n }).catch(error => {\n if (onError) onError(error);\n });\n }\n\n}\n\nexport { Customer, Channel }"]}
package/dist/esm/Push.js CHANGED
@@ -5,7 +5,7 @@ const IndigitallCp = registerPlugin('IndigitallCp', {
5
5
  const Indigitall = {
6
6
  init: (config, onIndigitallInitializedType, onError) => {
7
7
  Object.assign(config, {
8
- productVersion: '2.17.0',
8
+ productVersion: '2.18.0',
9
9
  productName: 'capacitor',
10
10
  });
11
11
  IndigitallCp.initialize({ config }).then(onInit => {
@@ -1 +1 @@
1
- {"version":3,"file":"Push.js","sourceRoot":"","sources":["../../src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AC,CAAC;QACnC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YACb,IAAI,OAAO;gBACP,OAAO,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACP,CAAC;IAED,qBAAqB,EAAE,GAAG,EAAE;QACxB,YAAY,CAAC,qBAAqB,EAAE,CAAC;IACzC,CAAC;IACD,uBAAuB,EAAE,CAAC,SAA8B,EAAE,EAAE;QACxD,YAAY,CAAC,uBAAuB,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACnD,SAAS,CAAC,QAAQ,CAAC,CAAC;QACxB,CAAC,CAAC,CAAC;IACP,CAAC;IACD,YAAY,EAAE,KAAK,WAAW,YAAkB;QAC9C,MAAM,YAAY,CAAC,YAAY,CAAC,EAAC,YAAY,EAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YAC5D,OAAO,QAAQ,CAAC,KAAK,CAAC;QAC1B,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;YACV,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC;CACJ,CAAA;AAED,OAAO,EAAE,UAAU,EAAE,CAAA","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { \n OnIndigitallInitializedType, \n OnDeviceSuccessType,\n OnStatusSuccessType,\n OnTopicSuccessType,\n OnPushSuccessType,\n OnErrorCallbackType,\n OnMessageReceivedSuccessType,\n OnTokenSuccessType,\n } from './callbacks/callbacksType';\nimport type { \n IndigitallCpPlugin, \n IndigitallPlugin\n } from './definitions/pushDefinitions';\nimport type {\n EventParams,\n InitParams,\n } from './params/pushParams';\n\nconst IndigitallCp = registerPlugin<IndigitallCpPlugin>('IndigitallCp', {\n //web: () => import('./web').then(m => new m.IndigitallCpWeb()),\n });\n\n const Indigitall: IndigitallPlugin = {\n init: (\n config: InitParams,\n onIndigitallInitializedType?: OnIndigitallInitializedType,\n onError?: OnErrorCallbackType\n ) => {\n Object.assign(config, {\n productVersion: '2.17.0',\n productName: 'capacitor',\n });\n IndigitallCp.initialize({ config }).then(onInit => {\n if (onIndigitallInitializedType)\n onIndigitallInitializedType(onInit[\"device\"], onInit[\"pushPermission\"], onInit[\"locationPermission\"]);\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n deviceGet: (\n onSuccess: OnDeviceSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.deviceGet().then(response => {\n onSuccess(response.device);\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n deviceEnable: (\n onSuccess?: OnDeviceSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.deviceEnable().then(response => {\n if (onSuccess)\n onSuccess(response.device);\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n deviceDisable: (\n onSuccess?: OnDeviceSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.deviceDisable().then(response => {\n if (onSuccess)\n onSuccess(response.device);\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n topicsList: (\n onSuccess?: OnTopicSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.topicsList().then(response => {\n if (onSuccess)\n onSuccess(response.topics);\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n topicsSubscribe: (\n topics: string[],\n onSuccess?: OnTopicSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.topicsSubscribe({ topics }).then(response => {\n if (onSuccess)\n onSuccess(response.topics);\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n topicsUnsubscribe: (\n topics: string[],\n onSuccess?: OnTopicSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.topicsUnsubscribe({ topics }).then(response => {\n if (onSuccess)\n onSuccess(response.topics);\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n sendCustomEvent: (\n customEvent: EventParams,\n onSuccess?: () => void,\n onError?: OnErrorCallbackType) => {\n const myCustomEvent = { customEvent };\n IndigitallCp.sendCustomEvent(myCustomEvent).then(() => {\n if (onSuccess)\n onSuccess();\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n getPush: (\n onSuccess: OnPushSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.getPush(onSuccess, onError);\n },\n onIndigitallGetPush: (\n onSuccess: OnPushSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.onIndigitallGetPush(onSuccess, onError);\n },\n clearViewUrl: () => {\n IndigitallCp.clearViewUrl();\n },\n setDefaultViewUrl: (defaultView: string) => {\n IndigitallCp.setDefaultViewUrl({ defaultView });\n },\n onMessageReceived: (\n onSuccess: OnMessageReceivedSuccessType) => {\n IndigitallCp.onMessageReceived(onSuccess);\n },\n getToken: (\n onSuccess: OnTokenSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.getToken().then(response => {\n onSuccess(response.token);\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n isIndigitallPushNotification: (\n notification: any,\n onSuccess: () => void,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.isIndigitallPushNotification({ notification }).then(() => {\n onSuccess();\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n logIn: (\n externalCode: string,\n onSuccess?: OnDeviceSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.logIn({ externalCode }).then(response => {\n if (onSuccess)\n onSuccess(response.device);\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n logOut: (\n onSuccess?: OnDeviceSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.logOut().then(response => {\n if (onSuccess)\n onSuccess(response.device);\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n\n requestPushPermission: () => {\n IndigitallCp.requestPushPermission();\n },\n getPushPermissionStatus: (onSuccess: OnStatusSuccessType) => {\n IndigitallCp.getPushPermissionStatus().then(response => {\n onSuccess(response);\n });\n },\n isPushSecure: async function (notification: JSON): Promise<any> {\n await IndigitallCp.isPushSecure({notification}).then(response => {\n return response.state;\n }).catch(() =>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,CAAC,QAAQ,CAAC,EAAE;YAClC,IAAI,SAAS;gBACT,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YACb,IAAI,OAAO;gBACP,OAAO,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACP,CAAC;IAED,qBAAqB,EAAE,GAAG,EAAE;QACxB,YAAY,CAAC,qBAAqB,EAAE,CAAC;IACzC,CAAC;IACD,uBAAuB,EAAE,CAAC,SAA8B,EAAE,EAAE;QACxD,YAAY,CAAC,uBAAuB,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACnD,SAAS,CAAC,QAAQ,CAAC,CAAC;QACxB,CAAC,CAAC,CAAC;IACP,CAAC;IACD,YAAY,EAAE,KAAK,WAAW,YAAkB;QAC5C,MAAM,YAAY,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YAC9D,OAAO,QAAQ,CAAC,KAAK,CAAC;QAC1B,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;YACV,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AAED,OAAO,EAAE,UAAU,EAAE,CAAA","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type {\n OnIndigitallInitializedType,\n OnDeviceSuccessType,\n OnStatusSuccessType,\n OnTopicSuccessType,\n OnPushSuccessType,\n OnErrorCallbackType,\n OnMessageReceivedSuccessType,\n OnTokenSuccessType,\n} from './callbacks/callbacksType';\nimport type {\n IndigitallCpPlugin,\n IndigitallPlugin\n} from './definitions/pushDefinitions';\nimport type {\n EventParams,\n InitParams,\n} from './params/pushParams';\n\nconst IndigitallCp = registerPlugin<IndigitallCpPlugin>('IndigitallCp', {\n //web: () => import('./web').then(m => new m.IndigitallCpWeb()),\n});\n\nconst Indigitall: IndigitallPlugin = {\n init: (\n config: InitParams,\n onIndigitallInitializedType?: OnIndigitallInitializedType,\n onError?: OnErrorCallbackType\n ) => {\n Object.assign(config, {\n productVersion: '2.18.0',\n productName: 'capacitor',\n });\n IndigitallCp.initialize({ config }).then(onInit => {\n if (onIndigitallInitializedType)\n onIndigitallInitializedType(onInit[\"device\"], onInit[\"pushPermission\"], onInit[\"locationPermission\"]);\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n deviceGet: (\n onSuccess: OnDeviceSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.deviceGet().then(response => {\n onSuccess(response.device);\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n deviceEnable: (\n onSuccess?: OnDeviceSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.deviceEnable().then(response => {\n if (onSuccess)\n onSuccess(response.device);\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n deviceDisable: (\n onSuccess?: OnDeviceSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.deviceDisable().then(response => {\n if (onSuccess)\n onSuccess(response.device);\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n topicsList: (\n onSuccess?: OnTopicSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.topicsList().then(response => {\n if (onSuccess)\n onSuccess(response.topics);\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n topicsSubscribe: (\n topics: string[],\n onSuccess?: OnTopicSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.topicsSubscribe({ topics }).then(response => {\n if (onSuccess)\n onSuccess(response.topics);\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n topicsUnsubscribe: (\n topics: string[],\n onSuccess?: OnTopicSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.topicsUnsubscribe({ topics }).then(response => {\n if (onSuccess)\n onSuccess(response.topics);\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n sendCustomEvent: (\n customEvent: EventParams,\n onSuccess?: () => void,\n onError?: OnErrorCallbackType) => {\n const myCustomEvent = { customEvent };\n IndigitallCp.sendCustomEvent(myCustomEvent).then(() => {\n if (onSuccess)\n onSuccess();\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n getPush: (\n onSuccess: OnPushSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.getPush(onSuccess, onError);\n },\n onIndigitallGetPush: (\n onSuccess: OnPushSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.onIndigitallGetPush(onSuccess, onError);\n },\n clearViewUrl: () => {\n IndigitallCp.clearViewUrl();\n },\n setDefaultViewUrl: (defaultView: string) => {\n IndigitallCp.setDefaultViewUrl({ defaultView });\n },\n onMessageReceived: (\n onSuccess: OnMessageReceivedSuccessType) => {\n IndigitallCp.onMessageReceived(onSuccess);\n },\n getToken: (\n onSuccess: OnTokenSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.getToken().then(response => {\n onSuccess(response.token);\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n isIndigitallPushNotification: (\n notification: any,\n onSuccess: () => void,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.isIndigitallPushNotification({ notification }).then(() => {\n onSuccess();\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n logIn: (\n externalCode: string,\n onSuccess?: OnDeviceSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.logIn({ externalCode }).then(response => {\n if (onSuccess)\n onSuccess(response.device);\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n logOut: (\n onSuccess?: OnDeviceSuccessType,\n onError?: OnErrorCallbackType) => {\n IndigitallCp.logOut().then(response => {\n if (onSuccess)\n onSuccess(response.device);\n }).catch(error => {\n if (onError)\n onError(error);\n });\n },\n\n requestPushPermission: () => {\n IndigitallCp.requestPushPermission();\n },\n getPushPermissionStatus: (onSuccess: OnStatusSuccessType) => {\n IndigitallCp.getPushPermissionStatus().then(response => {\n onSuccess(response);\n });\n },\n isPushSecure: async function (notification: JSON): Promise<any> {\n await IndigitallCp.isPushSecure({ notification }).then(response => {\n return response.state;\n }).catch(() => {\n return false;\n });\n }\n}\n\nexport { Indigitall }\n\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { OnCustomerSuccessType, OnCustomerFieldSuccessType, OnErrorCallbackType } from '../callbacks/callbacksType';
2
- import type { OnCustomerFieldParams, OnLinkCustomerParams } from '../params/customerParams';
2
+ import type { OnCustomerFieldParams, OnLinkCustomerParams, CustomerEventParams } from '../params/customerParams';
3
3
  export interface IndigitallCustomerPlugin {
4
4
  getCustomer(): Promise<any>;
5
5
  getCustomerInformation(params: {
@@ -12,8 +12,7 @@ export interface IndigitallCustomerPlugin {
12
12
  fieldNamesList: string[];
13
13
  }): Promise<any>;
14
14
  sendCustomEvent(params: {
15
- eventCode: string;
16
- customData: any;
15
+ customerEvents: any;
17
16
  }): Promise<any>;
18
17
  link(params: {
19
18
  link: {
@@ -33,7 +32,7 @@ export interface CustomerPlugin {
33
32
  getCustomerInformation: (fieldNamesList: string[], onSuccess?: OnCustomerFieldSuccessType, onError?: OnErrorCallbackType) => void;
34
33
  assignOrUpdateValueToCustomerFields: (params: OnCustomerFieldParams, onSuccess?: OnCustomerSuccessType, onError?: OnErrorCallbackType) => void;
35
34
  deleteValuesFromCustomerFields: (fieldNamesList: string[], onSuccess?: OnCustomerSuccessType, onError?: OnErrorCallbackType) => void;
36
- sendCustomEvent: (eventCode: string, customData: any, onSuccess?: OnCustomerSuccessType, onError?: OnErrorCallbackType) => void;
35
+ sendCustomEvent: (params: CustomerEventParams, onSuccess?: OnCustomerSuccessType, onError?: OnErrorCallbackType) => void;
37
36
  link: (params: OnLinkCustomerParams, onSuccess?: () => void, onError?: OnErrorCallbackType) => void;
38
37
  unlink: (params: OnLinkCustomerParams, onSuccess?: () => void, onError?: OnErrorCallbackType) => void;
39
38
  }
@@ -1 +1 @@
1
- {"version":3,"file":"customerDefinitions.js","sourceRoot":"","sources":["../../../src/definitions/customerDefinitions.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n OnCustomerSuccessType,\n OnCustomerFieldSuccessType,\n OnErrorCallbackType,\n } from '../callbacks/callbacksType';\nimport type { \n OnCustomerFieldParams,\n OnLinkCustomerParams\n} from '../params/customerParams';\n\nexport interface IndigitallCustomerPlugin {\n getCustomer(): Promise<any>;\n getCustomerInformation(params: { fieldNamesList: string[]}): Promise<any>;\n assignOrUpdateValueToCustomerFields(params: { customerFields: any}): Promise<any>;\n deleteValuesFromCustomerFields(params: { fieldNamesList: string[]}): Promise<any>;\n sendCustomEvent(params: { eventCode: string, customData: any}): Promise<any>;\n link(params: { link: {externalCode?: string; channel: string;} }): Promise<void>;\n unlink(params: { unlink: {externalCode?: string; channel: string;} }): Promise<void>;\n }\n export interface CustomerPlugin {\n getCustomer: (\n onSuccess: OnCustomerSuccessType,\n onError?: OnErrorCallbackType\n ) => void;\n getCustomerInformation: (\n fieldNamesList: string[],\n onSuccess?: OnCustomerFieldSuccessType,\n onError?: OnErrorCallbackType\n ) => void;\n assignOrUpdateValueToCustomerFields: (\n params: OnCustomerFieldParams,\n onSuccess?: OnCustomerSuccessType,\n onError?: OnErrorCallbackType\n ) => void;\n deleteValuesFromCustomerFields: (\n fieldNamesList: string[],\n onSuccess?: OnCustomerSuccessType,\n onError?: OnErrorCallbackType\n ) => void;\n sendCustomEvent: (\n eventCode: string,\n customData: any, \n onSuccess?: OnCustomerSuccessType,\n onError?: OnErrorCallbackType\n ) => void;\n link: (\n params: OnLinkCustomerParams,\n onSuccess?: () => void,\n onError?: OnErrorCallbackType\n ) => void;\n unlink: (\n params: OnLinkCustomerParams,\n onSuccess?: () => void,\n onError?: OnErrorCallbackType\n ) => void;\n }"]}
1
+ {"version":3,"file":"customerDefinitions.js","sourceRoot":"","sources":["../../../src/definitions/customerDefinitions.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n OnCustomerSuccessType,\n OnCustomerFieldSuccessType,\n OnErrorCallbackType,\n} from '../callbacks/callbacksType';\nimport type {\n OnCustomerFieldParams,\n OnLinkCustomerParams,\n CustomerEventParams\n} from '../params/customerParams';\n\nexport interface IndigitallCustomerPlugin {\n getCustomer(): Promise<any>;\n getCustomerInformation(params: { fieldNamesList: string[] }): Promise<any>;\n assignOrUpdateValueToCustomerFields(params: { customerFields: any }): Promise<any>;\n deleteValuesFromCustomerFields(params: { fieldNamesList: string[] }): Promise<any>;\n sendCustomEvent(params: { customerEvents: any }): Promise<any>;\n link(params: { link: { externalCode?: string; channel: string; } }): Promise<void>;\n unlink(params: { unlink: { externalCode?: string; channel: string; } }): Promise<void>;\n}\nexport interface CustomerPlugin {\n getCustomer: (\n onSuccess: OnCustomerSuccessType,\n onError?: OnErrorCallbackType\n ) => void;\n getCustomerInformation: (\n fieldNamesList: string[],\n onSuccess?: OnCustomerFieldSuccessType,\n onError?: OnErrorCallbackType\n ) => void;\n assignOrUpdateValueToCustomerFields: (\n params: OnCustomerFieldParams,\n onSuccess?: OnCustomerSuccessType,\n onError?: OnErrorCallbackType\n ) => void;\n deleteValuesFromCustomerFields: (\n fieldNamesList: string[],\n onSuccess?: OnCustomerSuccessType,\n onError?: OnErrorCallbackType\n ) => void;\n sendCustomEvent: (\n params: CustomerEventParams,\n onSuccess?: OnCustomerSuccessType,\n onError?: OnErrorCallbackType\n ) => void;\n link: (\n params: OnLinkCustomerParams,\n onSuccess?: () => void,\n onError?: OnErrorCallbackType\n ) => void;\n unlink: (\n params: OnLinkCustomerParams,\n onSuccess?: () => void,\n onError?: OnErrorCallbackType\n ) => void;\n}"]}
@@ -9,3 +9,9 @@ export declare type OnLinkCustomerParams = {
9
9
  export declare type OnCustomerDeleteValuesParams = {
10
10
  fieldNames: [string];
11
11
  };
12
+ export declare type CustomerEventParams = {
13
+ eventId?: string;
14
+ eventAt?: string;
15
+ event: string;
16
+ customData: any;
17
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"customerParams.js","sourceRoot":"","sources":["../../../src/params/customerParams.ts"],"names":[],"mappings":"AAAA,UAAU","sourcesContent":["//Customer\n\nimport type { Channel } from \"../models/InCustomer\";\n\nexport type OnCustomerFieldParams = {\n fields: any\n};\n\nexport type OnLinkCustomerParams = {\n externalCode?: string;\n channel: Channel;\n};\n\nexport type OnCustomerDeleteValuesParams = {\n fieldNames: [string];\n};"]}
1
+ {"version":3,"file":"customerParams.js","sourceRoot":"","sources":["../../../src/params/customerParams.ts"],"names":[],"mappings":"AAAA,UAAU","sourcesContent":["//Customer\n\nimport type { Channel } from \"../models/InCustomer\";\n\nexport type OnCustomerFieldParams = {\n fields: any\n};\n\nexport type OnLinkCustomerParams = {\n externalCode?: string;\n channel: Channel;\n};\n\nexport type OnCustomerDeleteValuesParams = {\n fieldNames: [string];\n};\n\nexport type CustomerEventParams = {\n eventId?: string;\n eventAt?: string;\n event: string;\n customData: any;\n};"]}
@@ -22,6 +22,8 @@ export declare type TopicParams = {
22
22
  code: [Topic];
23
23
  };
24
24
  export declare type EventParams = {
25
+ eventId?: string;
26
+ eventAt?: string;
25
27
  event: string;
26
28
  customData: any;
27
29
  };
@@ -1 +1 @@
1
- {"version":3,"file":"pushParams.js","sourceRoot":"","sources":["../../../src/params/pushParams.ts"],"names":[],"mappings":"AA4BA,MAAM,CAAN,IAAY,QAKX;AALD,WAAY,QAAQ;IAChB,yCAAS,CAAA;IACT,uCAAI,CAAA;IACJ,6CAAO,CAAA;IACP,yCAAK,CAAA;AACT,CAAC,EALW,QAAQ,KAAR,QAAQ,QAKnB","sourcesContent":["import type { Topic } from '../models/InDevice';\n\nexport type InitParams = {\n appKey: string;\n senderId: string;\n requestLocation?: boolean;\n wifiFilterEnabled?: boolean;\n urlDeviceApi?: string;\n urlInAppApi?: string;\n urlInboxApi?: string;\n debugMode?: boolean;\n forceSimulatorToken?: boolean;\n alwaysLaunchOnInit?: boolean;\n autoRequestPushPermission?: boolean;\n disabledPushService?: boolean;\n logLevel?: LogLevel;\n customNotificationChannel?: CustomNotificationChannel\n};\nexport type TopicStringParams = {\n code: [string];\n};\nexport type TopicParams = {\n code: [Topic];\n};\nexport type EventParams = {\n event: string;\n customData: any;\n};\nexport enum LogLevel {\n DEBUG = 1,\n INFO,\n WARNING,\n ERROR,\n}\nexport interface CustomNotificationChannel {\n channelID: string;\n channelName: string;\n}\n"]}
1
+ {"version":3,"file":"pushParams.js","sourceRoot":"","sources":["../../../src/params/pushParams.ts"],"names":[],"mappings":"AA8BA,MAAM,CAAN,IAAY,QAKX;AALD,WAAY,QAAQ;IAChB,yCAAS,CAAA;IACT,uCAAI,CAAA;IACJ,6CAAO,CAAA;IACP,yCAAK,CAAA;AACT,CAAC,EALW,QAAQ,KAAR,QAAQ,QAKnB","sourcesContent":["import type { Topic } from '../models/InDevice';\n\nexport type InitParams = {\n appKey: string;\n senderId: string;\n requestLocation?: boolean;\n wifiFilterEnabled?: boolean;\n urlDeviceApi?: string;\n urlInAppApi?: string;\n urlInboxApi?: string;\n debugMode?: boolean;\n forceSimulatorToken?: boolean;\n alwaysLaunchOnInit?: boolean;\n autoRequestPushPermission?: boolean;\n disabledPushService?: boolean;\n logLevel?: LogLevel;\n customNotificationChannel?: CustomNotificationChannel\n};\nexport type TopicStringParams = {\n code: [string];\n};\nexport type TopicParams = {\n code: [Topic];\n};\nexport type EventParams = {\n eventId?: string;\n eventAt?: string;\n event: string;\n customData: any;\n};\nexport enum LogLevel {\n DEBUG = 1,\n INFO,\n WARNING,\n ERROR,\n}\nexport interface CustomNotificationChannel {\n channelID: string;\n channelName: string;\n}\n"]}
@@ -10,7 +10,7 @@ const IndigitallCp = core.registerPlugin('IndigitallCp', {
10
10
  const Indigitall = {
11
11
  init: (config, onIndigitallInitializedType, onError) => {
12
12
  Object.assign(config, {
13
- productVersion: '2.17.0',
13
+ productVersion: '2.18.0',
14
14
  productName: 'capacitor',
15
15
  });
16
16
  IndigitallCp.initialize({ config }).then(onInit => {
@@ -195,8 +195,9 @@ const Customer = {
195
195
  onError(error);
196
196
  });
197
197
  },
198
- sendCustomEvent: (eventCode, customData, onSuccess, onError) => {
199
- CustomerCp.sendCustomEvent({ eventCode, customData }).then(response => {
198
+ sendCustomEvent: (customerEvents, onSuccess, onError) => {
199
+ const myCustomEvent = { customerEvents };
200
+ CustomerCp.sendCustomEvent(myCustomEvent).then(response => {
200
201
  if (onSuccess)
201
202
  onSuccess(response.customer);
202
203
  }).catch(error => {