capacitor-gleap-plugin 19.0.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.
@@ -77,6 +77,7 @@ public class GleapPlugin: CAPPlugin, CAPBridgedPlugin, GleapDelegate {
77
77
  CAPPluginMethod(name: "startConversation", returnType: CAPPluginReturnPromise),
78
78
  CAPPluginMethod(name: "openConversations", returnType: CAPPluginReturnPromise),
79
79
  CAPPluginMethod(name: "openConversation", returnType: CAPPluginReturnPromise),
80
+ CAPPluginMethod(name: "openProtectedFileFromUrl", returnType: CAPPluginReturnPromise),
80
81
  CAPPluginMethod(name: "setNotificationContainerOffset", returnType: CAPPluginReturnPromise)
81
82
  ]
82
83
 
@@ -1027,6 +1028,29 @@ public class GleapPlugin: CAPPlugin, CAPBridgedPlugin, GleapDelegate {
1027
1028
  openConversations(call)
1028
1029
  }
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
+
1030
1054
  @objc func startFeedbackFlow(_ call: CAPPluginCall) {
1031
1055
  let feedbackFlow = call.getString("feedbackFlow") ?? "bugreporting"
1032
1056
  let showBackButton = call.getBool("showBackButton") ?? true
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": "19.0.0",
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",