@aigens/aigens-sdk-core 0.0.9 → 0.0.12
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/README.md +16 -0
- package/android/src/main/java/com/aigens/sdk/WebContainerActivity.java +59 -17
- package/android/src/main/java/com/aigens/sdk/plugins/CorePlugin.java +30 -0
- package/dist/docs.json +16 -0
- package/dist/esm/definitions.d.ts +1 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +1 -0
- package/dist/esm/web.js +8 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +8 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +8 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/CorePlugin.m +1 -0
- package/ios/Plugin/CorePlugin.swift +12 -1
- package/ios/Plugin/WebContainerViewController.swift +31 -29
- package/package.json +1 -4
package/README.md
CHANGED
@@ -17,6 +17,7 @@ npx cap sync
|
|
17
17
|
* [`dismiss(...)`](#dismiss)
|
18
18
|
* [`finish(...)`](#finish)
|
19
19
|
* [`getMember(...)`](#getmember)
|
20
|
+
* [`getDeeplink(...)`](#getdeeplink)
|
20
21
|
* [`openBrowser(...)`](#openbrowser)
|
21
22
|
* [`isInstalledApp(...)`](#isinstalledapp)
|
22
23
|
* [`getIsProductionEnvironment()`](#getisproductionenvironment)
|
@@ -87,6 +88,21 @@ getMember(options: any) => Promise<any>
|
|
87
88
|
--------------------
|
88
89
|
|
89
90
|
|
91
|
+
### getDeeplink(...)
|
92
|
+
|
93
|
+
```typescript
|
94
|
+
getDeeplink(options: any) => Promise<any>
|
95
|
+
```
|
96
|
+
|
97
|
+
| Param | Type |
|
98
|
+
| ------------- | ---------------- |
|
99
|
+
| **`options`** | <code>any</code> |
|
100
|
+
|
101
|
+
**Returns:** <code>Promise<any></code>
|
102
|
+
|
103
|
+
--------------------
|
104
|
+
|
105
|
+
|
90
106
|
### openBrowser(...)
|
91
107
|
|
92
108
|
```typescript
|
@@ -46,16 +46,27 @@ public class WebContainerActivity extends BridgeActivity {
|
|
46
46
|
private String url;
|
47
47
|
private boolean navbar = false;
|
48
48
|
private Map member;
|
49
|
+
private Map deeplink;
|
49
50
|
private boolean ENVIRONMENT_PRODUCTION = true;
|
51
|
+
private String[] shouldRedirectList = new String[] {
|
52
|
+
"/scan?",
|
53
|
+
"/qr?",
|
54
|
+
"//scan",
|
55
|
+
"/api/v1/pay",
|
56
|
+
"/api/v1/wechat",
|
57
|
+
"/api/v1/qfpaywechat"
|
58
|
+
};
|
50
59
|
private List<String> externalProtocols = new ArrayList<String>(){{
|
51
60
|
add("octopus://");
|
52
61
|
add("alipay://");
|
53
62
|
add("alipays://");
|
54
63
|
add("alipayhk://");
|
64
|
+
add("weixin://");
|
55
65
|
add("tel:");
|
56
66
|
add("mailto:");
|
57
67
|
add("payme://");
|
58
68
|
add("https://play.google.com");
|
69
|
+
add("hsbcpaymepay://");
|
59
70
|
}};
|
60
71
|
|
61
72
|
private void debug(Object... msgs){
|
@@ -78,7 +89,7 @@ public class WebContainerActivity extends BridgeActivity {
|
|
78
89
|
|
79
90
|
setContentView(com.aigens.sdk.R.layout.sdk_layout_main);
|
80
91
|
|
81
|
-
|
92
|
+
|
82
93
|
|
83
94
|
Intent intent = getIntent();
|
84
95
|
this.url = intent.getStringExtra("url");
|
@@ -87,6 +98,7 @@ public class WebContainerActivity extends BridgeActivity {
|
|
87
98
|
this.navbar = intent.getBooleanExtra("navbar", false);
|
88
99
|
|
89
100
|
this.member = (Map) intent.getSerializableExtra("member");
|
101
|
+
this.deeplink = (Map) intent.getSerializableExtra("deeplink");
|
90
102
|
boolean ENVIRONMENT_PRODUCTION = intent.getBooleanExtra("ENVIRONMENT_PRODUCTION", true);
|
91
103
|
CorePlugin.setENVIRONMENT_PRODUCTION(ENVIRONMENT_PRODUCTION);
|
92
104
|
|
@@ -100,6 +112,9 @@ public class WebContainerActivity extends BridgeActivity {
|
|
100
112
|
if(this.member != null) {
|
101
113
|
CorePlugin.setMember(this.member);
|
102
114
|
}
|
115
|
+
if (this.deeplink != null) {
|
116
|
+
CorePlugin.setDeeplink(this.deeplink);
|
117
|
+
}
|
103
118
|
|
104
119
|
System.out.println("OPEN URL:"+ url);
|
105
120
|
|
@@ -110,6 +125,9 @@ public class WebContainerActivity extends BridgeActivity {
|
|
110
125
|
if(member != null){
|
111
126
|
debug("member", member);
|
112
127
|
}
|
128
|
+
if(member != null){
|
129
|
+
debug("deeplink", deeplink);
|
130
|
+
}
|
113
131
|
|
114
132
|
JSONObject config = readConfig();
|
115
133
|
|
@@ -148,12 +166,12 @@ public class WebContainerActivity extends BridgeActivity {
|
|
148
166
|
}
|
149
167
|
|
150
168
|
addExtraPlugins(new String[] {
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
169
|
+
"com.aigens.googlepay.GooglePayPlugin",
|
170
|
+
"com.aigens.octopus.OctopusPlugin",
|
171
|
+
"com.aigens.wechatpay.WechatPayPlugin",
|
172
|
+
"com.aigens.alipay.AliPayPlugin",
|
173
|
+
"com.aigens.alipayhk.AliPayhkPlugin",
|
174
|
+
"com.aigens.payme.PaymePlugin",
|
157
175
|
}, plugins);
|
158
176
|
addExtraPlugins(intent.getStringArrayExtra("extraClasspaths"), plugins);
|
159
177
|
|
@@ -167,9 +185,18 @@ public class WebContainerActivity extends BridgeActivity {
|
|
167
185
|
wvc.activity = this;
|
168
186
|
wvc.externalProtocols = this.externalProtocols;
|
169
187
|
this.bridge.getWebView().setWebViewClient(wvc);
|
188
|
+
this.bridge.getWebView().setWebContentsDebuggingEnabled(true);
|
189
|
+
|
190
|
+
// this.bridge.getWebView().getSettings().setAppCacheEnabled(false);
|
191
|
+
// this.bridge.getWebView().clearCache(true);
|
192
|
+
// this.bridge.getWebView().clearHistory();
|
193
|
+
// this.bridge.getWebView().clearFormData();
|
194
|
+
// this.bridge.getWebView().getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
|
170
195
|
|
171
196
|
initView();
|
172
197
|
initLayout(false, true, false);
|
198
|
+
|
199
|
+
disableServiceWorker(this.url, this.bridge);
|
173
200
|
}
|
174
201
|
|
175
202
|
private void addExtraPlugins(String[] extraClasspaths, List<Class<? extends Plugin>> plugins) {
|
@@ -182,7 +209,7 @@ public class WebContainerActivity extends BridgeActivity {
|
|
182
209
|
String clsName = sub.getName();
|
183
210
|
Boolean add = false;
|
184
211
|
for (Class<? extends Plugin> plugin : plugins) {
|
185
|
-
if (plugin.getName()
|
212
|
+
if (plugin.getName().equals(clsName)) {
|
186
213
|
add = true;
|
187
214
|
break;
|
188
215
|
}
|
@@ -283,7 +310,7 @@ public class WebContainerActivity extends BridgeActivity {
|
|
283
310
|
|
284
311
|
private static boolean SW_DISABLED = false;
|
285
312
|
|
286
|
-
private static void disableServiceWorker(){
|
313
|
+
private static void disableServiceWorker(String originUrl, Bridge bridge){
|
287
314
|
|
288
315
|
if(SW_DISABLED) return;
|
289
316
|
|
@@ -292,7 +319,13 @@ public class WebContainerActivity extends BridgeActivity {
|
|
292
319
|
@Override
|
293
320
|
public WebResourceResponse shouldInterceptRequest(WebResourceRequest request) {
|
294
321
|
|
295
|
-
|
322
|
+
// Fixed: Sometimes the plugin cannot be loaded
|
323
|
+
// String currentUrl = request.getUrl().toString();
|
324
|
+
// if (currentUrl.equals(originUrl)) {
|
325
|
+
// return bridge.getLocalServer().shouldInterceptRequest(request);
|
326
|
+
// }
|
327
|
+
// return null;
|
328
|
+
return bridge.getLocalServer().shouldInterceptRequest(request);
|
296
329
|
}
|
297
330
|
});
|
298
331
|
}
|
@@ -379,7 +412,7 @@ public class WebContainerActivity extends BridgeActivity {
|
|
379
412
|
Log.e(TAG, "Error dialing " + url + ": " + e.toString());
|
380
413
|
}
|
381
414
|
} else if (url.startsWith("geo:") || url.startsWith(WebView.SCHEME_MAILTO) || url.startsWith("market:")
|
382
|
-
|
415
|
+
|| loopExternalProtocols(url)) {
|
383
416
|
try {
|
384
417
|
Intent intent = new Intent(Intent.ACTION_VIEW);
|
385
418
|
intent.setData(Uri.parse(url));
|
@@ -431,17 +464,26 @@ public class WebContainerActivity extends BridgeActivity {
|
|
431
464
|
String url = request.getUrl().toString();
|
432
465
|
//debug("shouldInterceptRequest", url);
|
433
466
|
|
467
|
+
Log.wtf("shouldInterceptRequestUrl:", url);
|
468
|
+
|
434
469
|
|
435
470
|
|
436
471
|
//support redirect from /scan
|
437
|
-
|
438
|
-
|
439
|
-
|
472
|
+
// for (String r: shouldRedirectList) {
|
473
|
+
// if (url.indexOf(r) > 0) {
|
474
|
+
// return null;
|
475
|
+
// }
|
476
|
+
// }
|
477
|
+
|
478
|
+
// call super.shouldInterceptRequest(view, request); at: disableServiceWorker method
|
479
|
+
return null;
|
480
|
+
|
481
|
+
// if(url.indexOf("/scan?") > 0 || url.indexOf("/qr?") > 0 || url.indexOf("//scan") > 0){
|
482
|
+
// return null;
|
483
|
+
// }
|
440
484
|
|
441
|
-
return super.shouldInterceptRequest(view, request);
|
485
|
+
// return super.shouldInterceptRequest(view, request);
|
442
486
|
|
443
|
-
//super.shouldInterceptRequest(view, request);
|
444
|
-
//return null;
|
445
487
|
}
|
446
488
|
|
447
489
|
|
@@ -33,6 +33,7 @@ public class CorePlugin extends Plugin {
|
|
33
33
|
public static boolean DEBUG = false;
|
34
34
|
|
35
35
|
private static Map member;
|
36
|
+
private static Map deeplink;
|
36
37
|
private static boolean ENVIRONMENT_PRODUCTION = true;
|
37
38
|
private void debug(Object msg) {
|
38
39
|
|
@@ -46,6 +47,10 @@ public class CorePlugin extends Plugin {
|
|
46
47
|
CorePlugin.member = member;
|
47
48
|
}
|
48
49
|
|
50
|
+
public static void setDeeplink(Map deeplink) {
|
51
|
+
CorePlugin.deeplink = deeplink;
|
52
|
+
}
|
53
|
+
|
49
54
|
public static void setENVIRONMENT_PRODUCTION(boolean ENVIRONMENT_PRODUCTION) {
|
50
55
|
CorePlugin.ENVIRONMENT_PRODUCTION = ENVIRONMENT_PRODUCTION;
|
51
56
|
}
|
@@ -76,6 +81,16 @@ public class CorePlugin extends Plugin {
|
|
76
81
|
call.resolve(ret);
|
77
82
|
}
|
78
83
|
|
84
|
+
@PluginMethod()
|
85
|
+
public void getDeeplink(PluginCall call) {
|
86
|
+
|
87
|
+
debug("CorePlugin getDeeplink:" + deeplink);
|
88
|
+
|
89
|
+
JSObject ret = new JSObject();
|
90
|
+
ret.put("deeplink", deeplink);
|
91
|
+
call.resolve(ret);
|
92
|
+
}
|
93
|
+
|
79
94
|
@PluginMethod()
|
80
95
|
public void getIsProductionEnvironment(PluginCall call) {
|
81
96
|
|
@@ -114,10 +129,12 @@ public class CorePlugin extends Plugin {
|
|
114
129
|
|
115
130
|
JSObject options = call.getObject("options", null);
|
116
131
|
JSObject member = call.getObject("member", null);
|
132
|
+
JSObject deeplink = call.getObject("deeplink", null);
|
117
133
|
boolean ENVIRONMENT_PRODUCTION = call.getBoolean("ENVIRONMENT_PRODUCTION", true);
|
118
134
|
CorePlugin.setENVIRONMENT_PRODUCTION(ENVIRONMENT_PRODUCTION);
|
119
135
|
|
120
136
|
Map memMap = new HashMap();
|
137
|
+
Map deeplinkMap = new HashMap();
|
121
138
|
|
122
139
|
if (member != null) {
|
123
140
|
Iterator<String> iter = member.keys();
|
@@ -132,6 +149,18 @@ public class CorePlugin extends Plugin {
|
|
132
149
|
|
133
150
|
}
|
134
151
|
}
|
152
|
+
if (deeplinkMap != null) {
|
153
|
+
Iterator<String> iter = deeplink.keys();
|
154
|
+
while (iter.hasNext()) {
|
155
|
+
String k = iter.next();
|
156
|
+
try {
|
157
|
+
Object v = deeplink.get(k);
|
158
|
+
deeplinkMap.put(k, v);
|
159
|
+
} catch (JSONException e) {
|
160
|
+
e.printStackTrace();
|
161
|
+
}
|
162
|
+
}
|
163
|
+
}
|
135
164
|
|
136
165
|
Activity act = getActivity();
|
137
166
|
|
@@ -149,6 +178,7 @@ public class CorePlugin extends Plugin {
|
|
149
178
|
|
150
179
|
intent.putExtra("url", url);
|
151
180
|
intent.putExtra("member", (Serializable) memMap);
|
181
|
+
intent.putExtra("deeplink", (Serializable) deeplinkMap);
|
152
182
|
intent.putExtra("ENVIRONMENT_PRODUCTION", ENVIRONMENT_PRODUCTION);
|
153
183
|
|
154
184
|
|
package/dist/docs.json
CHANGED
@@ -69,6 +69,22 @@
|
|
69
69
|
"complexTypes": [],
|
70
70
|
"slug": "getmember"
|
71
71
|
},
|
72
|
+
{
|
73
|
+
"name": "getDeeplink",
|
74
|
+
"signature": "(options: any) => Promise<any>",
|
75
|
+
"parameters": [
|
76
|
+
{
|
77
|
+
"name": "options",
|
78
|
+
"docs": "",
|
79
|
+
"type": "any"
|
80
|
+
}
|
81
|
+
],
|
82
|
+
"returns": "Promise<any>",
|
83
|
+
"tags": [],
|
84
|
+
"docs": "",
|
85
|
+
"complexTypes": [],
|
86
|
+
"slug": "getdeeplink"
|
87
|
+
},
|
72
88
|
{
|
73
89
|
"name": "openBrowser",
|
74
90
|
"signature": "(options: any) => Promise<any>",
|
@@ -3,6 +3,7 @@ export interface CorePlugin {
|
|
3
3
|
dismiss(options: any): Promise<any>;
|
4
4
|
finish(options: any): Promise<any>;
|
5
5
|
getMember(options: any): Promise<any>;
|
6
|
+
getDeeplink(options: any): Promise<any>;
|
6
7
|
openBrowser(options: any): Promise<any>;
|
7
8
|
isInstalledApp(options: {
|
8
9
|
key: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface CorePlugin {\n echo(options: any): Promise<any>;\n dismiss(options: any): Promise<any>;\n finish(options: any): Promise<any>;\n getMember(options: any): Promise<any>;\n openBrowser(options: any): Promise<any>;\n isInstalledApp(options: { key: string }): Promise<{ install: boolean }>;\n getIsProductionEnvironment(): Promise<{ isPrd: boolean }>;\n openExternalUrl(options: { url: string }): Promise<any>;\n\n}\n"]}
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface CorePlugin {\n echo(options: any): Promise<any>;\n dismiss(options: any): Promise<any>;\n finish(options: any): Promise<any>;\n getMember(options: any): Promise<any>;\n getDeeplink(options: any): Promise<any>;\n openBrowser(options: any): Promise<any>;\n isInstalledApp(options: { key: string }): Promise<{ install: boolean }>;\n getIsProductionEnvironment(): Promise<{ isPrd: boolean }>;\n openExternalUrl(options: { url: string }): Promise<any>;\n\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
@@ -3,6 +3,7 @@ import type { CorePlugin } from './definitions';
|
|
3
3
|
export declare class CoreWeb extends WebPlugin implements CorePlugin {
|
4
4
|
echo(options: any): Promise<any>;
|
5
5
|
getMember(options: any): Promise<any>;
|
6
|
+
getDeeplink(options: any): Promise<any>;
|
6
7
|
dismiss(options: any): Promise<any>;
|
7
8
|
finish(options: any): Promise<any>;
|
8
9
|
openBrowser(options: any): Promise<any>;
|
package/dist/esm/web.js
CHANGED
@@ -12,6 +12,14 @@ export class CoreWeb extends WebPlugin {
|
|
12
12
|
result.member = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.member;
|
13
13
|
return result;
|
14
14
|
}
|
15
|
+
async getDeeplink(options) {
|
16
|
+
var _a, _b;
|
17
|
+
console.log('GET Deeplink', options);
|
18
|
+
var result = {};
|
19
|
+
var w = window;
|
20
|
+
result.deeplink = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.deeplink;
|
21
|
+
return result;
|
22
|
+
}
|
15
23
|
async dismiss(options) {
|
16
24
|
console.log('DISMISS', options);
|
17
25
|
return options;
|
package/dist/esm/web.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CA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AE,KAAK,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;CAGJ","sourcesContent":["import { WebPlugin } from '@capacitor/core';\nimport type { CorePlugin } from './definitions';\n\n\nexport class CoreWeb extends WebPlugin implements CorePlugin {\n async echo(options: any): Promise<any> {\n console.log('ECHO', options);\n return options;\n }\n\n async getMember(options: any): Promise<any> {\n console.log('GET MEMBER', options);\n var result = {} as any;\n var w = window as any;\n result.member = w.aigens?.context?.member;\n return result;\n }\n\n async dismiss(options: any): Promise<any> {\n console.log('DISMISS', options);\n return options;\n }\n\n async finish(options: any): Promise<any> {\n console.log('FINISH', options);\n return options;\n }\n\n async openBrowser(options: any): Promise<any> {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n\n async isInstalledApp(options: { key: string }): Promise<{ install: boolean }> {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n\n async openExternalUrl(options: { url: string }): Promise<any> {\n window.open(options.url, \"_blank\");\n return {\n open: true\n }\n }\n\n async getIsProductionEnvironment(): Promise<{ isPrd: boolean }> {\n return { isPrd: true };\n }\n\n\n}\n"]}
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,OAAQ,SAAQ,SAAS;IAClC,KAAK,CAAC,IAAI,CAAC,OAAY;QACnB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,OAAY;;QACxB,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACnC,IAAI,MAAM,GAAG,EAAS,CAAC;QACvB,IAAI,CAAC,GAAG,MAAa,CAAC;QACtB,MAAM,CAAC,MAAM,eAAG,CAAC,CAAC,MAAM,0CAAE,OAAO,0CAAE,MAAM,CAAC;QAC1C,OAAO,MAAM,CAAC;IAClB,CAAC;IACD,KAAK,CAAC,WAAW,CAAC,OAAY;;QAC1B,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QACrC,IAAI,MAAM,GAAG,EAAS,CAAC;QACvB,IAAI,CAAC,GAAG,MAAa,CAAC;QACtB,MAAM,CAAC,QAAQ,eAAG,CAAC,CAAC,MAAM,0CAAE,OAAO,0CAAE,QAAQ,CAAC;QAC9C,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAY;QACtB,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAChC,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAY;QACrB,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC/B,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAAY;QAC1B,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,OAAwB;QACzC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,OAAwB;QAC1C,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACnC,OAAO;YACH,IAAI,EAAE,IAAI;SACb,CAAA;IACL,CAAC;IAED,KAAK,CAAC,0BAA0B;QAC5B,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;CAGJ","sourcesContent":["import { WebPlugin } from '@capacitor/core';\nimport type { CorePlugin } from './definitions';\n\n\nexport class CoreWeb extends WebPlugin implements CorePlugin {\n async echo(options: any): Promise<any> {\n console.log('ECHO', options);\n return options;\n }\n\n async getMember(options: any): Promise<any> {\n console.log('GET MEMBER', options);\n var result = {} as any;\n var w = window as any;\n result.member = w.aigens?.context?.member;\n return result;\n }\n async getDeeplink(options: any): Promise<any> {\n console.log('GET Deeplink', options);\n var result = {} as any;\n var w = window as any;\n result.deeplink = w.aigens?.context?.deeplink;\n return result;\n }\n\n async dismiss(options: any): Promise<any> {\n console.log('DISMISS', options);\n return options;\n }\n\n async finish(options: any): Promise<any> {\n console.log('FINISH', options);\n return options;\n }\n\n async openBrowser(options: any): Promise<any> {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n\n async isInstalledApp(options: { key: string }): Promise<{ install: boolean }> {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n\n async openExternalUrl(options: { url: string }): Promise<any> {\n window.open(options.url, \"_blank\");\n return {\n open: true\n }\n }\n\n async getIsProductionEnvironment(): Promise<{ isPrd: boolean }> {\n return { isPrd: true };\n }\n\n\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
@@ -21,6 +21,14 @@ class CoreWeb extends core.WebPlugin {
|
|
21
21
|
result.member = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.member;
|
22
22
|
return result;
|
23
23
|
}
|
24
|
+
async getDeeplink(options) {
|
25
|
+
var _a, _b;
|
26
|
+
console.log('GET Deeplink', options);
|
27
|
+
var result = {};
|
28
|
+
var w = window;
|
29
|
+
result.deeplink = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.deeplink;
|
30
|
+
return result;
|
31
|
+
}
|
24
32
|
async dismiss(options) {
|
25
33
|
console.log('DISMISS', options);
|
26
34
|
return options;
|
package/dist/plugin.cjs.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Core = registerPlugin('Core', {\n web: () => import('./web').then(m => new m.CoreWeb()),\n});\nexport * from './definitions';\nexport { Core };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CoreWeb extends WebPlugin {\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async getMember(options) {\n var _a, _b;\n console.log('GET MEMBER', options);\n var result = {};\n var w = window;\n result.member = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.member;\n return result;\n }\n async dismiss(options) {\n console.log('DISMISS', options);\n return options;\n }\n async finish(options) {\n console.log('FINISH', options);\n return options;\n }\n async openBrowser(options) {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n async isInstalledApp(options) {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n async openExternalUrl(options) {\n window.open(options.url, \"_blank\");\n return {\n open: true\n };\n }\n async getIsProductionEnvironment() {\n return { isPrd: true };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;;;AACK,MAAC,IAAI,GAAGA,mBAAc,CAAC,MAAM,EAAE;AACpC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;AACzD,CAAC;;ACFM,MAAM,OAAO,SAASC,cAAS,CAAC;AACvC,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE;AAC7B,QAAQ,IAAI,EAAE,EAAE,EAAE,CAAC;AACnB,QAAQ,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AAC3C,QAAQ,IAAI,MAAM,GAAG,EAAE,CAAC;AACxB,QAAQ,IAAI,CAAC,G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EAAE,IAAI,EAAE,CAAC;AAC/B,KAAK;AACL;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Core = registerPlugin('Core', {\n web: () => import('./web').then(m => new m.CoreWeb()),\n});\nexport * from './definitions';\nexport { Core };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CoreWeb extends WebPlugin {\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async getMember(options) {\n var _a, _b;\n console.log('GET MEMBER', options);\n var result = {};\n var w = window;\n result.member = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.member;\n return result;\n }\n async getDeeplink(options) {\n var _a, _b;\n console.log('GET Deeplink', options);\n var result = {};\n var w = window;\n result.deeplink = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.deeplink;\n return result;\n }\n async dismiss(options) {\n console.log('DISMISS', options);\n return options;\n }\n async finish(options) {\n console.log('FINISH', options);\n return options;\n }\n async openBrowser(options) {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n async isInstalledApp(options) {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n async openExternalUrl(options) {\n window.open(options.url, \"_blank\");\n return {\n open: true\n };\n }\n async getIsProductionEnvironment() {\n return { isPrd: true };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;;;AACK,MAAC,IAAI,GAAGA,mBAAc,CAAC,MAAM,EAAE;AACpC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;AACzD,CAAC;;ACFM,MAAM,OAAO,SAASC,cAAS,CAAC;AACvC,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GA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3B,QAAQ,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACxC,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL,IAAI,MAAM,MAAM,CAAC,OAAO,EAAE;AAC1B,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACvC,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;AAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAC7B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;AACnD,KAAK;AACL,IAAI,MAAM,cAAc,CAAC,OAAO,EAAE;AAClC,QAAQ,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAC7B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;AACnD,KAAK;AACL,IAAI,MAAM,eAAe,CAAC,OAAO,EAAE;AACnC,QAAQ,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AAC3C,QAAQ,OAAO;AACf,YAAY,IAAI,EAAE,IAAI;AACtB,SAAS,CAAC;AACV,KAAK;AACL,IAAI,MAAM,0BAA0B,GAAG;AACvC,QAAQ,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC/B,KAAK;AACL;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
@@ -18,6 +18,14 @@ var capacitorCore = (function (exports, core) {
|
|
18
18
|
result.member = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.member;
|
19
19
|
return result;
|
20
20
|
}
|
21
|
+
async getDeeplink(options) {
|
22
|
+
var _a, _b;
|
23
|
+
console.log('GET Deeplink', options);
|
24
|
+
var result = {};
|
25
|
+
var w = window;
|
26
|
+
result.deeplink = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.deeplink;
|
27
|
+
return result;
|
28
|
+
}
|
21
29
|
async dismiss(options) {
|
22
30
|
console.log('DISMISS', options);
|
23
31
|
return options;
|
package/dist/plugin.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Core = registerPlugin('Core', {\n web: () => import('./web').then(m => new m.CoreWeb()),\n});\nexport * from './definitions';\nexport { Core };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CoreWeb extends WebPlugin {\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async getMember(options) {\n var _a, _b;\n console.log('GET MEMBER', options);\n var result = {};\n var w = window;\n result.member = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.member;\n return result;\n }\n async dismiss(options) {\n console.log('DISMISS', options);\n return options;\n }\n async finish(options) {\n console.log('FINISH', options);\n return options;\n }\n async openBrowser(options) {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n async isInstalledApp(options) {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n async openExternalUrl(options) {\n window.open(options.url, \"_blank\");\n return {\n open: true\n };\n }\n async getIsProductionEnvironment() {\n return { isPrd: true };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,IAAI,GAAGA,mBAAc,CAAC,MAAM,EAAE;IACpC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;IACzD,CAAC;;ICFM,MAAM,OAAO,SAASC,cAAS,CAAC;IACvC,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAA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;IACnD,KAAK;IACL,IAAI,MAAM,eAAe,CAAC,OAAO,EAAE;IACnC,QAAQ,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC3C,QAAQ,OAAO;IACf,YAAY,IAAI,EAAE,IAAI;IACtB,SAAS,CAAC;IACV,KAAK;IACL,IAAI,MAAM,0BAA0B,GAAG;IACvC,QAAQ,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAC/B,KAAK;IACL;;;;;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Core = registerPlugin('Core', {\n web: () => import('./web').then(m => new m.CoreWeb()),\n});\nexport * from './definitions';\nexport { Core };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CoreWeb extends WebPlugin {\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async getMember(options) {\n var _a, _b;\n console.log('GET MEMBER', options);\n var result = {};\n var w = window;\n result.member = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.member;\n return result;\n }\n async getDeeplink(options) {\n var _a, _b;\n console.log('GET Deeplink', options);\n var result = {};\n var w = window;\n result.deeplink = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.deeplink;\n return result;\n }\n async dismiss(options) {\n console.log('DISMISS', options);\n return options;\n }\n async finish(options) {\n console.log('FINISH', options);\n return options;\n }\n async openBrowser(options) {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n async isInstalledApp(options) {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n async openExternalUrl(options) {\n window.open(options.url, \"_blank\");\n return {\n open: true\n };\n }\n async getIsProductionEnvironment() {\n return { isPrd: true };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings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ED
@@ -8,6 +8,7 @@ CAP_PLUGIN(CorePlugin, "Core",
|
|
8
8
|
CAP_PLUGIN_METHOD(dismiss, CAPPluginReturnPromise);
|
9
9
|
CAP_PLUGIN_METHOD(finish, CAPPluginReturnPromise);
|
10
10
|
CAP_PLUGIN_METHOD(openBrowser, CAPPluginReturnPromise);
|
11
|
+
CAP_PLUGIN_METHOD(getDeeplink, CAPPluginReturnPromise);
|
11
12
|
CAP_PLUGIN_METHOD(getMember, CAPPluginReturnPromise);
|
12
13
|
CAP_PLUGIN_METHOD(isInstalledApp, CAPPluginReturnPromise);
|
13
14
|
CAP_PLUGIN_METHOD(openExternalUrl, CAPPluginReturnPromise);
|
@@ -11,6 +11,7 @@ public class CorePlugin: CAPPlugin {
|
|
11
11
|
|
12
12
|
private let implementation = Core()
|
13
13
|
public static var member: Dictionary<String, Any>?
|
14
|
+
public static var deeplink: Dictionary<String, Any>?
|
14
15
|
|
15
16
|
@objc func echo(_ call: CAPPluginCall) {
|
16
17
|
|
@@ -45,7 +46,13 @@ public class CorePlugin: CAPPlugin {
|
|
45
46
|
@objc func getMember(_ call: CAPPluginCall) {
|
46
47
|
|
47
48
|
call.resolve([
|
48
|
-
"member": CorePlugin.member
|
49
|
+
"member": CorePlugin.member ?? nil
|
50
|
+
])
|
51
|
+
}
|
52
|
+
@objc func getDeeplink(_ call: CAPPluginCall) {
|
53
|
+
|
54
|
+
call.resolve([
|
55
|
+
"deeplink": CorePlugin.deeplink ?? nil
|
49
56
|
])
|
50
57
|
}
|
51
58
|
|
@@ -78,6 +85,7 @@ public class CorePlugin: CAPPlugin {
|
|
78
85
|
}
|
79
86
|
|
80
87
|
let member = call.getObject("member")
|
88
|
+
let deeplink = call.getObject("deeplink")
|
81
89
|
let externalProtocols = call.getArray("externalProtocols")
|
82
90
|
|
83
91
|
DispatchQueue.main.async {
|
@@ -90,6 +98,9 @@ public class CorePlugin: CAPPlugin {
|
|
90
98
|
if(member != nil){
|
91
99
|
options["member"] = member as AnyObject;
|
92
100
|
}
|
101
|
+
if(deeplink != nil){
|
102
|
+
options["deeplink"] = deeplink as AnyObject;
|
103
|
+
}
|
93
104
|
if (externalProtocols != nil) {
|
94
105
|
options["externalProtocols"] = externalProtocols as AnyObject
|
95
106
|
}
|
@@ -13,9 +13,9 @@ import Capacitor
|
|
13
13
|
|
14
14
|
// {themeColor: "#xxxxxx"}
|
15
15
|
public var options: Dictionary<String, Any>?
|
16
|
-
|
16
|
+
|
17
17
|
var externalProtocols: [String] = [
|
18
|
-
"octopus://", "alipay://", "alipays://", "alipayhk://", "https://itunes.apple.com", "tel:", "mailto:", "itms-apps://itunes.apple.com", "https://apps.apple.com", "payme://"
|
18
|
+
"octopus://", "alipay://", "alipays://", "alipayhk://", "https://itunes.apple.com", "tel:", "mailto:", "itms-apps://itunes.apple.com", "https://apps.apple.com", "payme://", "weixin://", "hsbcpaymepay://"
|
19
19
|
]
|
20
20
|
let containerView = WebContainer.webContainer()
|
21
21
|
var webContainerView: WebContainer {
|
@@ -28,22 +28,22 @@ import Capacitor
|
|
28
28
|
self.becomeFirstResponder()
|
29
29
|
loadWebViewCustom()
|
30
30
|
initView()
|
31
|
-
|
31
|
+
|
32
32
|
}
|
33
|
-
|
33
|
+
|
34
34
|
private func initView(){
|
35
|
-
|
35
|
+
|
36
36
|
print("VC initView")
|
37
|
-
|
37
|
+
|
38
38
|
//let bundle = Bundle(for: WebContainerViewController.self)
|
39
39
|
//let containerView = WebContainerView()
|
40
40
|
//let containerView = bundle.loadNibNamed("WebContainerView", owner: self, options: nil)?.first as! UIView
|
41
|
-
|
41
|
+
|
42
42
|
self.view.addSubview(webContainerView)
|
43
43
|
webContainerView.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height)
|
44
44
|
setupOptions(webContainerView)
|
45
45
|
containerView.vc = self
|
46
|
-
|
46
|
+
|
47
47
|
//
|
48
48
|
//
|
49
49
|
|
@@ -61,14 +61,14 @@ import Capacitor
|
|
61
61
|
// containerView.webArea.addSubview(self.webView!)
|
62
62
|
//
|
63
63
|
|
64
|
-
|
64
|
+
|
65
65
|
}
|
66
|
-
|
66
|
+
|
67
67
|
open override func viewWillLayoutSubviews() {
|
68
68
|
super.viewWillLayoutSubviews()
|
69
69
|
webContainerView.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height)
|
70
70
|
}
|
71
|
-
|
71
|
+
|
72
72
|
private func setupOptions(_ view: WebContainer) {
|
73
73
|
if let theme = self.options?["themeColor"] as? String, let color = UIColor.getHex(hex: theme) {
|
74
74
|
self.view.backgroundColor = color
|
@@ -79,9 +79,9 @@ import Capacitor
|
|
79
79
|
if let externalProtocols = options?["externalProtocols"] as? [String] {
|
80
80
|
self.externalProtocols.append(contentsOf: externalProtocols)
|
81
81
|
}
|
82
|
-
|
82
|
+
|
83
83
|
}
|
84
|
-
|
84
|
+
|
85
85
|
public final func loadWebViewCustom() {
|
86
86
|
|
87
87
|
//let bridge = self.bridge
|
@@ -95,11 +95,13 @@ import Capacitor
|
|
95
95
|
}
|
96
96
|
|
97
97
|
let url = URL(string: urlString!)
|
98
|
-
|
98
|
+
|
99
99
|
let member = self.options?["member"] as? Dictionary<String, Any>
|
100
|
-
|
100
|
+
|
101
101
|
CorePlugin.member = member
|
102
|
-
|
102
|
+
let deeplink = self.options?["deeplink"] as? Dictionary<String, Any>
|
103
|
+
CorePlugin.deeplink = deeplink
|
104
|
+
|
103
105
|
//bridge.webViewDelegationHandler.willLoadWebview(webView)
|
104
106
|
_ = webView?.load(URLRequest(url: url!))
|
105
107
|
webView?.navigationDelegate = self
|
@@ -132,12 +134,12 @@ import Capacitor
|
|
132
134
|
|
133
135
|
return descriptor
|
134
136
|
}
|
135
|
-
|
137
|
+
|
136
138
|
deinit {
|
137
139
|
print("WebContainerViewController deinit")
|
138
140
|
}
|
139
141
|
|
140
|
-
|
142
|
+
|
141
143
|
}
|
142
144
|
|
143
145
|
extension WebContainerViewController: WKNavigationDelegate {
|
@@ -147,12 +149,12 @@ extension WebContainerViewController: WKNavigationDelegate {
|
|
147
149
|
// Reset the bridge on each navigation
|
148
150
|
// self.bridge?.reset()
|
149
151
|
}
|
150
|
-
|
152
|
+
|
151
153
|
public func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) {
|
152
154
|
webContainerView.showError(false)
|
153
155
|
webContainerView.showLoading(true)
|
154
156
|
}
|
155
|
-
|
157
|
+
|
156
158
|
public func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
|
157
159
|
// post a notification for any listeners
|
158
160
|
NotificationCenter.default.post(name: .capacitorDecidePolicyForNavigationAction, object: navigationAction)
|
@@ -162,7 +164,7 @@ extension WebContainerViewController: WKNavigationDelegate {
|
|
162
164
|
decisionHandler(.allow)
|
163
165
|
return
|
164
166
|
}
|
165
|
-
|
167
|
+
|
166
168
|
var isCanOpen = false
|
167
169
|
if externalProtocols.count > 0 {
|
168
170
|
externalProtocols.forEach { (url) in
|
@@ -172,7 +174,7 @@ extension WebContainerViewController: WKNavigationDelegate {
|
|
172
174
|
}
|
173
175
|
}
|
174
176
|
}
|
175
|
-
|
177
|
+
|
176
178
|
if isCanOpen {
|
177
179
|
if #available(iOS 10.0, *) {
|
178
180
|
UIApplication.shared.open(navURL, options: [:], completionHandler: nil);
|
@@ -182,7 +184,7 @@ extension WebContainerViewController: WKNavigationDelegate {
|
|
182
184
|
decisionHandler(.cancel)
|
183
185
|
return;
|
184
186
|
}
|
185
|
-
|
187
|
+
|
186
188
|
|
187
189
|
// first, give plugins the chance to handle the decision
|
188
190
|
// for pluginObject in bridge.plugins {
|
@@ -222,8 +224,8 @@ extension WebContainerViewController: WKNavigationDelegate {
|
|
222
224
|
// fallthrough to allowing it
|
223
225
|
decisionHandler(.allow)
|
224
226
|
}
|
225
|
-
|
226
|
-
|
227
|
+
|
228
|
+
|
227
229
|
// The force unwrap is part of the protocol declaration, so we should keep it.
|
228
230
|
// swiftlint:disable:next implicitly_unwrapped_optional
|
229
231
|
public func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
|
@@ -235,7 +237,7 @@ extension WebContainerViewController: WKNavigationDelegate {
|
|
235
237
|
webContainerView.showError(false)
|
236
238
|
CAPLog.print("⚡️ WebView loaded")
|
237
239
|
}
|
238
|
-
|
240
|
+
|
239
241
|
// The force unwrap is part of the protocol declaration, so we should keep it.
|
240
242
|
// swiftlint:disable:next implicitly_unwrapped_optional
|
241
243
|
public func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) {
|
@@ -244,12 +246,12 @@ extension WebContainerViewController: WKNavigationDelegate {
|
|
244
246
|
// webViewLoadingState = .subsequentLoad
|
245
247
|
// }
|
246
248
|
webContainerView.showLoading(false)
|
247
|
-
|
249
|
+
|
248
250
|
webContainerView.showError(true, error.localizedDescription)
|
249
251
|
CAPLog.print("⚡️ WebView failed to load")
|
250
252
|
CAPLog.print("⚡️ Error: " + error.localizedDescription)
|
251
253
|
}
|
252
|
-
|
254
|
+
|
253
255
|
// The force unwrap is part of the protocol declaration, so we should keep it.
|
254
256
|
// swiftlint:disable:next implicitly_unwrapped_optional
|
255
257
|
public func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) {
|
@@ -263,7 +265,7 @@ extension WebContainerViewController: WKNavigationDelegate {
|
|
263
265
|
CAPLog.print("⚡️ Error: " + error.localizedDescription)
|
264
266
|
webContainerView.showError(true, error.localizedDescription)
|
265
267
|
}
|
266
|
-
|
268
|
+
|
267
269
|
public func webViewWebContentProcessDidTerminate(_ webView: WKWebView) {
|
268
270
|
webView.reload()
|
269
271
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@aigens/aigens-sdk-core",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.12",
|
4
4
|
"description": "Aigens Order.Place Core Plugin",
|
5
5
|
"main": "dist/plugin.cjs.js",
|
6
6
|
"module": "dist/esm/index.js",
|
@@ -74,8 +74,5 @@
|
|
74
74
|
"android": {
|
75
75
|
"src": "android"
|
76
76
|
}
|
77
|
-
},
|
78
|
-
"dependencies": {
|
79
|
-
"aigens-mono": "file:../.."
|
80
77
|
}
|
81
78
|
}
|