capacitor-gleap-plugin 18.0.0 → 19.0.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/CapacitorGleapPlugin.podspec +7 -2
- package/Package.swift +31 -0
- package/README.md +307 -761
- package/android/build.gradle +1 -1
- package/android/src/main/java/io/gleapplugins/capacitor/GleapPlugin.java +228 -37
- package/dist/docs.json +323 -3907
- package/dist/esm/definitions.d.ts +168 -3
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.js +9 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/logs/body.d.ts +58 -0
- package/dist/esm/logs/body.js +303 -0
- package/dist/esm/logs/body.js.map +1 -0
- package/dist/esm/logs/consoleCapture.d.ts +29 -0
- package/dist/esm/logs/consoleCapture.js +189 -0
- package/dist/esm/logs/consoleCapture.js.map +1 -0
- package/dist/esm/logs/format.d.ts +16 -0
- package/dist/esm/logs/format.js +394 -0
- package/dist/esm/logs/format.js.map +1 -0
- package/dist/esm/logs/networkCapture.d.ts +65 -0
- package/dist/esm/logs/networkCapture.js +654 -0
- package/dist/esm/logs/networkCapture.js.map +1 -0
- package/dist/esm/logs/redaction.d.ts +54 -0
- package/dist/esm/logs/redaction.js +388 -0
- package/dist/esm/logs/redaction.js.map +1 -0
- package/dist/esm/logs/webViewLogs.d.ts +70 -0
- package/dist/esm/logs/webViewLogs.js +297 -0
- package/dist/esm/logs/webViewLogs.js.map +1 -0
- package/dist/esm/logs/zone.d.ts +5 -0
- package/dist/esm/logs/zone.js +15 -0
- package/dist/esm/logs/zone.js.map +1 -0
- package/dist/esm/web.d.ts +47 -2
- package/dist/esm/web.js +43 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +2263 -1
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +2263 -1
- package/dist/plugin.js.map +1 -1
- package/ios/{Plugin → Sources/GleapPlugin}/GleapPlugin.swift +222 -12
- package/package.json +27 -6
- package/ios/Plugin/GleapPlugin.h +0 -10
- package/ios/Plugin/GleapPlugin.m +0 -66
- package/ios/Plugin/Info.plist +0 -24
|
@@ -7,13 +7,89 @@ import Gleap
|
|
|
7
7
|
* here: https://capacitorjs.com/docs/plugins/ios
|
|
8
8
|
*/
|
|
9
9
|
@objc(GleapPlugin)
|
|
10
|
-
public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
10
|
+
public class GleapPlugin: CAPPlugin, CAPBridgedPlugin, GleapDelegate {
|
|
11
|
+
// Registers the plugin with Capacitor (replaces the CAP_PLUGIN macros of the former GleapPlugin.m,
|
|
12
|
+
// which Swift Package Manager cannot build next to Swift in one target).
|
|
13
|
+
public let identifier = "GleapPlugin"
|
|
14
|
+
public let jsName = "Gleap"
|
|
15
|
+
public let pluginMethods: [CAPPluginMethod] = [
|
|
16
|
+
CAPPluginMethod(name: "initialize", returnType: CAPPluginReturnPromise),
|
|
17
|
+
CAPPluginMethod(name: "setRegion", returnType: CAPPluginReturnPromise),
|
|
18
|
+
CAPPluginMethod(name: "setApiUrl", returnType: CAPPluginReturnPromise),
|
|
19
|
+
CAPPluginMethod(name: "setWSApiUrl", returnType: CAPPluginReturnPromise),
|
|
20
|
+
CAPPluginMethod(name: "setRealtimeHost", returnType: CAPPluginReturnPromise),
|
|
21
|
+
CAPPluginMethod(name: "setFrameUrl", returnType: CAPPluginReturnPromise),
|
|
22
|
+
CAPPluginMethod(name: "setBannerUrl", returnType: CAPPluginReturnPromise),
|
|
23
|
+
CAPPluginMethod(name: "setModalUrl", returnType: CAPPluginReturnPromise),
|
|
24
|
+
CAPPluginMethod(name: "identify", returnType: CAPPluginReturnPromise),
|
|
25
|
+
CAPPluginMethod(name: "updateContact", returnType: CAPPluginReturnPromise),
|
|
26
|
+
CAPPluginMethod(name: "clearIdentity", returnType: CAPPluginReturnPromise),
|
|
27
|
+
CAPPluginMethod(name: "setNetworkLogsBlacklist", returnType: CAPPluginReturnPromise),
|
|
28
|
+
CAPPluginMethod(name: "setNetworkLogPropsToIgnore", returnType: CAPPluginReturnPromise),
|
|
29
|
+
CAPPluginMethod(name: "setEnvDataPropsToIgnore", returnType: CAPPluginReturnPromise),
|
|
30
|
+
CAPPluginMethod(name: "attachNetworkLogs", returnType: CAPPluginReturnPromise),
|
|
31
|
+
CAPPluginMethod(name: "attachConsoleLogs", returnType: CAPPluginReturnPromise),
|
|
32
|
+
CAPPluginMethod(name: "attachCustomData", returnType: CAPPluginReturnPromise),
|
|
33
|
+
CAPPluginMethod(name: "setCustomData", returnType: CAPPluginReturnPromise),
|
|
34
|
+
CAPPluginMethod(name: "removeCustomData", returnType: CAPPluginReturnPromise),
|
|
35
|
+
CAPPluginMethod(name: "clearCustomData", returnType: CAPPluginReturnPromise),
|
|
36
|
+
CAPPluginMethod(name: "setTicketAttribute", returnType: CAPPluginReturnPromise),
|
|
37
|
+
CAPPluginMethod(name: "unsetTicketAttribute", returnType: CAPPluginReturnPromise),
|
|
38
|
+
CAPPluginMethod(name: "clearTicketAttributes", returnType: CAPPluginReturnPromise),
|
|
39
|
+
CAPPluginMethod(name: "registerAgentTool", returnType: CAPPluginReturnPromise),
|
|
40
|
+
CAPPluginMethod(name: "sendAgentToolResult", returnType: CAPPluginReturnPromise),
|
|
41
|
+
CAPPluginMethod(name: "trackEvent", returnType: CAPPluginReturnPromise),
|
|
42
|
+
CAPPluginMethod(name: "trackPage", returnType: CAPPluginReturnPromise),
|
|
43
|
+
CAPPluginMethod(name: "sendSilentCrashReport", returnType: CAPPluginReturnPromise),
|
|
44
|
+
CAPPluginMethod(name: "openChecklists", returnType: CAPPluginReturnPromise),
|
|
45
|
+
CAPPluginMethod(name: "openChecklist", returnType: CAPPluginReturnPromise),
|
|
46
|
+
CAPPluginMethod(name: "startChecklist", returnType: CAPPluginReturnPromise),
|
|
47
|
+
CAPPluginMethod(name: "open", returnType: CAPPluginReturnPromise),
|
|
48
|
+
CAPPluginMethod(name: "openNews", returnType: CAPPluginReturnPromise),
|
|
49
|
+
CAPPluginMethod(name: "showSurvey", returnType: CAPPluginReturnPromise),
|
|
50
|
+
CAPPluginMethod(name: "openNewsArticle", returnType: CAPPluginReturnPromise),
|
|
51
|
+
CAPPluginMethod(name: "openHelpCenter", returnType: CAPPluginReturnPromise),
|
|
52
|
+
CAPPluginMethod(name: "openHelpCenterArticle", returnType: CAPPluginReturnPromise),
|
|
53
|
+
CAPPluginMethod(name: "askAI", returnType: CAPPluginReturnPromise),
|
|
54
|
+
CAPPluginMethod(name: "openHelpCenterCollection", returnType: CAPPluginReturnPromise),
|
|
55
|
+
CAPPluginMethod(name: "searchHelpCenter", returnType: CAPPluginReturnPromise),
|
|
56
|
+
CAPPluginMethod(name: "openFeatureRequests", returnType: CAPPluginReturnPromise),
|
|
57
|
+
CAPPluginMethod(name: "close", returnType: CAPPluginReturnPromise),
|
|
58
|
+
CAPPluginMethod(name: "isOpened", returnType: CAPPluginReturnPromise),
|
|
59
|
+
CAPPluginMethod(name: "showFeedbackButton", returnType: CAPPluginReturnPromise),
|
|
60
|
+
CAPPluginMethod(name: "enableDebugConsoleLog", returnType: CAPPluginReturnPromise),
|
|
61
|
+
CAPPluginMethod(name: "log", returnType: CAPPluginReturnPromise),
|
|
62
|
+
CAPPluginMethod(name: "disableConsoleLogOverwrite", returnType: CAPPluginReturnPromise),
|
|
63
|
+
CAPPluginMethod(name: "startFeedbackFlow", returnType: CAPPluginReturnPromise),
|
|
64
|
+
CAPPluginMethod(name: "startBot", returnType: CAPPluginReturnPromise),
|
|
65
|
+
CAPPluginMethod(name: "setLanguage", returnType: CAPPluginReturnPromise),
|
|
66
|
+
CAPPluginMethod(name: "setEventCallback", returnType: CAPPluginReturnCallback),
|
|
67
|
+
CAPPluginMethod(name: "preFillForm", returnType: CAPPluginReturnPromise),
|
|
68
|
+
CAPPluginMethod(name: "addAttachment", returnType: CAPPluginReturnPromise),
|
|
69
|
+
CAPPluginMethod(name: "removeAllAttachments", returnType: CAPPluginReturnPromise),
|
|
70
|
+
CAPPluginMethod(name: "getIdentity", returnType: CAPPluginReturnPromise),
|
|
71
|
+
CAPPluginMethod(name: "isUserIdentified", returnType: CAPPluginReturnPromise),
|
|
72
|
+
CAPPluginMethod(name: "setTags", returnType: CAPPluginReturnPromise),
|
|
73
|
+
CAPPluginMethod(name: "setDisableInAppNotifications", returnType: CAPPluginReturnPromise),
|
|
74
|
+
CAPPluginMethod(name: "setDisableEnvData", returnType: CAPPluginReturnPromise),
|
|
75
|
+
CAPPluginMethod(name: "setColorScheme", returnType: CAPPluginReturnPromise),
|
|
76
|
+
CAPPluginMethod(name: "startClassicForm", returnType: CAPPluginReturnPromise),
|
|
77
|
+
CAPPluginMethod(name: "startConversation", returnType: CAPPluginReturnPromise),
|
|
78
|
+
CAPPluginMethod(name: "openConversations", returnType: CAPPluginReturnPromise),
|
|
79
|
+
CAPPluginMethod(name: "openConversation", returnType: CAPPluginReturnPromise),
|
|
80
|
+
CAPPluginMethod(name: "setNotificationContainerOffset", returnType: CAPPluginReturnPromise)
|
|
81
|
+
]
|
|
82
|
+
|
|
11
83
|
enum CallType {
|
|
12
84
|
case event
|
|
13
85
|
}
|
|
14
86
|
|
|
15
87
|
private var callQueue: [String: CallType] = [:]
|
|
16
88
|
private var pendingAgentToolExecutions: [String: GleapAgentToolCompletion] = [:]
|
|
89
|
+
// Network log settings from the last loaded config, for the WebView log capture (main queue only).
|
|
90
|
+
private var lastLogConfig: [String: Any]?
|
|
91
|
+
// Set by disableConsoleLogOverwrite: WebView console logs are no longer attached.
|
|
92
|
+
private var webViewConsoleLogsDisabled = false
|
|
17
93
|
|
|
18
94
|
@objc func initialize(_ call: CAPPluginCall) {
|
|
19
95
|
// Check if key is present
|
|
@@ -22,9 +98,25 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
22
98
|
return;
|
|
23
99
|
}
|
|
24
100
|
|
|
101
|
+
// Receive configLoaded, which carries the network log settings for the WebView log capture.
|
|
102
|
+
// A delegate the app set natively is kept.
|
|
103
|
+
if Gleap.sharedInstance().delegate == nil {
|
|
104
|
+
Gleap.sharedInstance().delegate = self
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Before initialize: the SDK starts reading stdout there and skips Capacitor's own
|
|
108
|
+
// console copies only once it knows it runs inside Capacitor.
|
|
109
|
+
Gleap.setApplicationType(CAPACITOR)
|
|
110
|
+
|
|
25
111
|
// Initialize Gleap with API key
|
|
26
112
|
Gleap.initialize(withToken: api_key)
|
|
27
|
-
|
|
113
|
+
|
|
114
|
+
// A reloaded WebView calls initialize again: hand it the config that was already loaded.
|
|
115
|
+
DispatchQueue.main.async {
|
|
116
|
+
if let logConfig = self.lastLogConfig {
|
|
117
|
+
self.notifyListeners("logConfigLoaded", data: logConfig, retainUntilConsumed: true)
|
|
118
|
+
}
|
|
119
|
+
}
|
|
28
120
|
|
|
29
121
|
// Provide feedback that it has been success
|
|
30
122
|
call.resolve([
|
|
@@ -248,11 +340,43 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
248
340
|
}
|
|
249
341
|
|
|
250
342
|
@objc func disableConsoleLogOverwrite(_ call: CAPPluginCall) {
|
|
343
|
+
// The plugin's JavaScript restores the WebView console; drop what it attached so far.
|
|
344
|
+
webViewConsoleLogsDisabled = true
|
|
345
|
+
Gleap.attachExternalData(["consoleLog": [Any]()])
|
|
346
|
+
|
|
251
347
|
call.resolve([
|
|
252
348
|
"consoleLogDisabled": true
|
|
253
349
|
])
|
|
254
350
|
}
|
|
255
351
|
|
|
352
|
+
// Network requests made inside the WebView (fetch / XMLHttpRequest), recorded by the plugin's
|
|
353
|
+
// JavaScript. Each call replaces the previous list; the SDK merges and sanitizes them.
|
|
354
|
+
@objc func attachNetworkLogs(_ call: CAPPluginCall) {
|
|
355
|
+
let logs = call.options["logs"] as? [Any] ?? []
|
|
356
|
+
Gleap.attachExternalData(["networkLogs": logs])
|
|
357
|
+
|
|
358
|
+
call.resolve([
|
|
359
|
+
"networkLogsAttached": true
|
|
360
|
+
])
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// Console output of the WebView, recorded by the plugin's JavaScript. Each call replaces the previous list.
|
|
364
|
+
@objc func attachConsoleLogs(_ call: CAPPluginCall) {
|
|
365
|
+
if webViewConsoleLogsDisabled {
|
|
366
|
+
call.resolve([
|
|
367
|
+
"consoleLogsAttached": false
|
|
368
|
+
])
|
|
369
|
+
return
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
let logs = call.options["logs"] as? [Any] ?? []
|
|
373
|
+
Gleap.attachExternalData(["consoleLog": logs])
|
|
374
|
+
|
|
375
|
+
call.resolve([
|
|
376
|
+
"consoleLogsAttached": true
|
|
377
|
+
])
|
|
378
|
+
}
|
|
379
|
+
|
|
256
380
|
@objc func enableDebugConsoleLog(_ call: CAPPluginCall) {
|
|
257
381
|
Gleap.enableDebugConsoleLog()
|
|
258
382
|
|
|
@@ -261,6 +385,30 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
261
385
|
])
|
|
262
386
|
}
|
|
263
387
|
|
|
388
|
+
@objc func log(_ call: CAPPluginCall) {
|
|
389
|
+
guard let message = call.options["message"] as? String else {
|
|
390
|
+
call.reject("Must provide a log message")
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
var logLevel = INFO
|
|
395
|
+
switch call.getString("logLevel") ?? "INFO" {
|
|
396
|
+
case "WARNING":
|
|
397
|
+
logLevel = WARNING
|
|
398
|
+
case "ERROR":
|
|
399
|
+
logLevel = ERROR
|
|
400
|
+
default:
|
|
401
|
+
logLevel = INFO
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
Gleap.log(message, with: logLevel)
|
|
405
|
+
|
|
406
|
+
// Provide feedback that it has been success
|
|
407
|
+
call.resolve([
|
|
408
|
+
"logged": true
|
|
409
|
+
])
|
|
410
|
+
}
|
|
411
|
+
|
|
264
412
|
@objc func showSurvey(_ call: CAPPluginCall) {
|
|
265
413
|
guard let surveyId = call.options["surveyId"] as? String else {
|
|
266
414
|
call.reject("Must provide a surveyId")
|
|
@@ -268,7 +416,7 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
268
416
|
}
|
|
269
417
|
|
|
270
418
|
var surveyFormat = SURVEY
|
|
271
|
-
if (call.getString("format")
|
|
419
|
+
if (call.getString("format") == "survey_full") {
|
|
272
420
|
surveyFormat = SURVEY_FULL
|
|
273
421
|
}
|
|
274
422
|
|
|
@@ -291,7 +439,7 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
291
439
|
|
|
292
440
|
// Provide feedback that it has been success
|
|
293
441
|
call.resolve([
|
|
294
|
-
"
|
|
442
|
+
"attachedCustomData": true
|
|
295
443
|
])
|
|
296
444
|
}
|
|
297
445
|
|
|
@@ -327,6 +475,22 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
327
475
|
])
|
|
328
476
|
}
|
|
329
477
|
|
|
478
|
+
@objc func setEnvDataPropsToIgnore(_ call: CAPPluginCall) {
|
|
479
|
+
// If value is empty, then pass back error
|
|
480
|
+
guard let propsToIgnore = call.options["propsToIgnore"] as? [String] else {
|
|
481
|
+
call.reject("Must provide a propsToIgnore array")
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// Remove these env data keys before a ticket is sent
|
|
486
|
+
Gleap.setEnvDataPropsToIgnore(propsToIgnore)
|
|
487
|
+
|
|
488
|
+
// Provide feedback that it has been success
|
|
489
|
+
call.resolve([
|
|
490
|
+
"envDataPropsToIgnoreSet": true
|
|
491
|
+
])
|
|
492
|
+
}
|
|
493
|
+
|
|
330
494
|
@objc func setTags(_ call: CAPPluginCall) {
|
|
331
495
|
// If value is empty, then pass back error
|
|
332
496
|
guard let tags = call.options["tags"] as? [String] else {
|
|
@@ -512,7 +676,7 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
512
676
|
|
|
513
677
|
// Provide feedback that it has been success
|
|
514
678
|
call.resolve([
|
|
515
|
-
"
|
|
679
|
+
"loggedEvent": true
|
|
516
680
|
])
|
|
517
681
|
}
|
|
518
682
|
|
|
@@ -567,6 +731,32 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
567
731
|
])
|
|
568
732
|
}
|
|
569
733
|
|
|
734
|
+
@objc func setDisableEnvData(_ call: CAPPluginCall) {
|
|
735
|
+
let disableEnvData = call.getBool("disableEnvData") ?? false
|
|
736
|
+
|
|
737
|
+
Gleap.setDisableEnvData(disableEnvData)
|
|
738
|
+
|
|
739
|
+
// Provide feedback that it has been success
|
|
740
|
+
call.resolve([
|
|
741
|
+
"envDataDisabled": true
|
|
742
|
+
])
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
@objc func setColorScheme(_ call: CAPPluginCall) {
|
|
746
|
+
guard let colorScheme = call.options["colorScheme"] as? String else {
|
|
747
|
+
call.reject("No colorScheme provided")
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
// Missing colors fall back to the dashboard setting / the SDK defaults
|
|
752
|
+
Gleap.setColorScheme(colorScheme, lightBackgroundColor: call.getString("lightBackgroundColor"), darkBackgroundColor: call.getString("darkBackgroundColor"))
|
|
753
|
+
|
|
754
|
+
// Provide feedback that it has been success
|
|
755
|
+
call.resolve([
|
|
756
|
+
"colorScheme": colorScheme
|
|
757
|
+
])
|
|
758
|
+
}
|
|
759
|
+
|
|
570
760
|
@objc func showFeedbackButton(_ call: CAPPluginCall) {
|
|
571
761
|
let showFeedbackButton = call.getBool("show") ?? false
|
|
572
762
|
|
|
@@ -648,8 +838,7 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
648
838
|
let checklistId = call.getString("checklistId") ?? ""
|
|
649
839
|
let showBackButton = call.getBool("showBackButton") ?? true
|
|
650
840
|
|
|
651
|
-
|
|
652
|
-
Gleap.openNewsArticle(checklistId, andShowBackButton: showBackButton)
|
|
841
|
+
Gleap.openChecklist(checklistId, andShowBackButton: showBackButton)
|
|
653
842
|
|
|
654
843
|
// Provide feedback that it has been success
|
|
655
844
|
call.resolve([
|
|
@@ -661,8 +850,7 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
661
850
|
let outboundId = call.getString("outboundId") ?? ""
|
|
662
851
|
let showBackButton = call.getBool("showBackButton") ?? true
|
|
663
852
|
|
|
664
|
-
|
|
665
|
-
Gleap.openNewsArticle(outboundId, andShowBackButton: showBackButton)
|
|
853
|
+
Gleap.startChecklist(outboundId, andShowBackButton: showBackButton)
|
|
666
854
|
|
|
667
855
|
// Provide feedback that it has been success
|
|
668
856
|
call.resolve([
|
|
@@ -671,12 +859,14 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
671
859
|
}
|
|
672
860
|
|
|
673
861
|
@objc func openNews(_ call: CAPPluginCall) {
|
|
862
|
+
let showBackButton = call.getBool("showBackButton") ?? true
|
|
863
|
+
|
|
674
864
|
// Open news
|
|
675
|
-
Gleap.openNews()
|
|
865
|
+
Gleap.openNews(showBackButton)
|
|
676
866
|
|
|
677
867
|
// Provide feedback that it has been success
|
|
678
868
|
call.resolve([
|
|
679
|
-
"
|
|
869
|
+
"openedNews": true
|
|
680
870
|
])
|
|
681
871
|
}
|
|
682
872
|
|
|
@@ -832,6 +1022,11 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
832
1022
|
])
|
|
833
1023
|
}
|
|
834
1024
|
|
|
1025
|
+
// The name the plugin's TypeScript API uses for opening the conversations tab.
|
|
1026
|
+
@objc func openConversation(_ call: CAPPluginCall) {
|
|
1027
|
+
openConversations(call)
|
|
1028
|
+
}
|
|
1029
|
+
|
|
835
1030
|
@objc func startFeedbackFlow(_ call: CAPPluginCall) {
|
|
836
1031
|
let feedbackFlow = call.getString("feedbackFlow") ?? "bugreporting"
|
|
837
1032
|
let showBackButton = call.getBool("showBackButton") ?? true
|
|
@@ -905,6 +1100,19 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
905
1100
|
notifyEventUpdate(name: "initialized", data: nil)
|
|
906
1101
|
}
|
|
907
1102
|
|
|
1103
|
+
public func configLoaded(_ config: [AnyHashable : Any]) {
|
|
1104
|
+
// Only what the WebView log capture needs: whether network logs are on, and the redaction rules.
|
|
1105
|
+
let logConfig: [String: Any] = [
|
|
1106
|
+
"enableNetworkLogs": (config["enableNetworkLogs"] as? Bool) ?? false,
|
|
1107
|
+
"networkLogPropsToIgnore": (config["networkLogPropsToIgnore"] as? [String]) ?? [],
|
|
1108
|
+
"networkLogBlacklist": (config["networkLogBlacklist"] as? [String]) ?? []
|
|
1109
|
+
]
|
|
1110
|
+
DispatchQueue.main.async {
|
|
1111
|
+
self.lastLogConfig = logConfig
|
|
1112
|
+
self.notifyListeners("logConfigLoaded", data: logConfig, retainUntilConsumed: true)
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
|
|
908
1116
|
public func widgetOpened() {
|
|
909
1117
|
notifyEventUpdate(name: "widget-opened", data: nil)
|
|
910
1118
|
}
|
|
@@ -929,7 +1137,9 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
929
1137
|
notifyEventUpdate(name: "outbound-sent", data: data)
|
|
930
1138
|
}
|
|
931
1139
|
|
|
932
|
-
|
|
1140
|
+
// GleapDelegate declares feedbackSendingFailed: with the error data; the SDK never calls a
|
|
1141
|
+
// variant without it.
|
|
1142
|
+
public func feedbackSendingFailed(_ data: [AnyHashable : Any]) {
|
|
933
1143
|
notifyEventUpdate(name: "error-while-sending", data: nil)
|
|
934
1144
|
}
|
|
935
1145
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
+
"homepage": "https://www.gleap.ai",
|
|
2
3
|
"name": "capacitor-gleap-plugin",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Gleap SDK for Capacitor
|
|
4
|
+
"version": "19.0.0",
|
|
5
|
+
"description": "Gleap SDK for Capacitor and Ionic: AI customer support, live chat, in-app bug reporting and customer feedback.",
|
|
5
6
|
"main": "dist/plugin.cjs.js",
|
|
6
7
|
"module": "dist/esm/index.js",
|
|
7
8
|
"types": "dist/esm/index.d.ts",
|
|
@@ -10,7 +11,8 @@
|
|
|
10
11
|
"android/src/main/",
|
|
11
12
|
"android/build.gradle",
|
|
12
13
|
"dist/",
|
|
13
|
-
"ios/
|
|
14
|
+
"ios/Sources",
|
|
15
|
+
"Package.swift",
|
|
14
16
|
"CapacitorGleapPlugin.podspec"
|
|
15
17
|
],
|
|
16
18
|
"author": "Gleap GmbH",
|
|
@@ -25,13 +27,20 @@
|
|
|
25
27
|
"keywords": [
|
|
26
28
|
"capacitor",
|
|
27
29
|
"plugin",
|
|
28
|
-
"native"
|
|
30
|
+
"native",
|
|
31
|
+
"gleap",
|
|
32
|
+
"ionic",
|
|
33
|
+
"customer-support",
|
|
34
|
+
"bug-reporting",
|
|
35
|
+
"customer-feedback",
|
|
36
|
+
"intercom-alternative"
|
|
29
37
|
],
|
|
30
38
|
"scripts": {
|
|
31
39
|
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|
|
32
|
-
"verify:ios": "
|
|
40
|
+
"verify:ios": "xcodebuild build -scheme CapacitorGleapPlugin -destination generic/platform=iOS",
|
|
33
41
|
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
34
42
|
"verify:web": "npm run build",
|
|
43
|
+
"test": "jest",
|
|
35
44
|
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
36
45
|
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
|
|
37
46
|
"eslint": "eslint . --ext ts",
|
|
@@ -51,7 +60,10 @@
|
|
|
51
60
|
"@ionic/eslint-config": "^0.4.0",
|
|
52
61
|
"@ionic/prettier-config": "^4.0.0",
|
|
53
62
|
"@ionic/swiftlint-config": "^2.0.0",
|
|
63
|
+
"@swc/core": "^1.16.2",
|
|
64
|
+
"@swc/jest": "^0.2.39",
|
|
54
65
|
"eslint": "^8.57.0",
|
|
66
|
+
"jest": "^30.5.2",
|
|
55
67
|
"prettier": "^3.4.2",
|
|
56
68
|
"prettier-plugin-java": "^2.6.6",
|
|
57
69
|
"rimraf": "^6.0.1",
|
|
@@ -67,6 +79,15 @@
|
|
|
67
79
|
"eslintConfig": {
|
|
68
80
|
"extends": "@ionic/eslint-config/recommended"
|
|
69
81
|
},
|
|
82
|
+
"jest": {
|
|
83
|
+
"testEnvironment": "node",
|
|
84
|
+
"roots": [
|
|
85
|
+
"<rootDir>/src"
|
|
86
|
+
],
|
|
87
|
+
"transform": {
|
|
88
|
+
"^.+\\.ts$": "@swc/jest"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
70
91
|
"capacitor": {
|
|
71
92
|
"ios": {
|
|
72
93
|
"src": "ios"
|
|
@@ -76,6 +97,6 @@
|
|
|
76
97
|
}
|
|
77
98
|
},
|
|
78
99
|
"dependencies": {
|
|
79
|
-
"gleap": "^
|
|
100
|
+
"gleap": "^19.0.0"
|
|
80
101
|
}
|
|
81
102
|
}
|
package/ios/Plugin/GleapPlugin.h
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#import <UIKit/UIKit.h>
|
|
2
|
-
|
|
3
|
-
//! Project version number for Plugin.
|
|
4
|
-
FOUNDATION_EXPORT double PluginVersionNumber;
|
|
5
|
-
|
|
6
|
-
//! Project version string for Plugin.
|
|
7
|
-
FOUNDATION_EXPORT const unsigned char PluginVersionString[];
|
|
8
|
-
|
|
9
|
-
// In this header, you should import all the public headers of your framework using statements like #import <Plugin/PublicHeader.h>
|
|
10
|
-
|
package/ios/Plugin/GleapPlugin.m
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
#import <Capacitor/Capacitor.h>
|
|
3
|
-
|
|
4
|
-
// Define the plugin using the CAP_PLUGIN Macro, and
|
|
5
|
-
// each method the plugin supports using the CAP_PLUGIN_METHOD macro.
|
|
6
|
-
CAP_PLUGIN(GleapPlugin, "Gleap",
|
|
7
|
-
CAP_PLUGIN_METHOD(initialize, CAPPluginReturnPromise);
|
|
8
|
-
CAP_PLUGIN_METHOD(setRegion, CAPPluginReturnPromise);
|
|
9
|
-
CAP_PLUGIN_METHOD(setApiUrl, CAPPluginReturnPromise);
|
|
10
|
-
CAP_PLUGIN_METHOD(setWSApiUrl, CAPPluginReturnPromise);
|
|
11
|
-
CAP_PLUGIN_METHOD(setRealtimeHost, CAPPluginReturnPromise);
|
|
12
|
-
CAP_PLUGIN_METHOD(setFrameUrl, CAPPluginReturnPromise);
|
|
13
|
-
CAP_PLUGIN_METHOD(setBannerUrl, CAPPluginReturnPromise);
|
|
14
|
-
CAP_PLUGIN_METHOD(setModalUrl, CAPPluginReturnPromise);
|
|
15
|
-
CAP_PLUGIN_METHOD(identify, CAPPluginReturnPromise);
|
|
16
|
-
CAP_PLUGIN_METHOD(updateContact, CAPPluginReturnPromise);
|
|
17
|
-
CAP_PLUGIN_METHOD(clearIdentity, CAPPluginReturnPromise);
|
|
18
|
-
CAP_PLUGIN_METHOD(setNetworkLogsBlacklist, CAPPluginReturnPromise);
|
|
19
|
-
CAP_PLUGIN_METHOD(setNetworkLogPropsToIgnore, CAPPluginReturnPromise);
|
|
20
|
-
CAP_PLUGIN_METHOD(attachCustomData, CAPPluginReturnPromise);
|
|
21
|
-
CAP_PLUGIN_METHOD(setCustomData, CAPPluginReturnPromise);
|
|
22
|
-
CAP_PLUGIN_METHOD(removeCustomData, CAPPluginReturnPromise);
|
|
23
|
-
CAP_PLUGIN_METHOD(clearCustomData, CAPPluginReturnPromise);
|
|
24
|
-
CAP_PLUGIN_METHOD(setTicketAttribute, CAPPluginReturnPromise);
|
|
25
|
-
CAP_PLUGIN_METHOD(unsetTicketAttribute, CAPPluginReturnPromise);
|
|
26
|
-
CAP_PLUGIN_METHOD(clearTicketAttributes, CAPPluginReturnPromise);
|
|
27
|
-
CAP_PLUGIN_METHOD(registerAgentTool, CAPPluginReturnPromise);
|
|
28
|
-
CAP_PLUGIN_METHOD(sendAgentToolResult, CAPPluginReturnPromise);
|
|
29
|
-
CAP_PLUGIN_METHOD(trackEvent, CAPPluginReturnPromise);
|
|
30
|
-
CAP_PLUGIN_METHOD(trackPage, CAPPluginReturnPromise);
|
|
31
|
-
CAP_PLUGIN_METHOD(sendSilentCrashReport, CAPPluginReturnPromise);
|
|
32
|
-
CAP_PLUGIN_METHOD(openChecklists, CAPPluginReturnPromise);
|
|
33
|
-
CAP_PLUGIN_METHOD(openChecklist, CAPPluginReturnPromise);
|
|
34
|
-
CAP_PLUGIN_METHOD(startChecklist, CAPPluginReturnPromise);
|
|
35
|
-
CAP_PLUGIN_METHOD(open, CAPPluginReturnPromise);
|
|
36
|
-
CAP_PLUGIN_METHOD(openNews, CAPPluginReturnPromise);
|
|
37
|
-
CAP_PLUGIN_METHOD(showSurvey, CAPPluginReturnPromise);
|
|
38
|
-
CAP_PLUGIN_METHOD(openNewsArticle, CAPPluginReturnPromise);
|
|
39
|
-
CAP_PLUGIN_METHOD(openHelpCenter, CAPPluginReturnPromise);
|
|
40
|
-
CAP_PLUGIN_METHOD(openHelpCenterArticle, CAPPluginReturnPromise);
|
|
41
|
-
CAP_PLUGIN_METHOD(askAI, CAPPluginReturnPromise);
|
|
42
|
-
CAP_PLUGIN_METHOD(openHelpCenterCollection, CAPPluginReturnPromise);
|
|
43
|
-
CAP_PLUGIN_METHOD(searchHelpCenter, CAPPluginReturnPromise);
|
|
44
|
-
CAP_PLUGIN_METHOD(openFeatureRequests, CAPPluginReturnPromise);
|
|
45
|
-
CAP_PLUGIN_METHOD(close, CAPPluginReturnPromise);
|
|
46
|
-
CAP_PLUGIN_METHOD(isOpened, CAPPluginReturnPromise);
|
|
47
|
-
CAP_PLUGIN_METHOD(showFeedbackButton, CAPPluginReturnPromise);
|
|
48
|
-
CAP_PLUGIN_METHOD(enableDebugConsoleLog, CAPPluginReturnPromise);
|
|
49
|
-
CAP_PLUGIN_METHOD(log, CAPPluginReturnPromise);
|
|
50
|
-
CAP_PLUGIN_METHOD(disableConsoleLogOverwrite, CAPPluginReturnPromise);
|
|
51
|
-
CAP_PLUGIN_METHOD(startFeedbackFlow, CAPPluginReturnPromise);
|
|
52
|
-
CAP_PLUGIN_METHOD(startBot, CAPPluginReturnPromise);
|
|
53
|
-
CAP_PLUGIN_METHOD(setLanguage, CAPPluginReturnPromise);
|
|
54
|
-
CAP_PLUGIN_METHOD(setEventCallback, CAPPluginReturnCallback);
|
|
55
|
-
CAP_PLUGIN_METHOD(preFillForm, CAPPluginReturnPromise);
|
|
56
|
-
CAP_PLUGIN_METHOD(addAttachment, CAPPluginReturnPromise);
|
|
57
|
-
CAP_PLUGIN_METHOD(removeAllAttachments, CAPPluginReturnPromise);
|
|
58
|
-
CAP_PLUGIN_METHOD(getIdentity, CAPPluginReturnPromise);
|
|
59
|
-
CAP_PLUGIN_METHOD(isUserIdentified, CAPPluginReturnPromise);
|
|
60
|
-
CAP_PLUGIN_METHOD(setTags, CAPPluginReturnPromise);
|
|
61
|
-
CAP_PLUGIN_METHOD(setDisableInAppNotifications, CAPPluginReturnPromise);
|
|
62
|
-
CAP_PLUGIN_METHOD(startClassicForm, CAPPluginReturnPromise);
|
|
63
|
-
CAP_PLUGIN_METHOD(startConversation, CAPPluginReturnPromise);
|
|
64
|
-
CAP_PLUGIN_METHOD(openConversations, CAPPluginReturnPromise);
|
|
65
|
-
CAP_PLUGIN_METHOD(setNotificationContainerOffset, CAPPluginReturnPromise);
|
|
66
|
-
)
|
package/ios/Plugin/Info.plist
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
-
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
|
7
|
-
<key>CFBundleExecutable</key>
|
|
8
|
-
<string>$(EXECUTABLE_NAME)</string>
|
|
9
|
-
<key>CFBundleIdentifier</key>
|
|
10
|
-
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
11
|
-
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
-
<string>6.0</string>
|
|
13
|
-
<key>CFBundleName</key>
|
|
14
|
-
<string>$(PRODUCT_NAME)</string>
|
|
15
|
-
<key>CFBundlePackageType</key>
|
|
16
|
-
<string>FMWK</string>
|
|
17
|
-
<key>CFBundleShortVersionString</key>
|
|
18
|
-
<string>1.0</string>
|
|
19
|
-
<key>CFBundleVersion</key>
|
|
20
|
-
<string>$(CURRENT_PROJECT_VERSION)</string>
|
|
21
|
-
<key>NSPrincipalClass</key>
|
|
22
|
-
<string></string>
|
|
23
|
-
</dict>
|
|
24
|
-
</plist>
|