cordova-plugin-mserviceinterface-2.0 1.0.101 → 1.0.102
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/package.json +1 -1
- package/plugin.xml +1 -1
- package/templates/ios/SceneDelegate.swift +43 -38
package/package.json
CHANGED
package/plugin.xml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
|
3
|
-
xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-mserviceinterface-2.0" version="1.0.
|
|
3
|
+
xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-mserviceinterface-2.0" version="1.0.102">
|
|
4
4
|
<name>mserviceinterface-2.0</name>
|
|
5
5
|
<description>This plugin establishes the connection to the native interface and performs the requested task.</description>
|
|
6
6
|
<author>selfservit@gmail.com</author>
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import UIKit
|
|
10
10
|
import Cordova
|
|
11
|
+
import WebKit
|
|
11
12
|
|
|
12
13
|
class SceneDelegate: CDVSceneDelegate {
|
|
13
14
|
|
|
@@ -199,52 +200,56 @@ class SceneDelegate: CDVSceneDelegate {
|
|
|
199
200
|
* allowing native code to confirm whether the app-side
|
|
200
201
|
* handler was actually available.
|
|
201
202
|
*/
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
203
|
+
guard let webView =
|
|
204
|
+
viewController.webViewEngine.engineWebView as? WKWebView
|
|
205
|
+
else {
|
|
206
|
+
print(
|
|
207
|
+
"[MService Deep Link] " +
|
|
208
|
+
"WKWebView is not ready"
|
|
209
|
+
)
|
|
205
210
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}
|
|
211
|
+
self.retrySendingDeepLink()
|
|
212
|
+
return
|
|
213
|
+
}
|
|
210
214
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
"JavaScript execution failed: " +
|
|
215
|
-
error.localizedDescription
|
|
216
|
-
)
|
|
215
|
+
webView.evaluateJavaScript(
|
|
216
|
+
javaScript
|
|
217
|
+
) { [weak self] result, error in
|
|
217
218
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
219
|
+
DispatchQueue.main.async {
|
|
220
|
+
guard let self = self else {
|
|
221
|
+
return
|
|
222
|
+
}
|
|
221
223
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
+
if let error = error {
|
|
225
|
+
print(
|
|
226
|
+
"[MService Deep Link] " +
|
|
227
|
+
"JavaScript execution failed: " +
|
|
228
|
+
error.localizedDescription
|
|
229
|
+
)
|
|
224
230
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
self.retrySendingDeepLink()
|
|
243
|
-
}
|
|
244
|
-
}
|
|
231
|
+
self.retrySendingDeepLink()
|
|
232
|
+
return
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
let status =
|
|
236
|
+
result as? String ?? ""
|
|
237
|
+
|
|
238
|
+
print(
|
|
239
|
+
"[MService Deep Link] " +
|
|
240
|
+
"JavaScript status: \(status)"
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
if status == "PROCESSED" {
|
|
244
|
+
self.pendingDeepLinkURL = nil
|
|
245
|
+
self.deepLinkRetryCount = 0
|
|
246
|
+
} else {
|
|
247
|
+
self.retrySendingDeepLink()
|
|
245
248
|
}
|
|
246
249
|
}
|
|
247
250
|
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
248
253
|
|
|
249
254
|
private func retrySendingDeepLink() {
|
|
250
255
|
if self.deepLinkRetryCount <
|