@aigens/aigens-sdk-core 0.0.8 → 0.0.11
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 +28 -0
- package/android/src/main/java/com/aigens/sdk/WebContainerActivity.java +36 -10
- package/android/src/main/java/com/aigens/sdk/plugins/CorePlugin.java +47 -1
- package/dist/docs.json +26 -0
- package/dist/esm/definitions.d.ts +4 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +4 -0
- package/dist/esm/web.js +11 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +11 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +11 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/CorePlugin.m +2 -0
- package/ios/Plugin/CorePlugin.swift +17 -1
- package/ios/Plugin/WebContainerViewController.swift +31 -29
- package/package.json +1 -4
package/README.md
CHANGED
@@ -17,8 +17,10 @@ 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)
|
23
|
+
* [`getIsProductionEnvironment()`](#getisproductionenvironment)
|
22
24
|
* [`openExternalUrl(...)`](#openexternalurl)
|
23
25
|
|
24
26
|
</docgen-index>
|
@@ -86,6 +88,21 @@ getMember(options: any) => Promise<any>
|
|
86
88
|
--------------------
|
87
89
|
|
88
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
|
+
|
89
106
|
### openBrowser(...)
|
90
107
|
|
91
108
|
```typescript
|
@@ -116,6 +133,17 @@ isInstalledApp(options: { key: string; }) => Promise<{ install: boolean; }>
|
|
116
133
|
--------------------
|
117
134
|
|
118
135
|
|
136
|
+
### getIsProductionEnvironment()
|
137
|
+
|
138
|
+
```typescript
|
139
|
+
getIsProductionEnvironment() => Promise<{ isPrd: boolean; }>
|
140
|
+
```
|
141
|
+
|
142
|
+
**Returns:** <code>Promise<{ isPrd: boolean; }></code>
|
143
|
+
|
144
|
+
--------------------
|
145
|
+
|
146
|
+
|
119
147
|
### openExternalUrl(...)
|
120
148
|
|
121
149
|
```typescript
|
@@ -46,6 +46,8 @@ 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;
|
50
|
+
private boolean ENVIRONMENT_PRODUCTION = true;
|
49
51
|
private List<String> externalProtocols = new ArrayList<String>(){{
|
50
52
|
add("octopus://");
|
51
53
|
add("alipay://");
|
@@ -54,6 +56,7 @@ public class WebContainerActivity extends BridgeActivity {
|
|
54
56
|
add("tel:");
|
55
57
|
add("mailto:");
|
56
58
|
add("payme://");
|
59
|
+
add("weixin://");
|
57
60
|
add("https://play.google.com");
|
58
61
|
}};
|
59
62
|
|
@@ -77,7 +80,7 @@ public class WebContainerActivity extends BridgeActivity {
|
|
77
80
|
|
78
81
|
setContentView(com.aigens.sdk.R.layout.sdk_layout_main);
|
79
82
|
|
80
|
-
|
83
|
+
|
81
84
|
|
82
85
|
Intent intent = getIntent();
|
83
86
|
this.url = intent.getStringExtra("url");
|
@@ -86,6 +89,9 @@ public class WebContainerActivity extends BridgeActivity {
|
|
86
89
|
this.navbar = intent.getBooleanExtra("navbar", false);
|
87
90
|
|
88
91
|
this.member = (Map) intent.getSerializableExtra("member");
|
92
|
+
this.deeplink = (Map) intent.getSerializableExtra("deeplink");
|
93
|
+
boolean ENVIRONMENT_PRODUCTION = intent.getBooleanExtra("ENVIRONMENT_PRODUCTION", true);
|
94
|
+
CorePlugin.setENVIRONMENT_PRODUCTION(ENVIRONMENT_PRODUCTION);
|
89
95
|
|
90
96
|
List<String> externalProtocols_ = (List<String>) intent.getSerializableExtra("externalProtocols");
|
91
97
|
if (externalProtocols_ != null) {
|
@@ -97,6 +103,9 @@ public class WebContainerActivity extends BridgeActivity {
|
|
97
103
|
if(this.member != null) {
|
98
104
|
CorePlugin.setMember(this.member);
|
99
105
|
}
|
106
|
+
if (this.deeplink != null) {
|
107
|
+
CorePlugin.setDeeplink(this.deeplink);
|
108
|
+
}
|
100
109
|
|
101
110
|
System.out.println("OPEN URL:"+ url);
|
102
111
|
|
@@ -107,6 +116,9 @@ public class WebContainerActivity extends BridgeActivity {
|
|
107
116
|
if(member != null){
|
108
117
|
debug("member", member);
|
109
118
|
}
|
119
|
+
if(member != null){
|
120
|
+
debug("deeplink", deeplink);
|
121
|
+
}
|
110
122
|
|
111
123
|
JSONObject config = readConfig();
|
112
124
|
|
@@ -145,12 +157,12 @@ public class WebContainerActivity extends BridgeActivity {
|
|
145
157
|
}
|
146
158
|
|
147
159
|
addExtraPlugins(new String[] {
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
160
|
+
"com.aigens.googlepay.GooglePayPlugin",
|
161
|
+
"com.aigens.octopus.OctopusPlugin",
|
162
|
+
"com.aigens.wechatpay.WechatPayPlugin",
|
163
|
+
"com.aigens.alipay.AliPayPlugin",
|
164
|
+
"com.aigens.alipayhk.AliPayhkPlugin",
|
165
|
+
"com.aigens.payme.PaymePlugin",
|
154
166
|
}, plugins);
|
155
167
|
addExtraPlugins(intent.getStringArrayExtra("extraClasspaths"), plugins);
|
156
168
|
|
@@ -164,9 +176,18 @@ public class WebContainerActivity extends BridgeActivity {
|
|
164
176
|
wvc.activity = this;
|
165
177
|
wvc.externalProtocols = this.externalProtocols;
|
166
178
|
this.bridge.getWebView().setWebViewClient(wvc);
|
179
|
+
this.bridge.getWebView().setWebContentsDebuggingEnabled(true);
|
180
|
+
|
181
|
+
// this.bridge.getWebView().getSettings().setAppCacheEnabled(false);
|
182
|
+
// this.bridge.getWebView().clearCache(true);
|
183
|
+
// this.bridge.getWebView().clearHistory();
|
184
|
+
// this.bridge.getWebView().clearFormData();
|
185
|
+
// this.bridge.getWebView().getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
|
167
186
|
|
168
187
|
initView();
|
169
188
|
initLayout(false, true, false);
|
189
|
+
|
190
|
+
disableServiceWorker(this.url, this.bridge);
|
170
191
|
}
|
171
192
|
|
172
193
|
private void addExtraPlugins(String[] extraClasspaths, List<Class<? extends Plugin>> plugins) {
|
@@ -179,7 +200,7 @@ public class WebContainerActivity extends BridgeActivity {
|
|
179
200
|
String clsName = sub.getName();
|
180
201
|
Boolean add = false;
|
181
202
|
for (Class<? extends Plugin> plugin : plugins) {
|
182
|
-
if (plugin.getName()
|
203
|
+
if (plugin.getName().equals(clsName)) {
|
183
204
|
add = true;
|
184
205
|
break;
|
185
206
|
}
|
@@ -280,7 +301,7 @@ public class WebContainerActivity extends BridgeActivity {
|
|
280
301
|
|
281
302
|
private static boolean SW_DISABLED = false;
|
282
303
|
|
283
|
-
private static void disableServiceWorker(){
|
304
|
+
private static void disableServiceWorker(String originUrl, Bridge bridge){
|
284
305
|
|
285
306
|
if(SW_DISABLED) return;
|
286
307
|
|
@@ -289,6 +310,11 @@ public class WebContainerActivity extends BridgeActivity {
|
|
289
310
|
@Override
|
290
311
|
public WebResourceResponse shouldInterceptRequest(WebResourceRequest request) {
|
291
312
|
|
313
|
+
// Fixed: Sometimes the plugin cannot be loaded
|
314
|
+
String currentUrl = request.getUrl().toString();
|
315
|
+
if (currentUrl.equals(originUrl)) {
|
316
|
+
return bridge.getLocalServer().shouldInterceptRequest(request);
|
317
|
+
}
|
292
318
|
return null;
|
293
319
|
}
|
294
320
|
});
|
@@ -376,7 +402,7 @@ public class WebContainerActivity extends BridgeActivity {
|
|
376
402
|
Log.e(TAG, "Error dialing " + url + ": " + e.toString());
|
377
403
|
}
|
378
404
|
} else if (url.startsWith("geo:") || url.startsWith(WebView.SCHEME_MAILTO) || url.startsWith("market:")
|
379
|
-
|
405
|
+
|| loopExternalProtocols(url)) {
|
380
406
|
try {
|
381
407
|
Intent intent = new Intent(Intent.ACTION_VIEW);
|
382
408
|
intent.setData(Uri.parse(url));
|
@@ -33,7 +33,8 @@ public class CorePlugin extends Plugin {
|
|
33
33
|
public static boolean DEBUG = false;
|
34
34
|
|
35
35
|
private static Map member;
|
36
|
-
|
36
|
+
private static Map deeplink;
|
37
|
+
private static boolean ENVIRONMENT_PRODUCTION = true;
|
37
38
|
private void debug(Object msg) {
|
38
39
|
|
39
40
|
if (DEBUG) {
|
@@ -46,6 +47,14 @@ 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
|
+
|
54
|
+
public static void setENVIRONMENT_PRODUCTION(boolean ENVIRONMENT_PRODUCTION) {
|
55
|
+
CorePlugin.ENVIRONMENT_PRODUCTION = ENVIRONMENT_PRODUCTION;
|
56
|
+
}
|
57
|
+
|
49
58
|
@Override
|
50
59
|
protected void handleOnStart() {
|
51
60
|
|
@@ -72,6 +81,25 @@ public class CorePlugin extends Plugin {
|
|
72
81
|
call.resolve(ret);
|
73
82
|
}
|
74
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
|
+
|
94
|
+
@PluginMethod()
|
95
|
+
public void getIsProductionEnvironment(PluginCall call) {
|
96
|
+
|
97
|
+
debug("CorePlugin getIsProductionEnvironment:" + ENVIRONMENT_PRODUCTION);
|
98
|
+
JSObject ret = new JSObject();
|
99
|
+
ret.put("isPrd", ENVIRONMENT_PRODUCTION);
|
100
|
+
call.resolve(ret);
|
101
|
+
}
|
102
|
+
|
75
103
|
|
76
104
|
// Launch
|
77
105
|
//public void onButtonClick(View view) {
|
@@ -101,8 +129,12 @@ public class CorePlugin extends Plugin {
|
|
101
129
|
|
102
130
|
JSObject options = call.getObject("options", null);
|
103
131
|
JSObject member = call.getObject("member", null);
|
132
|
+
JSObject deeplink = call.getObject("deeplink", null);
|
133
|
+
boolean ENVIRONMENT_PRODUCTION = call.getBoolean("ENVIRONMENT_PRODUCTION", true);
|
134
|
+
CorePlugin.setENVIRONMENT_PRODUCTION(ENVIRONMENT_PRODUCTION);
|
104
135
|
|
105
136
|
Map memMap = new HashMap();
|
137
|
+
Map deeplinkMap = new HashMap();
|
106
138
|
|
107
139
|
if (member != null) {
|
108
140
|
Iterator<String> iter = member.keys();
|
@@ -117,6 +149,18 @@ public class CorePlugin extends Plugin {
|
|
117
149
|
|
118
150
|
}
|
119
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
|
+
}
|
120
164
|
|
121
165
|
Activity act = getActivity();
|
122
166
|
|
@@ -134,6 +178,8 @@ public class CorePlugin extends Plugin {
|
|
134
178
|
|
135
179
|
intent.putExtra("url", url);
|
136
180
|
intent.putExtra("member", (Serializable) memMap);
|
181
|
+
intent.putExtra("deeplink", (Serializable) deeplinkMap);
|
182
|
+
intent.putExtra("ENVIRONMENT_PRODUCTION", ENVIRONMENT_PRODUCTION);
|
137
183
|
|
138
184
|
|
139
185
|
act.startActivity(intent);
|
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>",
|
@@ -101,6 +117,16 @@
|
|
101
117
|
"complexTypes": [],
|
102
118
|
"slug": "isinstalledapp"
|
103
119
|
},
|
120
|
+
{
|
121
|
+
"name": "getIsProductionEnvironment",
|
122
|
+
"signature": "() => Promise<{ isPrd: boolean; }>",
|
123
|
+
"parameters": [],
|
124
|
+
"returns": "Promise<{ isPrd: boolean; }>",
|
125
|
+
"tags": [],
|
126
|
+
"docs": "",
|
127
|
+
"complexTypes": [],
|
128
|
+
"slug": "getisproductionenvironment"
|
129
|
+
},
|
104
130
|
{
|
105
131
|
"name": "openExternalUrl",
|
106
132
|
"signature": "(options: { url: string; }) => Promise<any>",
|
@@ -3,12 +3,16 @@ 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;
|
9
10
|
}): Promise<{
|
10
11
|
install: boolean;
|
11
12
|
}>;
|
13
|
+
getIsProductionEnvironment(): Promise<{
|
14
|
+
isPrd: boolean;
|
15
|
+
}>;
|
12
16
|
openExternalUrl(options: {
|
13
17
|
url: string;
|
14
18
|
}): Promise<any>;
|
@@ -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 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>;
|
@@ -14,4 +15,7 @@ export declare class CoreWeb extends WebPlugin implements CorePlugin {
|
|
14
15
|
openExternalUrl(options: {
|
15
16
|
url: string;
|
16
17
|
}): Promise<any>;
|
18
|
+
getIsProductionEnvironment(): Promise<{
|
19
|
+
isPrd: boolean;
|
20
|
+
}>;
|
17
21
|
}
|
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;
|
@@ -34,5 +42,8 @@ export class CoreWeb extends WebPlugin {
|
|
34
42
|
open: true
|
35
43
|
};
|
36
44
|
}
|
45
|
+
async getIsProductionEnvironment() {
|
46
|
+
return { isPrd: true };
|
47
|
+
}
|
37
48
|
}
|
38
49
|
//# sourceMappingURL=web.js.map
|
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,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;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;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\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;
|
@@ -43,6 +51,9 @@ class CoreWeb extends core.WebPlugin {
|
|
43
51
|
open: true
|
44
52
|
};
|
45
53
|
}
|
54
|
+
async getIsProductionEnvironment() {
|
55
|
+
return { isPrd: true };
|
56
|
+
}
|
46
57
|
}
|
47
58
|
|
48
59
|
var web = /*#__PURE__*/Object.freeze({
|
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}\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,GAAG,MAAM,CAAC;AACvB,QAAQ,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,MAAM,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;AAC9I,QAAQ,OAAO,MAAM,CAAC;AACtB,KAAK;AACL,IAAI,MAAM,OAAO,CAAC,OAAO,EAAE;AAC3B,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;;;;;;;;;"}
|
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,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,GAAG,MAAM,CAAC;AACvB,QAAQ,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,MAAM,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,MAAM,IA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,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;
|
@@ -40,6 +48,9 @@ var capacitorCore = (function (exports, core) {
|
|
40
48
|
open: true
|
41
49
|
};
|
42
50
|
}
|
51
|
+
async getIsProductionEnvironment() {
|
52
|
+
return { isPrd: true };
|
53
|
+
}
|
43
54
|
}
|
44
55
|
|
45
56
|
var web = /*#__PURE__*/Object.freeze({
|
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}\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,CAAC,CAAC;IACrC,QAAQ,OAAO,OAAO,CAAC;IACvB,KAAK;IACL,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE;IAC7B,QAAQ,IAAI,EAAE,EAAE,EAAE,CAAC;IACnB,QAAQ,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC3C,QAAQ,IAAI,MAAM,GAAG,EAAE,CAAC;IACxB,QAAQ,IAAI,CAAC,GAAG,MAAM,CAAC;IACvB,QAAQ,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,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('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,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,CAAC,CAAC;IACrC,QAAQ,OAAO,OAAO,CAAC;IACvB,KAAK;IACL,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE;IAC7B,QAAQ,IAAI,EAAE,EAAE,EAAE,CA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AAO,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACvC,QAAQ,OAAO,OAAO,CAAC;IACvB,KAAK;IACL,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;IAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnD,KAAK;IACL,IAAI,MAAM,cAAc,CAAC,OAAO,EAAE;IAClC,QAAQ,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;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;;;;;;;;;;;;;;;;;"}
|
package/ios/Plugin/CorePlugin.m
CHANGED
@@ -8,7 +8,9 @@ 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);
|
15
|
+
CAP_PLUGIN_METHOD(getIsProductionEnvironment, CAPPluginReturnPromise);
|
14
16
|
)
|
@@ -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
|
}
|
@@ -119,6 +130,11 @@ public class CorePlugin: CAPPlugin {
|
|
119
130
|
return
|
120
131
|
}
|
121
132
|
}
|
133
|
+
@objc func getIsProductionEnvironment(_ call: CAPPluginCall) {
|
134
|
+
call.resolve([
|
135
|
+
"isPrd": true
|
136
|
+
])
|
137
|
+
}
|
122
138
|
|
123
139
|
@objc func openExternalUrl(_ call: CAPPluginCall) {
|
124
140
|
if let url = call.getString("url"), let URL_ = URL(string: url) {
|
@@ -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://"
|
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.11",
|
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
|
}
|