@capawesome/capacitor-system-webview 0.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/CapawesomeCapacitorSystemWebView.podspec +17 -0
- package/LICENSE +21 -0
- package/Package.swift +28 -0
- package/README.md +227 -0
- package/android/build.gradle +60 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/systemwebview/SystemWebView.java +94 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/systemwebview/SystemWebViewPlugin.java +116 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/systemwebview/classes/CustomException.java +20 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/systemwebview/classes/CustomExceptions.java +15 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/systemwebview/classes/options/IsUpdateRequiredOptions.java +21 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/systemwebview/classes/results/GetInfoResult.java +35 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/systemwebview/classes/results/IsUpdateRequiredResult.java +22 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/systemwebview/interfaces/Callback.java +5 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/systemwebview/interfaces/EmptyCallback.java +5 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/systemwebview/interfaces/NonEmptyResultCallback.java +7 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/systemwebview/interfaces/Result.java +7 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/dist/docs.json +190 -0
- package/dist/esm/definitions.d.ts +112 -0
- package/dist/esm/definitions.js +27 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +7 -0
- package/dist/esm/web.js +13 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +54 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +57 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Plugin/Info.plist +24 -0
- package/ios/Plugin/SystemWebViewPlugin.swift +29 -0
- package/package.json +91 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package io.capawesome.capacitorjs.plugins.systemwebview.classes.results;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import com.getcapacitor.JSObject;
|
|
5
|
+
import io.capawesome.capacitorjs.plugins.systemwebview.interfaces.Result;
|
|
6
|
+
|
|
7
|
+
public class IsUpdateRequiredResult implements Result {
|
|
8
|
+
|
|
9
|
+
private final boolean required;
|
|
10
|
+
|
|
11
|
+
public IsUpdateRequiredResult(boolean required) {
|
|
12
|
+
this.required = required;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@Override
|
|
16
|
+
@NonNull
|
|
17
|
+
public JSObject toJSObject() {
|
|
18
|
+
JSObject result = new JSObject();
|
|
19
|
+
result.put("required", required);
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
File without changes
|
package/dist/docs.json
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
{
|
|
2
|
+
"api": {
|
|
3
|
+
"name": "SystemWebViewPlugin",
|
|
4
|
+
"slug": "systemwebviewplugin",
|
|
5
|
+
"docs": "",
|
|
6
|
+
"tags": [],
|
|
7
|
+
"methods": [
|
|
8
|
+
{
|
|
9
|
+
"name": "getInfo",
|
|
10
|
+
"signature": "() => Promise<GetInfoResult>",
|
|
11
|
+
"parameters": [],
|
|
12
|
+
"returns": "Promise<GetInfoResult>",
|
|
13
|
+
"tags": [
|
|
14
|
+
{
|
|
15
|
+
"name": "since",
|
|
16
|
+
"text": "0.1.0"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"docs": "Get information about the active Android System WebView provider.\n\nOnly available on Android.",
|
|
20
|
+
"complexTypes": [
|
|
21
|
+
"GetInfoResult"
|
|
22
|
+
],
|
|
23
|
+
"slug": "getinfo"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "isUpdateRequired",
|
|
27
|
+
"signature": "(options: IsUpdateRequiredOptions) => Promise<IsUpdateRequiredResult>",
|
|
28
|
+
"parameters": [
|
|
29
|
+
{
|
|
30
|
+
"name": "options",
|
|
31
|
+
"docs": "",
|
|
32
|
+
"type": "IsUpdateRequiredOptions"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"returns": "Promise<IsUpdateRequiredResult>",
|
|
36
|
+
"tags": [
|
|
37
|
+
{
|
|
38
|
+
"name": "since",
|
|
39
|
+
"text": "0.1.0"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"docs": "Check whether the active Android System WebView is older than the minimum\nChromium major version required by your app.\n\nOnly available on Android.",
|
|
43
|
+
"complexTypes": [
|
|
44
|
+
"IsUpdateRequiredResult",
|
|
45
|
+
"IsUpdateRequiredOptions"
|
|
46
|
+
],
|
|
47
|
+
"slug": "isupdaterequired"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "openAppStore",
|
|
51
|
+
"signature": "() => Promise<void>",
|
|
52
|
+
"parameters": [],
|
|
53
|
+
"returns": "Promise<void>",
|
|
54
|
+
"tags": [
|
|
55
|
+
{
|
|
56
|
+
"name": "since",
|
|
57
|
+
"text": "0.1.0"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"docs": "Open the Play Store entry of the active Android System WebView provider so\nthe user can update it.\n\nOnly available on Android.",
|
|
61
|
+
"complexTypes": [],
|
|
62
|
+
"slug": "openappstore"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"properties": []
|
|
66
|
+
},
|
|
67
|
+
"interfaces": [
|
|
68
|
+
{
|
|
69
|
+
"name": "GetInfoResult",
|
|
70
|
+
"slug": "getinforesult",
|
|
71
|
+
"docs": "",
|
|
72
|
+
"tags": [
|
|
73
|
+
{
|
|
74
|
+
"text": "0.1.0",
|
|
75
|
+
"name": "since"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"methods": [],
|
|
79
|
+
"properties": [
|
|
80
|
+
{
|
|
81
|
+
"name": "majorVersion",
|
|
82
|
+
"tags": [
|
|
83
|
+
{
|
|
84
|
+
"text": "0.1.0",
|
|
85
|
+
"name": "since"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"text": "126",
|
|
89
|
+
"name": "example"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"docs": "The Chromium major version of the active WebView provider.\n\nThis is the integer before the first dot of the `versionName`\n(e.g. `126` for `126.0.6478.122`).\n\n`null` if the `versionName` is not a Chromium-style version, which can\nhappen with OEM WebView forks.",
|
|
93
|
+
"complexTypes": [],
|
|
94
|
+
"type": "number | null"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "packageName",
|
|
98
|
+
"tags": [
|
|
99
|
+
{
|
|
100
|
+
"text": "0.1.0",
|
|
101
|
+
"name": "since"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"text": "\"com.google.android.webview\"",
|
|
105
|
+
"name": "example"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"docs": "The package name of the active WebView provider.",
|
|
109
|
+
"complexTypes": [],
|
|
110
|
+
"type": "string"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"name": "versionName",
|
|
114
|
+
"tags": [
|
|
115
|
+
{
|
|
116
|
+
"text": "0.1.0",
|
|
117
|
+
"name": "since"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"text": "\"126.0.6478.122\"",
|
|
121
|
+
"name": "example"
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"docs": "The version name of the active WebView provider.",
|
|
125
|
+
"complexTypes": [],
|
|
126
|
+
"type": "string"
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"name": "IsUpdateRequiredResult",
|
|
132
|
+
"slug": "isupdaterequiredresult",
|
|
133
|
+
"docs": "",
|
|
134
|
+
"tags": [
|
|
135
|
+
{
|
|
136
|
+
"text": "0.1.0",
|
|
137
|
+
"name": "since"
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
"methods": [],
|
|
141
|
+
"properties": [
|
|
142
|
+
{
|
|
143
|
+
"name": "required",
|
|
144
|
+
"tags": [
|
|
145
|
+
{
|
|
146
|
+
"text": "0.1.0",
|
|
147
|
+
"name": "since"
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
"docs": "`true` if the active WebView is older than the required minimum version,\notherwise `false`.",
|
|
151
|
+
"complexTypes": [],
|
|
152
|
+
"type": "boolean"
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"name": "IsUpdateRequiredOptions",
|
|
158
|
+
"slug": "isupdaterequiredoptions",
|
|
159
|
+
"docs": "",
|
|
160
|
+
"tags": [
|
|
161
|
+
{
|
|
162
|
+
"text": "0.1.0",
|
|
163
|
+
"name": "since"
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
"methods": [],
|
|
167
|
+
"properties": [
|
|
168
|
+
{
|
|
169
|
+
"name": "minMajorVersion",
|
|
170
|
+
"tags": [
|
|
171
|
+
{
|
|
172
|
+
"text": "0.1.0",
|
|
173
|
+
"name": "since"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"text": "105",
|
|
177
|
+
"name": "example"
|
|
178
|
+
}
|
|
179
|
+
],
|
|
180
|
+
"docs": "The minimum Chromium major version your app requires.\n\nThe active WebView is considered outdated if its `majorVersion` is lower\nthan this value.",
|
|
181
|
+
"complexTypes": [],
|
|
182
|
+
"type": "number"
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
],
|
|
187
|
+
"enums": [],
|
|
188
|
+
"typeAliases": [],
|
|
189
|
+
"pluginConfigs": []
|
|
190
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
export interface SystemWebViewPlugin {
|
|
2
|
+
/**
|
|
3
|
+
* Get information about the active Android System WebView provider.
|
|
4
|
+
*
|
|
5
|
+
* Only available on Android.
|
|
6
|
+
*
|
|
7
|
+
* @since 0.1.0
|
|
8
|
+
*/
|
|
9
|
+
getInfo(): Promise<GetInfoResult>;
|
|
10
|
+
/**
|
|
11
|
+
* Check whether the active Android System WebView is older than the minimum
|
|
12
|
+
* Chromium major version required by your app.
|
|
13
|
+
*
|
|
14
|
+
* Only available on Android.
|
|
15
|
+
*
|
|
16
|
+
* @since 0.1.0
|
|
17
|
+
*/
|
|
18
|
+
isUpdateRequired(options: IsUpdateRequiredOptions): Promise<IsUpdateRequiredResult>;
|
|
19
|
+
/**
|
|
20
|
+
* Open the Play Store entry of the active Android System WebView provider so
|
|
21
|
+
* the user can update it.
|
|
22
|
+
*
|
|
23
|
+
* Only available on Android.
|
|
24
|
+
*
|
|
25
|
+
* @since 0.1.0
|
|
26
|
+
*/
|
|
27
|
+
openAppStore(): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @since 0.1.0
|
|
31
|
+
*/
|
|
32
|
+
export interface GetInfoResult {
|
|
33
|
+
/**
|
|
34
|
+
* The Chromium major version of the active WebView provider.
|
|
35
|
+
*
|
|
36
|
+
* This is the integer before the first dot of the `versionName`
|
|
37
|
+
* (e.g. `126` for `126.0.6478.122`).
|
|
38
|
+
*
|
|
39
|
+
* `null` if the `versionName` is not a Chromium-style version, which can
|
|
40
|
+
* happen with OEM WebView forks.
|
|
41
|
+
*
|
|
42
|
+
* @since 0.1.0
|
|
43
|
+
* @example 126
|
|
44
|
+
*/
|
|
45
|
+
majorVersion: number | null;
|
|
46
|
+
/**
|
|
47
|
+
* The package name of the active WebView provider.
|
|
48
|
+
*
|
|
49
|
+
* @since 0.1.0
|
|
50
|
+
* @example "com.google.android.webview"
|
|
51
|
+
*/
|
|
52
|
+
packageName: string;
|
|
53
|
+
/**
|
|
54
|
+
* The version name of the active WebView provider.
|
|
55
|
+
*
|
|
56
|
+
* @since 0.1.0
|
|
57
|
+
* @example "126.0.6478.122"
|
|
58
|
+
*/
|
|
59
|
+
versionName: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* @since 0.1.0
|
|
63
|
+
*/
|
|
64
|
+
export interface IsUpdateRequiredOptions {
|
|
65
|
+
/**
|
|
66
|
+
* The minimum Chromium major version your app requires.
|
|
67
|
+
*
|
|
68
|
+
* The active WebView is considered outdated if its `majorVersion` is lower
|
|
69
|
+
* than this value.
|
|
70
|
+
*
|
|
71
|
+
* @since 0.1.0
|
|
72
|
+
* @example 105
|
|
73
|
+
*/
|
|
74
|
+
minMajorVersion: number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* @since 0.1.0
|
|
78
|
+
*/
|
|
79
|
+
export interface IsUpdateRequiredResult {
|
|
80
|
+
/**
|
|
81
|
+
* `true` if the active WebView is older than the required minimum version,
|
|
82
|
+
* otherwise `false`.
|
|
83
|
+
*
|
|
84
|
+
* @since 0.1.0
|
|
85
|
+
*/
|
|
86
|
+
required: boolean;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* @since 0.1.0
|
|
90
|
+
*/
|
|
91
|
+
export declare enum ErrorCode {
|
|
92
|
+
/**
|
|
93
|
+
* The Play Store could not be opened.
|
|
94
|
+
*
|
|
95
|
+
* @since 0.1.0
|
|
96
|
+
*/
|
|
97
|
+
OpenFailed = "OPEN_FAILED",
|
|
98
|
+
/**
|
|
99
|
+
* The WebView version name is not a Chromium-style version and could not be
|
|
100
|
+
* parsed into a major version.
|
|
101
|
+
*
|
|
102
|
+
* @since 0.1.0
|
|
103
|
+
*/
|
|
104
|
+
VersionUnparseable = "VERSION_UNPARSEABLE",
|
|
105
|
+
/**
|
|
106
|
+
* The active WebView package could not be determined, which can happen on
|
|
107
|
+
* custom ROMs or when the System WebView is disabled.
|
|
108
|
+
*
|
|
109
|
+
* @since 0.1.0
|
|
110
|
+
*/
|
|
111
|
+
WebViewPackageUnavailable = "WEB_VIEW_PACKAGE_UNAVAILABLE"
|
|
112
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 0.1.0
|
|
3
|
+
*/
|
|
4
|
+
export var ErrorCode;
|
|
5
|
+
(function (ErrorCode) {
|
|
6
|
+
/**
|
|
7
|
+
* The Play Store could not be opened.
|
|
8
|
+
*
|
|
9
|
+
* @since 0.1.0
|
|
10
|
+
*/
|
|
11
|
+
ErrorCode["OpenFailed"] = "OPEN_FAILED";
|
|
12
|
+
/**
|
|
13
|
+
* The WebView version name is not a Chromium-style version and could not be
|
|
14
|
+
* parsed into a major version.
|
|
15
|
+
*
|
|
16
|
+
* @since 0.1.0
|
|
17
|
+
*/
|
|
18
|
+
ErrorCode["VersionUnparseable"] = "VERSION_UNPARSEABLE";
|
|
19
|
+
/**
|
|
20
|
+
* The active WebView package could not be determined, which can happen on
|
|
21
|
+
* custom ROMs or when the System WebView is disabled.
|
|
22
|
+
*
|
|
23
|
+
* @since 0.1.0
|
|
24
|
+
*/
|
|
25
|
+
ErrorCode["WebViewPackageUnavailable"] = "WEB_VIEW_PACKAGE_UNAVAILABLE";
|
|
26
|
+
})(ErrorCode || (ErrorCode = {}));
|
|
27
|
+
//# sourceMappingURL=definitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AA6FA;;GAEG;AACH,MAAM,CAAN,IAAY,SAqBX;AArBD,WAAY,SAAS;IACnB;;;;OAIG;IACH,uCAA0B,CAAA;IAC1B;;;;;OAKG;IACH,uDAA0C,CAAA;IAC1C;;;;;OAKG;IACH,uEAA0D,CAAA;AAC5D,CAAC,EArBW,SAAS,KAAT,SAAS,QAqBpB","sourcesContent":["export interface SystemWebViewPlugin {\n /**\n * Get information about the active Android System WebView provider.\n *\n * Only available on Android.\n *\n * @since 0.1.0\n */\n getInfo(): Promise<GetInfoResult>;\n /**\n * Check whether the active Android System WebView is older than the minimum\n * Chromium major version required by your app.\n *\n * Only available on Android.\n *\n * @since 0.1.0\n */\n isUpdateRequired(\n options: IsUpdateRequiredOptions,\n ): Promise<IsUpdateRequiredResult>;\n /**\n * Open the Play Store entry of the active Android System WebView provider so\n * the user can update it.\n *\n * Only available on Android.\n *\n * @since 0.1.0\n */\n openAppStore(): Promise<void>;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface GetInfoResult {\n /**\n * The Chromium major version of the active WebView provider.\n *\n * This is the integer before the first dot of the `versionName`\n * (e.g. `126` for `126.0.6478.122`).\n *\n * `null` if the `versionName` is not a Chromium-style version, which can\n * happen with OEM WebView forks.\n *\n * @since 0.1.0\n * @example 126\n */\n majorVersion: number | null;\n /**\n * The package name of the active WebView provider.\n *\n * @since 0.1.0\n * @example \"com.google.android.webview\"\n */\n packageName: string;\n /**\n * The version name of the active WebView provider.\n *\n * @since 0.1.0\n * @example \"126.0.6478.122\"\n */\n versionName: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface IsUpdateRequiredOptions {\n /**\n * The minimum Chromium major version your app requires.\n *\n * The active WebView is considered outdated if its `majorVersion` is lower\n * than this value.\n *\n * @since 0.1.0\n * @example 105\n */\n minMajorVersion: number;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface IsUpdateRequiredResult {\n /**\n * `true` if the active WebView is older than the required minimum version,\n * otherwise `false`.\n *\n * @since 0.1.0\n */\n required: boolean;\n}\n\n/**\n * @since 0.1.0\n */\nexport enum ErrorCode {\n /**\n * The Play Store could not be opened.\n *\n * @since 0.1.0\n */\n OpenFailed = 'OPEN_FAILED',\n /**\n * The WebView version name is not a Chromium-style version and could not be\n * parsed into a major version.\n *\n * @since 0.1.0\n */\n VersionUnparseable = 'VERSION_UNPARSEABLE',\n /**\n * The active WebView package could not be determined, which can happen on\n * custom ROMs or when the System WebView is disabled.\n *\n * @since 0.1.0\n */\n WebViewPackageUnavailable = 'WEB_VIEW_PACKAGE_UNAVAILABLE',\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { registerPlugin } from '@capacitor/core';
|
|
2
|
+
const SystemWebView = registerPlugin('SystemWebView', {
|
|
3
|
+
web: () => import('./web').then(m => new m.SystemWebViewWeb()),
|
|
4
|
+
});
|
|
5
|
+
export * from './definitions';
|
|
6
|
+
export { SystemWebView };
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,aAAa,GAAG,cAAc,CAAsB,eAAe,EAAE;IACzE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,gBAAgB,EAAE,CAAC;CAC/D,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { SystemWebViewPlugin } from './definitions';\n\nconst SystemWebView = registerPlugin<SystemWebViewPlugin>('SystemWebView', {\n web: () => import('./web').then(m => new m.SystemWebViewWeb()),\n});\n\nexport * from './definitions';\nexport { SystemWebView };\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
import type { GetInfoResult, IsUpdateRequiredResult, SystemWebViewPlugin } from './definitions';
|
|
3
|
+
export declare class SystemWebViewWeb extends WebPlugin implements SystemWebViewPlugin {
|
|
4
|
+
getInfo(): Promise<GetInfoResult>;
|
|
5
|
+
isUpdateRequired(): Promise<IsUpdateRequiredResult>;
|
|
6
|
+
openAppStore(): Promise<void>;
|
|
7
|
+
}
|
package/dist/esm/web.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
export class SystemWebViewWeb extends WebPlugin {
|
|
3
|
+
async getInfo() {
|
|
4
|
+
throw this.unimplemented('Not implemented on web.');
|
|
5
|
+
}
|
|
6
|
+
async isUpdateRequired() {
|
|
7
|
+
throw this.unimplemented('Not implemented on web.');
|
|
8
|
+
}
|
|
9
|
+
async openAppStore() {
|
|
10
|
+
throw this.unimplemented('Not implemented on web.');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,MAAM,OAAO,gBAAiB,SAAQ,SAAS;IAC7C,KAAK,CAAC,OAAO;QACX,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n GetInfoResult,\n IsUpdateRequiredResult,\n SystemWebViewPlugin,\n} from './definitions';\n\nexport class SystemWebViewWeb extends WebPlugin implements SystemWebViewPlugin {\n async getInfo(): Promise<GetInfoResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async isUpdateRequired(): Promise<IsUpdateRequiredResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async openAppStore(): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@capacitor/core');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @since 0.1.0
|
|
7
|
+
*/
|
|
8
|
+
exports.ErrorCode = void 0;
|
|
9
|
+
(function (ErrorCode) {
|
|
10
|
+
/**
|
|
11
|
+
* The Play Store could not be opened.
|
|
12
|
+
*
|
|
13
|
+
* @since 0.1.0
|
|
14
|
+
*/
|
|
15
|
+
ErrorCode["OpenFailed"] = "OPEN_FAILED";
|
|
16
|
+
/**
|
|
17
|
+
* The WebView version name is not a Chromium-style version and could not be
|
|
18
|
+
* parsed into a major version.
|
|
19
|
+
*
|
|
20
|
+
* @since 0.1.0
|
|
21
|
+
*/
|
|
22
|
+
ErrorCode["VersionUnparseable"] = "VERSION_UNPARSEABLE";
|
|
23
|
+
/**
|
|
24
|
+
* The active WebView package could not be determined, which can happen on
|
|
25
|
+
* custom ROMs or when the System WebView is disabled.
|
|
26
|
+
*
|
|
27
|
+
* @since 0.1.0
|
|
28
|
+
*/
|
|
29
|
+
ErrorCode["WebViewPackageUnavailable"] = "WEB_VIEW_PACKAGE_UNAVAILABLE";
|
|
30
|
+
})(exports.ErrorCode || (exports.ErrorCode = {}));
|
|
31
|
+
|
|
32
|
+
const SystemWebView = core.registerPlugin('SystemWebView', {
|
|
33
|
+
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.SystemWebViewWeb()),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
class SystemWebViewWeb extends core.WebPlugin {
|
|
37
|
+
async getInfo() {
|
|
38
|
+
throw this.unimplemented('Not implemented on web.');
|
|
39
|
+
}
|
|
40
|
+
async isUpdateRequired() {
|
|
41
|
+
throw this.unimplemented('Not implemented on web.');
|
|
42
|
+
}
|
|
43
|
+
async openAppStore() {
|
|
44
|
+
throw this.unimplemented('Not implemented on web.');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
var web = /*#__PURE__*/Object.freeze({
|
|
49
|
+
__proto__: null,
|
|
50
|
+
SystemWebViewWeb: SystemWebViewWeb
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
exports.SystemWebView = SystemWebView;
|
|
54
|
+
//# sourceMappingURL=plugin.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * @since 0.1.0\n */\nexport var ErrorCode;\n(function (ErrorCode) {\n /**\n * The Play Store could not be opened.\n *\n * @since 0.1.0\n */\n ErrorCode[\"OpenFailed\"] = \"OPEN_FAILED\";\n /**\n * The WebView version name is not a Chromium-style version and could not be\n * parsed into a major version.\n *\n * @since 0.1.0\n */\n ErrorCode[\"VersionUnparseable\"] = \"VERSION_UNPARSEABLE\";\n /**\n * The active WebView package could not be determined, which can happen on\n * custom ROMs or when the System WebView is disabled.\n *\n * @since 0.1.0\n */\n ErrorCode[\"WebViewPackageUnavailable\"] = \"WEB_VIEW_PACKAGE_UNAVAILABLE\";\n})(ErrorCode || (ErrorCode = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst SystemWebView = registerPlugin('SystemWebView', {\n web: () => import('./web').then(m => new m.SystemWebViewWeb()),\n});\nexport * from './definitions';\nexport { SystemWebView };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class SystemWebViewWeb extends WebPlugin {\n async getInfo() {\n throw this.unimplemented('Not implemented on web.');\n }\n async isUpdateRequired() {\n throw this.unimplemented('Not implemented on web.');\n }\n async openAppStore() {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ErrorCode","registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACWA;AACX,CAAC,UAAU,SAAS,EAAE;AACtB;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,YAAY,CAAC,GAAG,aAAa;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,oBAAoB,CAAC,GAAG,qBAAqB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,2BAA2B,CAAC,GAAG,8BAA8B;AAC3E,CAAC,EAAEA,iBAAS,KAAKA,iBAAS,GAAG,EAAE,CAAC,CAAC;;ACxB5B,MAAC,aAAa,GAAGC,mBAAc,CAAC,eAAe,EAAE;AACtD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,gBAAgB,EAAE,CAAC;AAClE,CAAC;;ACFM,MAAM,gBAAgB,SAASC,cAAS,CAAC;AAChD,IAAI,MAAM,OAAO,GAAG;AACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,YAAY,GAAG;AACzB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var capacitorSim = (function (exports, core) {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @since 0.1.0
|
|
6
|
+
*/
|
|
7
|
+
exports.ErrorCode = void 0;
|
|
8
|
+
(function (ErrorCode) {
|
|
9
|
+
/**
|
|
10
|
+
* The Play Store could not be opened.
|
|
11
|
+
*
|
|
12
|
+
* @since 0.1.0
|
|
13
|
+
*/
|
|
14
|
+
ErrorCode["OpenFailed"] = "OPEN_FAILED";
|
|
15
|
+
/**
|
|
16
|
+
* The WebView version name is not a Chromium-style version and could not be
|
|
17
|
+
* parsed into a major version.
|
|
18
|
+
*
|
|
19
|
+
* @since 0.1.0
|
|
20
|
+
*/
|
|
21
|
+
ErrorCode["VersionUnparseable"] = "VERSION_UNPARSEABLE";
|
|
22
|
+
/**
|
|
23
|
+
* The active WebView package could not be determined, which can happen on
|
|
24
|
+
* custom ROMs or when the System WebView is disabled.
|
|
25
|
+
*
|
|
26
|
+
* @since 0.1.0
|
|
27
|
+
*/
|
|
28
|
+
ErrorCode["WebViewPackageUnavailable"] = "WEB_VIEW_PACKAGE_UNAVAILABLE";
|
|
29
|
+
})(exports.ErrorCode || (exports.ErrorCode = {}));
|
|
30
|
+
|
|
31
|
+
const SystemWebView = core.registerPlugin('SystemWebView', {
|
|
32
|
+
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.SystemWebViewWeb()),
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
class SystemWebViewWeb extends core.WebPlugin {
|
|
36
|
+
async getInfo() {
|
|
37
|
+
throw this.unimplemented('Not implemented on web.');
|
|
38
|
+
}
|
|
39
|
+
async isUpdateRequired() {
|
|
40
|
+
throw this.unimplemented('Not implemented on web.');
|
|
41
|
+
}
|
|
42
|
+
async openAppStore() {
|
|
43
|
+
throw this.unimplemented('Not implemented on web.');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
var web = /*#__PURE__*/Object.freeze({
|
|
48
|
+
__proto__: null,
|
|
49
|
+
SystemWebViewWeb: SystemWebViewWeb
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
exports.SystemWebView = SystemWebView;
|
|
53
|
+
|
|
54
|
+
return exports;
|
|
55
|
+
|
|
56
|
+
})({}, capacitorExports);
|
|
57
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * @since 0.1.0\n */\nexport var ErrorCode;\n(function (ErrorCode) {\n /**\n * The Play Store could not be opened.\n *\n * @since 0.1.0\n */\n ErrorCode[\"OpenFailed\"] = \"OPEN_FAILED\";\n /**\n * The WebView version name is not a Chromium-style version and could not be\n * parsed into a major version.\n *\n * @since 0.1.0\n */\n ErrorCode[\"VersionUnparseable\"] = \"VERSION_UNPARSEABLE\";\n /**\n * The active WebView package could not be determined, which can happen on\n * custom ROMs or when the System WebView is disabled.\n *\n * @since 0.1.0\n */\n ErrorCode[\"WebViewPackageUnavailable\"] = \"WEB_VIEW_PACKAGE_UNAVAILABLE\";\n})(ErrorCode || (ErrorCode = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst SystemWebView = registerPlugin('SystemWebView', {\n web: () => import('./web').then(m => new m.SystemWebViewWeb()),\n});\nexport * from './definitions';\nexport { SystemWebView };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class SystemWebViewWeb extends WebPlugin {\n async getInfo() {\n throw this.unimplemented('Not implemented on web.');\n }\n async isUpdateRequired() {\n throw this.unimplemented('Not implemented on web.');\n }\n async openAppStore() {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ErrorCode","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;AACWA;IACX,CAAC,UAAU,SAAS,EAAE;IACtB;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,YAAY,CAAC,GAAG,aAAa;IAC3C;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,oBAAoB,CAAC,GAAG,qBAAqB;IAC3D;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,2BAA2B,CAAC,GAAG,8BAA8B;IAC3E,CAAC,EAAEA,iBAAS,KAAKA,iBAAS,GAAG,EAAE,CAAC,CAAC;;ACxB5B,UAAC,aAAa,GAAGC,mBAAc,CAAC,eAAe,EAAE;IACtD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAClE,CAAC;;ICFM,MAAM,gBAAgB,SAASC,cAAS,CAAC;IAChD,IAAI,MAAM,OAAO,GAAG;IACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,YAAY,GAAG;IACzB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
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>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import Capacitor
|
|
3
|
+
|
|
4
|
+
@objc(SystemWebViewPlugin)
|
|
5
|
+
public class SystemWebViewPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
6
|
+
public let identifier = "SystemWebViewPlugin"
|
|
7
|
+
public let jsName = "SystemWebView"
|
|
8
|
+
public let pluginMethods: [CAPPluginMethod] = [
|
|
9
|
+
CAPPluginMethod(name: "getInfo", returnType: CAPPluginReturnPromise),
|
|
10
|
+
CAPPluginMethod(name: "isUpdateRequired", returnType: CAPPluginReturnPromise),
|
|
11
|
+
CAPPluginMethod(name: "openAppStore", returnType: CAPPluginReturnPromise)
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
@objc func getInfo(_ call: CAPPluginCall) {
|
|
15
|
+
rejectCallAsUnimplemented(call)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@objc func isUpdateRequired(_ call: CAPPluginCall) {
|
|
19
|
+
rejectCallAsUnimplemented(call)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@objc func openAppStore(_ call: CAPPluginCall) {
|
|
23
|
+
rejectCallAsUnimplemented(call)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
private func rejectCallAsUnimplemented(_ call: CAPPluginCall) {
|
|
27
|
+
call.unimplemented("This method is not available on this platform.")
|
|
28
|
+
}
|
|
29
|
+
}
|