@onairosofficial/onairos-capacitor 0.1.1 → 0.1.3

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.
@@ -0,0 +1,33 @@
1
+ import UIKit
2
+ import Capacitor
3
+
4
+ @objc(OnairosNetflixNativePlugin)
5
+ class OnairosNetflixNativePlugin: CAPPlugin, CAPBridgedPlugin {
6
+ public let identifier = "OnairosNetflixNativePlugin"
7
+ public let jsName = "OnairosNetflixNative"
8
+ public let pluginMethods: [CAPPluginMethod] = [
9
+ CAPPluginMethod(name: "connectNetflixNative", returnType: CAPPluginReturnPromise),
10
+ CAPPluginMethod(name: "closeNetflixConnector", returnType: CAPPluginReturnPromise),
11
+ CAPPluginMethod(name: "openNetflixConnector", returnType: CAPPluginReturnPromise)
12
+ ]
13
+
14
+ @objc func connectNetflixNative(_ call: CAPPluginCall) {
15
+ notifyListeners("onairosNativeConnectorEvent", data: [
16
+ "platform": "netflix",
17
+ "status": "error",
18
+ "message": "Netflix native WKWebView connector is not implemented in this local test plugin yet."
19
+ ])
20
+ call.reject("Netflix native WKWebView connector is not implemented in this local test plugin yet.")
21
+ }
22
+
23
+ @objc func closeNetflixConnector(_ call: CAPPluginCall) {
24
+ call.resolve()
25
+ }
26
+
27
+ @objc func openNetflixConnector(_ call: CAPPluginCall) {
28
+ if let url = URL(string: "https://www.netflix.com") {
29
+ UIApplication.shared.open(url)
30
+ }
31
+ call.resolve()
32
+ }
33
+ }