capacitor-gleap-plugin 18.1.0 → 19.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CapacitorGleapPlugin.podspec +7 -2
- package/Package.swift +31 -0
- package/README.md +298 -759
- package/android/build.gradle +1 -1
- package/android/src/main/java/io/gleapplugins/capacitor/GleapPlugin.java +202 -37
- package/dist/docs.json +288 -3893
- package/dist/esm/definitions.d.ts +162 -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 +42 -2
- package/dist/esm/web.js +38 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +2258 -1
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +2258 -1
- package/dist/plugin.js.map +1 -1
- package/ios/{Plugin → Sources/GleapPlugin}/GleapPlugin.swift +219 -12
- package/package.json +18 -4
- package/ios/Plugin/GleapPlugin.h +0 -10
- package/ios/Plugin/GleapPlugin.m +0 -68
- package/ios/Plugin/Info.plist +0 -24
|
@@ -7,13 +7,90 @@ 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: "openProtectedFileFromUrl", returnType: CAPPluginReturnPromise),
|
|
81
|
+
CAPPluginMethod(name: "setNotificationContainerOffset", returnType: CAPPluginReturnPromise)
|
|
82
|
+
]
|
|
83
|
+
|
|
11
84
|
enum CallType {
|
|
12
85
|
case event
|
|
13
86
|
}
|
|
14
87
|
|
|
15
88
|
private var callQueue: [String: CallType] = [:]
|
|
16
89
|
private var pendingAgentToolExecutions: [String: GleapAgentToolCompletion] = [:]
|
|
90
|
+
// Network log settings from the last loaded config, for the WebView log capture (main queue only).
|
|
91
|
+
private var lastLogConfig: [String: Any]?
|
|
92
|
+
// Set by disableConsoleLogOverwrite: WebView console logs are no longer attached.
|
|
93
|
+
private var webViewConsoleLogsDisabled = false
|
|
17
94
|
|
|
18
95
|
@objc func initialize(_ call: CAPPluginCall) {
|
|
19
96
|
// Check if key is present
|
|
@@ -22,9 +99,25 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
22
99
|
return;
|
|
23
100
|
}
|
|
24
101
|
|
|
102
|
+
// Receive configLoaded, which carries the network log settings for the WebView log capture.
|
|
103
|
+
// A delegate the app set natively is kept.
|
|
104
|
+
if Gleap.sharedInstance().delegate == nil {
|
|
105
|
+
Gleap.sharedInstance().delegate = self
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Before initialize: the SDK starts reading stdout there and skips Capacitor's own
|
|
109
|
+
// console copies only once it knows it runs inside Capacitor.
|
|
110
|
+
Gleap.setApplicationType(CAPACITOR)
|
|
111
|
+
|
|
25
112
|
// Initialize Gleap with API key
|
|
26
113
|
Gleap.initialize(withToken: api_key)
|
|
27
|
-
|
|
114
|
+
|
|
115
|
+
// A reloaded WebView calls initialize again: hand it the config that was already loaded.
|
|
116
|
+
DispatchQueue.main.async {
|
|
117
|
+
if let logConfig = self.lastLogConfig {
|
|
118
|
+
self.notifyListeners("logConfigLoaded", data: logConfig, retainUntilConsumed: true)
|
|
119
|
+
}
|
|
120
|
+
}
|
|
28
121
|
|
|
29
122
|
// Provide feedback that it has been success
|
|
30
123
|
call.resolve([
|
|
@@ -248,11 +341,43 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
248
341
|
}
|
|
249
342
|
|
|
250
343
|
@objc func disableConsoleLogOverwrite(_ call: CAPPluginCall) {
|
|
344
|
+
// The plugin's JavaScript restores the WebView console; drop what it attached so far.
|
|
345
|
+
webViewConsoleLogsDisabled = true
|
|
346
|
+
Gleap.attachExternalData(["consoleLog": [Any]()])
|
|
347
|
+
|
|
251
348
|
call.resolve([
|
|
252
349
|
"consoleLogDisabled": true
|
|
253
350
|
])
|
|
254
351
|
}
|
|
255
352
|
|
|
353
|
+
// Network requests made inside the WebView (fetch / XMLHttpRequest), recorded by the plugin's
|
|
354
|
+
// JavaScript. Each call replaces the previous list; the SDK merges and sanitizes them.
|
|
355
|
+
@objc func attachNetworkLogs(_ call: CAPPluginCall) {
|
|
356
|
+
let logs = call.options["logs"] as? [Any] ?? []
|
|
357
|
+
Gleap.attachExternalData(["networkLogs": logs])
|
|
358
|
+
|
|
359
|
+
call.resolve([
|
|
360
|
+
"networkLogsAttached": true
|
|
361
|
+
])
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// Console output of the WebView, recorded by the plugin's JavaScript. Each call replaces the previous list.
|
|
365
|
+
@objc func attachConsoleLogs(_ call: CAPPluginCall) {
|
|
366
|
+
if webViewConsoleLogsDisabled {
|
|
367
|
+
call.resolve([
|
|
368
|
+
"consoleLogsAttached": false
|
|
369
|
+
])
|
|
370
|
+
return
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
let logs = call.options["logs"] as? [Any] ?? []
|
|
374
|
+
Gleap.attachExternalData(["consoleLog": logs])
|
|
375
|
+
|
|
376
|
+
call.resolve([
|
|
377
|
+
"consoleLogsAttached": true
|
|
378
|
+
])
|
|
379
|
+
}
|
|
380
|
+
|
|
256
381
|
@objc func enableDebugConsoleLog(_ call: CAPPluginCall) {
|
|
257
382
|
Gleap.enableDebugConsoleLog()
|
|
258
383
|
|
|
@@ -261,6 +386,30 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
261
386
|
])
|
|
262
387
|
}
|
|
263
388
|
|
|
389
|
+
@objc func log(_ call: CAPPluginCall) {
|
|
390
|
+
guard let message = call.options["message"] as? String else {
|
|
391
|
+
call.reject("Must provide a log message")
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
var logLevel = INFO
|
|
396
|
+
switch call.getString("logLevel") ?? "INFO" {
|
|
397
|
+
case "WARNING":
|
|
398
|
+
logLevel = WARNING
|
|
399
|
+
case "ERROR":
|
|
400
|
+
logLevel = ERROR
|
|
401
|
+
default:
|
|
402
|
+
logLevel = INFO
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
Gleap.log(message, with: logLevel)
|
|
406
|
+
|
|
407
|
+
// Provide feedback that it has been success
|
|
408
|
+
call.resolve([
|
|
409
|
+
"logged": true
|
|
410
|
+
])
|
|
411
|
+
}
|
|
412
|
+
|
|
264
413
|
@objc func showSurvey(_ call: CAPPluginCall) {
|
|
265
414
|
guard let surveyId = call.options["surveyId"] as? String else {
|
|
266
415
|
call.reject("Must provide a surveyId")
|
|
@@ -268,7 +417,7 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
268
417
|
}
|
|
269
418
|
|
|
270
419
|
var surveyFormat = SURVEY
|
|
271
|
-
if (call.getString("format")
|
|
420
|
+
if (call.getString("format") == "survey_full") {
|
|
272
421
|
surveyFormat = SURVEY_FULL
|
|
273
422
|
}
|
|
274
423
|
|
|
@@ -291,7 +440,7 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
291
440
|
|
|
292
441
|
// Provide feedback that it has been success
|
|
293
442
|
call.resolve([
|
|
294
|
-
"
|
|
443
|
+
"attachedCustomData": true
|
|
295
444
|
])
|
|
296
445
|
}
|
|
297
446
|
|
|
@@ -528,7 +677,7 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
528
677
|
|
|
529
678
|
// Provide feedback that it has been success
|
|
530
679
|
call.resolve([
|
|
531
|
-
"
|
|
680
|
+
"loggedEvent": true
|
|
532
681
|
])
|
|
533
682
|
}
|
|
534
683
|
|
|
@@ -594,6 +743,21 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
594
743
|
])
|
|
595
744
|
}
|
|
596
745
|
|
|
746
|
+
@objc func setColorScheme(_ call: CAPPluginCall) {
|
|
747
|
+
guard let colorScheme = call.options["colorScheme"] as? String else {
|
|
748
|
+
call.reject("No colorScheme provided")
|
|
749
|
+
return;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
// Missing colors fall back to the dashboard setting / the SDK defaults
|
|
753
|
+
Gleap.setColorScheme(colorScheme, lightBackgroundColor: call.getString("lightBackgroundColor"), darkBackgroundColor: call.getString("darkBackgroundColor"))
|
|
754
|
+
|
|
755
|
+
// Provide feedback that it has been success
|
|
756
|
+
call.resolve([
|
|
757
|
+
"colorScheme": colorScheme
|
|
758
|
+
])
|
|
759
|
+
}
|
|
760
|
+
|
|
597
761
|
@objc func showFeedbackButton(_ call: CAPPluginCall) {
|
|
598
762
|
let showFeedbackButton = call.getBool("show") ?? false
|
|
599
763
|
|
|
@@ -675,8 +839,7 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
675
839
|
let checklistId = call.getString("checklistId") ?? ""
|
|
676
840
|
let showBackButton = call.getBool("showBackButton") ?? true
|
|
677
841
|
|
|
678
|
-
|
|
679
|
-
Gleap.openNewsArticle(checklistId, andShowBackButton: showBackButton)
|
|
842
|
+
Gleap.openChecklist(checklistId, andShowBackButton: showBackButton)
|
|
680
843
|
|
|
681
844
|
// Provide feedback that it has been success
|
|
682
845
|
call.resolve([
|
|
@@ -688,8 +851,7 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
688
851
|
let outboundId = call.getString("outboundId") ?? ""
|
|
689
852
|
let showBackButton = call.getBool("showBackButton") ?? true
|
|
690
853
|
|
|
691
|
-
|
|
692
|
-
Gleap.openNewsArticle(outboundId, andShowBackButton: showBackButton)
|
|
854
|
+
Gleap.startChecklist(outboundId, andShowBackButton: showBackButton)
|
|
693
855
|
|
|
694
856
|
// Provide feedback that it has been success
|
|
695
857
|
call.resolve([
|
|
@@ -698,12 +860,14 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
698
860
|
}
|
|
699
861
|
|
|
700
862
|
@objc func openNews(_ call: CAPPluginCall) {
|
|
863
|
+
let showBackButton = call.getBool("showBackButton") ?? true
|
|
864
|
+
|
|
701
865
|
// Open news
|
|
702
|
-
Gleap.openNews()
|
|
866
|
+
Gleap.openNews(showBackButton)
|
|
703
867
|
|
|
704
868
|
// Provide feedback that it has been success
|
|
705
869
|
call.resolve([
|
|
706
|
-
"
|
|
870
|
+
"openedNews": true
|
|
707
871
|
])
|
|
708
872
|
}
|
|
709
873
|
|
|
@@ -859,6 +1023,34 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
859
1023
|
])
|
|
860
1024
|
}
|
|
861
1025
|
|
|
1026
|
+
// The name the plugin's TypeScript API uses for opening the conversations tab.
|
|
1027
|
+
@objc func openConversation(_ call: CAPPluginCall) {
|
|
1028
|
+
openConversations(call)
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
// Emailed protected file link (`gleapFile` query parameter). The SDK opens the conversation
|
|
1032
|
+
// once a verified identify (user hash) gave the session file access.
|
|
1033
|
+
@objc func openProtectedFileFromUrl(_ call: CAPPluginCall) {
|
|
1034
|
+
guard let urlString = call.getString("url") else {
|
|
1035
|
+
call.reject("No url provided")
|
|
1036
|
+
return;
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
// A string that is no URL carries no file reference.
|
|
1040
|
+
guard let url = URL(string: urlString) else {
|
|
1041
|
+
call.resolve([
|
|
1042
|
+
"opened": false
|
|
1043
|
+
])
|
|
1044
|
+
return;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
let opened = Gleap.openProtectedFile(from: url)
|
|
1048
|
+
|
|
1049
|
+
call.resolve([
|
|
1050
|
+
"opened": opened
|
|
1051
|
+
])
|
|
1052
|
+
}
|
|
1053
|
+
|
|
862
1054
|
@objc func startFeedbackFlow(_ call: CAPPluginCall) {
|
|
863
1055
|
let feedbackFlow = call.getString("feedbackFlow") ?? "bugreporting"
|
|
864
1056
|
let showBackButton = call.getBool("showBackButton") ?? true
|
|
@@ -932,6 +1124,19 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
932
1124
|
notifyEventUpdate(name: "initialized", data: nil)
|
|
933
1125
|
}
|
|
934
1126
|
|
|
1127
|
+
public func configLoaded(_ config: [AnyHashable : Any]) {
|
|
1128
|
+
// Only what the WebView log capture needs: whether network logs are on, and the redaction rules.
|
|
1129
|
+
let logConfig: [String: Any] = [
|
|
1130
|
+
"enableNetworkLogs": (config["enableNetworkLogs"] as? Bool) ?? false,
|
|
1131
|
+
"networkLogPropsToIgnore": (config["networkLogPropsToIgnore"] as? [String]) ?? [],
|
|
1132
|
+
"networkLogBlacklist": (config["networkLogBlacklist"] as? [String]) ?? []
|
|
1133
|
+
]
|
|
1134
|
+
DispatchQueue.main.async {
|
|
1135
|
+
self.lastLogConfig = logConfig
|
|
1136
|
+
self.notifyListeners("logConfigLoaded", data: logConfig, retainUntilConsumed: true)
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
|
|
935
1140
|
public func widgetOpened() {
|
|
936
1141
|
notifyEventUpdate(name: "widget-opened", data: nil)
|
|
937
1142
|
}
|
|
@@ -956,7 +1161,9 @@ public class GleapPlugin: CAPPlugin, GleapDelegate {
|
|
|
956
1161
|
notifyEventUpdate(name: "outbound-sent", data: data)
|
|
957
1162
|
}
|
|
958
1163
|
|
|
959
|
-
|
|
1164
|
+
// GleapDelegate declares feedbackSendingFailed: with the error data; the SDK never calls a
|
|
1165
|
+
// variant without it.
|
|
1166
|
+
public func feedbackSendingFailed(_ data: [AnyHashable : Any]) {
|
|
960
1167
|
notifyEventUpdate(name: "error-while-sending", data: nil)
|
|
961
1168
|
}
|
|
962
1169
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"homepage": "https://www.gleap.ai",
|
|
3
3
|
"name": "capacitor-gleap-plugin",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "19.0.1",
|
|
5
5
|
"description": "Gleap SDK for Capacitor and Ionic: AI customer support, live chat, in-app bug reporting and customer feedback.",
|
|
6
6
|
"main": "dist/plugin.cjs.js",
|
|
7
7
|
"module": "dist/esm/index.js",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"android/src/main/",
|
|
12
12
|
"android/build.gradle",
|
|
13
13
|
"dist/",
|
|
14
|
-
"ios/
|
|
14
|
+
"ios/Sources",
|
|
15
|
+
"Package.swift",
|
|
15
16
|
"CapacitorGleapPlugin.podspec"
|
|
16
17
|
],
|
|
17
18
|
"author": "Gleap GmbH",
|
|
@@ -36,9 +37,10 @@
|
|
|
36
37
|
],
|
|
37
38
|
"scripts": {
|
|
38
39
|
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|
|
39
|
-
"verify:ios": "
|
|
40
|
+
"verify:ios": "xcodebuild build -scheme CapacitorGleapPlugin -destination generic/platform=iOS",
|
|
40
41
|
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
41
42
|
"verify:web": "npm run build",
|
|
43
|
+
"test": "jest",
|
|
42
44
|
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
43
45
|
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
|
|
44
46
|
"eslint": "eslint . --ext ts",
|
|
@@ -58,7 +60,10 @@
|
|
|
58
60
|
"@ionic/eslint-config": "^0.4.0",
|
|
59
61
|
"@ionic/prettier-config": "^4.0.0",
|
|
60
62
|
"@ionic/swiftlint-config": "^2.0.0",
|
|
63
|
+
"@swc/core": "^1.16.2",
|
|
64
|
+
"@swc/jest": "^0.2.39",
|
|
61
65
|
"eslint": "^8.57.0",
|
|
66
|
+
"jest": "^30.5.2",
|
|
62
67
|
"prettier": "^3.4.2",
|
|
63
68
|
"prettier-plugin-java": "^2.6.6",
|
|
64
69
|
"rimraf": "^6.0.1",
|
|
@@ -74,6 +79,15 @@
|
|
|
74
79
|
"eslintConfig": {
|
|
75
80
|
"extends": "@ionic/eslint-config/recommended"
|
|
76
81
|
},
|
|
82
|
+
"jest": {
|
|
83
|
+
"testEnvironment": "node",
|
|
84
|
+
"roots": [
|
|
85
|
+
"<rootDir>/src"
|
|
86
|
+
],
|
|
87
|
+
"transform": {
|
|
88
|
+
"^.+\\.ts$": "@swc/jest"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
77
91
|
"capacitor": {
|
|
78
92
|
"ios": {
|
|
79
93
|
"src": "ios"
|
|
@@ -83,6 +97,6 @@
|
|
|
83
97
|
}
|
|
84
98
|
},
|
|
85
99
|
"dependencies": {
|
|
86
|
-
"gleap": "^
|
|
100
|
+
"gleap": "^19.0.0"
|
|
87
101
|
}
|
|
88
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,68 +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(setEnvDataPropsToIgnore, CAPPluginReturnPromise);
|
|
21
|
-
CAP_PLUGIN_METHOD(attachCustomData, CAPPluginReturnPromise);
|
|
22
|
-
CAP_PLUGIN_METHOD(setCustomData, CAPPluginReturnPromise);
|
|
23
|
-
CAP_PLUGIN_METHOD(removeCustomData, CAPPluginReturnPromise);
|
|
24
|
-
CAP_PLUGIN_METHOD(clearCustomData, CAPPluginReturnPromise);
|
|
25
|
-
CAP_PLUGIN_METHOD(setTicketAttribute, CAPPluginReturnPromise);
|
|
26
|
-
CAP_PLUGIN_METHOD(unsetTicketAttribute, CAPPluginReturnPromise);
|
|
27
|
-
CAP_PLUGIN_METHOD(clearTicketAttributes, CAPPluginReturnPromise);
|
|
28
|
-
CAP_PLUGIN_METHOD(registerAgentTool, CAPPluginReturnPromise);
|
|
29
|
-
CAP_PLUGIN_METHOD(sendAgentToolResult, CAPPluginReturnPromise);
|
|
30
|
-
CAP_PLUGIN_METHOD(trackEvent, CAPPluginReturnPromise);
|
|
31
|
-
CAP_PLUGIN_METHOD(trackPage, CAPPluginReturnPromise);
|
|
32
|
-
CAP_PLUGIN_METHOD(sendSilentCrashReport, CAPPluginReturnPromise);
|
|
33
|
-
CAP_PLUGIN_METHOD(openChecklists, CAPPluginReturnPromise);
|
|
34
|
-
CAP_PLUGIN_METHOD(openChecklist, CAPPluginReturnPromise);
|
|
35
|
-
CAP_PLUGIN_METHOD(startChecklist, CAPPluginReturnPromise);
|
|
36
|
-
CAP_PLUGIN_METHOD(open, CAPPluginReturnPromise);
|
|
37
|
-
CAP_PLUGIN_METHOD(openNews, CAPPluginReturnPromise);
|
|
38
|
-
CAP_PLUGIN_METHOD(showSurvey, CAPPluginReturnPromise);
|
|
39
|
-
CAP_PLUGIN_METHOD(openNewsArticle, CAPPluginReturnPromise);
|
|
40
|
-
CAP_PLUGIN_METHOD(openHelpCenter, CAPPluginReturnPromise);
|
|
41
|
-
CAP_PLUGIN_METHOD(openHelpCenterArticle, CAPPluginReturnPromise);
|
|
42
|
-
CAP_PLUGIN_METHOD(askAI, CAPPluginReturnPromise);
|
|
43
|
-
CAP_PLUGIN_METHOD(openHelpCenterCollection, CAPPluginReturnPromise);
|
|
44
|
-
CAP_PLUGIN_METHOD(searchHelpCenter, CAPPluginReturnPromise);
|
|
45
|
-
CAP_PLUGIN_METHOD(openFeatureRequests, CAPPluginReturnPromise);
|
|
46
|
-
CAP_PLUGIN_METHOD(close, CAPPluginReturnPromise);
|
|
47
|
-
CAP_PLUGIN_METHOD(isOpened, CAPPluginReturnPromise);
|
|
48
|
-
CAP_PLUGIN_METHOD(showFeedbackButton, CAPPluginReturnPromise);
|
|
49
|
-
CAP_PLUGIN_METHOD(enableDebugConsoleLog, CAPPluginReturnPromise);
|
|
50
|
-
CAP_PLUGIN_METHOD(log, CAPPluginReturnPromise);
|
|
51
|
-
CAP_PLUGIN_METHOD(disableConsoleLogOverwrite, CAPPluginReturnPromise);
|
|
52
|
-
CAP_PLUGIN_METHOD(startFeedbackFlow, CAPPluginReturnPromise);
|
|
53
|
-
CAP_PLUGIN_METHOD(startBot, CAPPluginReturnPromise);
|
|
54
|
-
CAP_PLUGIN_METHOD(setLanguage, CAPPluginReturnPromise);
|
|
55
|
-
CAP_PLUGIN_METHOD(setEventCallback, CAPPluginReturnCallback);
|
|
56
|
-
CAP_PLUGIN_METHOD(preFillForm, CAPPluginReturnPromise);
|
|
57
|
-
CAP_PLUGIN_METHOD(addAttachment, CAPPluginReturnPromise);
|
|
58
|
-
CAP_PLUGIN_METHOD(removeAllAttachments, CAPPluginReturnPromise);
|
|
59
|
-
CAP_PLUGIN_METHOD(getIdentity, CAPPluginReturnPromise);
|
|
60
|
-
CAP_PLUGIN_METHOD(isUserIdentified, CAPPluginReturnPromise);
|
|
61
|
-
CAP_PLUGIN_METHOD(setTags, CAPPluginReturnPromise);
|
|
62
|
-
CAP_PLUGIN_METHOD(setDisableInAppNotifications, CAPPluginReturnPromise);
|
|
63
|
-
CAP_PLUGIN_METHOD(setDisableEnvData, CAPPluginReturnPromise);
|
|
64
|
-
CAP_PLUGIN_METHOD(startClassicForm, CAPPluginReturnPromise);
|
|
65
|
-
CAP_PLUGIN_METHOD(startConversation, CAPPluginReturnPromise);
|
|
66
|
-
CAP_PLUGIN_METHOD(openConversations, CAPPluginReturnPromise);
|
|
67
|
-
CAP_PLUGIN_METHOD(setNotificationContainerOffset, CAPPluginReturnPromise);
|
|
68
|
-
)
|
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>
|