@aigens/aigens-sdk-core 0.0.3 → 0.0.7
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 +21 -5
- package/android/build.gradle +0 -3
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/aigens/sdk/WebContainerActivity.java +162 -14
- package/android/src/main/java/com/aigens/sdk/plugins/CorePlugin.java +56 -76
- package/android/src/main/res/layout/sdk_layout_main.xml +55 -0
- package/dist/docs.json +20 -4
- package/dist/esm/definitions.d.ts +2 -1
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +2 -1
- package/dist/esm/web.js +12 -4
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +12 -4
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +12 -4
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/CorePlugin.m +2 -1
- package/ios/Plugin/CorePlugin.swift +49 -633
- package/ios/Plugin/WebContainerViewController.swift +45 -14
- package/package.json +1 -1
package/README.md
CHANGED
@@ -14,9 +14,10 @@ npx cap sync
|
|
14
14
|
<docgen-index>
|
15
15
|
|
16
16
|
* [`echo(...)`](#echo)
|
17
|
+
* [`dismiss(...)`](#dismiss)
|
17
18
|
* [`finish(...)`](#finish)
|
19
|
+
* [`getMember(...)`](#getmember)
|
18
20
|
* [`openBrowser(...)`](#openbrowser)
|
19
|
-
* [`scan(...)`](#scan)
|
20
21
|
|
21
22
|
</docgen-index>
|
22
23
|
|
@@ -38,6 +39,21 @@ echo(options: any) => Promise<any>
|
|
38
39
|
--------------------
|
39
40
|
|
40
41
|
|
42
|
+
### dismiss(...)
|
43
|
+
|
44
|
+
```typescript
|
45
|
+
dismiss(options: any) => Promise<any>
|
46
|
+
```
|
47
|
+
|
48
|
+
| Param | Type |
|
49
|
+
| ------------- | ---------------- |
|
50
|
+
| **`options`** | <code>any</code> |
|
51
|
+
|
52
|
+
**Returns:** <code>Promise<any></code>
|
53
|
+
|
54
|
+
--------------------
|
55
|
+
|
56
|
+
|
41
57
|
### finish(...)
|
42
58
|
|
43
59
|
```typescript
|
@@ -53,10 +69,10 @@ finish(options: any) => Promise<any>
|
|
53
69
|
--------------------
|
54
70
|
|
55
71
|
|
56
|
-
###
|
72
|
+
### getMember(...)
|
57
73
|
|
58
74
|
```typescript
|
59
|
-
|
75
|
+
getMember(options: any) => Promise<any>
|
60
76
|
```
|
61
77
|
|
62
78
|
| Param | Type |
|
@@ -68,10 +84,10 @@ openBrowser(options: any) => Promise<any>
|
|
68
84
|
--------------------
|
69
85
|
|
70
86
|
|
71
|
-
###
|
87
|
+
### openBrowser(...)
|
72
88
|
|
73
89
|
```typescript
|
74
|
-
|
90
|
+
openBrowser(options: any) => Promise<any>
|
75
91
|
```
|
76
92
|
|
77
93
|
| Param | Type |
|
package/android/build.gradle
CHANGED
@@ -53,9 +53,6 @@ dependencies {
|
|
53
53
|
implementation project(':capacitor-android')
|
54
54
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
55
55
|
|
56
|
-
implementation('com.journeyapps:zxing-android-embedded:4.3.0') { transitive = false }
|
57
|
-
implementation 'com.google.zxing:core:3.3.0'
|
58
|
-
|
59
56
|
testImplementation "junit:junit:$junitVersion"
|
60
57
|
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
61
58
|
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
@@ -5,16 +5,23 @@ import android.content.res.AssetManager;
|
|
5
5
|
import android.graphics.Bitmap;
|
6
6
|
import android.net.Uri;
|
7
7
|
import android.os.Bundle;
|
8
|
+
import android.view.View;
|
9
|
+
import android.webkit.WebResourceError;
|
8
10
|
import android.webkit.WebResourceRequest;
|
9
11
|
import android.webkit.WebResourceResponse;
|
10
12
|
import android.webkit.WebView;
|
11
13
|
import android.webkit.WebViewClient;
|
14
|
+
import android.widget.Button;
|
12
15
|
|
16
|
+
import com.aigens.sdk.plugins.CorePlugin;
|
17
|
+
import com.getcapacitor.Bridge;
|
13
18
|
import com.getcapacitor.BridgeActivity;
|
19
|
+
import com.getcapacitor.BridgeWebViewClient;
|
14
20
|
import com.getcapacitor.CapConfig;
|
15
21
|
import com.getcapacitor.Plugin;
|
16
22
|
import com.getcapacitor.PluginLoadException;
|
17
23
|
import com.getcapacitor.PluginManager;
|
24
|
+
import com.aigens.sdk.R;
|
18
25
|
|
19
26
|
import org.json.JSONException;
|
20
27
|
import org.json.JSONObject;
|
@@ -25,9 +32,26 @@ import java.io.InputStream;
|
|
25
32
|
import java.io.InputStreamReader;
|
26
33
|
import java.util.ArrayList;
|
27
34
|
import java.util.List;
|
35
|
+
import java.util.Map;
|
28
36
|
|
29
37
|
public class WebContainerActivity extends BridgeActivity {
|
30
38
|
|
39
|
+
private boolean DEBUG = CorePlugin.DEBUG;
|
40
|
+
private String url;
|
41
|
+
private boolean navbar = false;
|
42
|
+
private Map member;
|
43
|
+
|
44
|
+
private void debug(Object... msgs){
|
45
|
+
|
46
|
+
|
47
|
+
if(DEBUG){
|
48
|
+
for(Object m: msgs){
|
49
|
+
System.out.println(m);
|
50
|
+
}
|
51
|
+
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
31
55
|
|
32
56
|
|
33
57
|
@Override
|
@@ -35,8 +59,19 @@ public class WebContainerActivity extends BridgeActivity {
|
|
35
59
|
|
36
60
|
super.onCreate(savedInstanceState);
|
37
61
|
|
62
|
+
setContentView(R.layout.sdk_layout_main);
|
63
|
+
|
38
64
|
Intent intent = getIntent();
|
39
|
-
|
65
|
+
this.url = intent.getStringExtra("url");
|
66
|
+
|
67
|
+
//if navbar = true, show nav bar with "Done" button
|
68
|
+
this.navbar = intent.getBooleanExtra("navbar", false);
|
69
|
+
|
70
|
+
this.member = (Map) intent.getSerializableExtra("member");
|
71
|
+
|
72
|
+
if(this.member != null) {
|
73
|
+
CorePlugin.setMember(this.member);
|
74
|
+
}
|
40
75
|
|
41
76
|
System.out.println("OPEN URL:"+ url);
|
42
77
|
|
@@ -44,8 +79,14 @@ public class WebContainerActivity extends BridgeActivity {
|
|
44
79
|
System.err.println("CONFIG ERROR MISSING NATIVE URL");
|
45
80
|
}
|
46
81
|
|
82
|
+
if(member != null){
|
83
|
+
debug("member", member);
|
84
|
+
}
|
85
|
+
|
47
86
|
JSONObject config = readConfig();
|
48
87
|
|
88
|
+
debug("config", config);
|
89
|
+
|
49
90
|
JSONObject server = config.optJSONObject("server");
|
50
91
|
|
51
92
|
try {
|
@@ -53,6 +94,9 @@ public class WebContainerActivity extends BridgeActivity {
|
|
53
94
|
server.putOpt("url", url);
|
54
95
|
}
|
55
96
|
|
97
|
+
//need to set this to avoid loading ServiceWorker
|
98
|
+
config.put("appendUserAgent", "AigensSDK");
|
99
|
+
|
56
100
|
} catch (JSONException e) {
|
57
101
|
e.printStackTrace();
|
58
102
|
}
|
@@ -66,7 +110,6 @@ public class WebContainerActivity extends BridgeActivity {
|
|
66
110
|
for(Class c: auto){
|
67
111
|
|
68
112
|
String clsName = c.getName();
|
69
|
-
//System.err.println("auto loaded plugins:" + clsName);
|
70
113
|
|
71
114
|
if(clsName.endsWith("SplashScreenPlugin")){
|
72
115
|
//don't add the splash screen plugin so it doesn't show the splash screen again
|
@@ -76,18 +119,73 @@ public class WebContainerActivity extends BridgeActivity {
|
|
76
119
|
|
77
120
|
}
|
78
121
|
|
79
|
-
|
80
|
-
|
81
|
-
//plugins.add(CorePlugin2.class);
|
82
|
-
//plugins.add(AppPlugin.class);
|
83
|
-
//plugins.add(GeolocationPlugin.class);
|
122
|
+
debug("App plugins:" + plugins);
|
84
123
|
|
85
124
|
super.init(savedInstanceState, plugins, cc);
|
86
125
|
|
87
126
|
//still have time to override webview client to avoid any intercept
|
88
|
-
|
127
|
+
|
128
|
+
BypassWebViewClient wvc = new BypassWebViewClient(this.bridge);
|
89
129
|
this.bridge.getWebView().setWebViewClient(wvc);
|
90
130
|
|
131
|
+
initView();
|
132
|
+
initLayout(false, true, false);
|
133
|
+
}
|
134
|
+
|
135
|
+
private void initView(){
|
136
|
+
|
137
|
+
Button backButton = (Button) findViewById(R.id.back);
|
138
|
+
backButton.setOnClickListener(new View.OnClickListener() {
|
139
|
+
@Override
|
140
|
+
public void onClick(View arg0) {
|
141
|
+
|
142
|
+
debug("Back Clicked");
|
143
|
+
WebContainerActivity.this.finish();
|
144
|
+
}
|
145
|
+
});
|
146
|
+
|
147
|
+
Button reloadButton = (Button) findViewById(R.id.reload);
|
148
|
+
reloadButton.setOnClickListener(new View.OnClickListener() {
|
149
|
+
@Override
|
150
|
+
public void onClick(View arg0) {
|
151
|
+
|
152
|
+
debug("Reload Clicked");
|
153
|
+
reload();
|
154
|
+
}
|
155
|
+
});
|
156
|
+
|
157
|
+
}
|
158
|
+
|
159
|
+
private void reload(){
|
160
|
+
|
161
|
+
String url = this.url;
|
162
|
+
|
163
|
+
/*
|
164
|
+
if(DEBUG){
|
165
|
+
url = "https://test.order.place/test/app/store/500?nocache=true";
|
166
|
+
}*/
|
167
|
+
|
168
|
+
this.initLayout(false, true, false);
|
169
|
+
this.bridge.getWebView().reload();
|
170
|
+
|
171
|
+
}
|
172
|
+
|
173
|
+
private void initLayout(boolean showWeb, boolean showInfo, boolean showError){
|
174
|
+
|
175
|
+
if(showError){
|
176
|
+
showWeb = false;
|
177
|
+
showInfo = false;
|
178
|
+
}
|
179
|
+
|
180
|
+
View info = findViewById(R.id.info);
|
181
|
+
info.setVisibility(showInfo ? View.VISIBLE : View.INVISIBLE);
|
182
|
+
|
183
|
+
View error = findViewById(R.id.error);
|
184
|
+
error.setVisibility(showError ? View.VISIBLE : View.INVISIBLE);
|
185
|
+
|
186
|
+
bridge.getWebView().setVisibility(showWeb ? View.VISIBLE : View.INVISIBLE);
|
187
|
+
|
188
|
+
|
91
189
|
}
|
92
190
|
|
93
191
|
private List<Class<? extends Plugin>> loadPlugins(){
|
@@ -154,37 +252,87 @@ public class WebContainerActivity extends BridgeActivity {
|
|
154
252
|
}
|
155
253
|
|
156
254
|
//BridgeWebViewClient
|
157
|
-
class BypassWebViewClient extends
|
255
|
+
class BypassWebViewClient extends BridgeWebViewClient {
|
158
256
|
|
257
|
+
public BypassWebViewClient(Bridge bridge) {
|
258
|
+
super(bridge);
|
259
|
+
}
|
260
|
+
|
261
|
+
//somehow this must call parent, otherwise plugins won't work
|
159
262
|
@Override
|
160
263
|
public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
|
161
264
|
|
162
|
-
|
265
|
+
|
266
|
+
String url = request.getUrl().toString();
|
267
|
+
//debug("shouldInterceptRequest", url);
|
268
|
+
|
269
|
+
|
270
|
+
if(url.indexOf("//scan") > 0){
|
271
|
+
return null;
|
272
|
+
}
|
273
|
+
|
274
|
+
return super.shouldInterceptRequest(view, request);
|
275
|
+
|
276
|
+
//super.shouldInterceptRequest(view, request);
|
277
|
+
//return null;
|
163
278
|
}
|
164
279
|
|
165
280
|
|
166
281
|
@Override
|
167
282
|
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
|
168
|
-
|
283
|
+
debug("shouldOverrideUrlLoading", request.getUrl());
|
169
284
|
//Uri url = request.getUrl();
|
285
|
+
|
286
|
+
//return super.shouldOverrideUrlLoading(view, request);
|
287
|
+
|
170
288
|
return false;
|
171
289
|
}
|
172
290
|
|
173
291
|
@Override
|
174
292
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
175
|
-
|
293
|
+
debug("shouldOverrideUrlLoading", url);
|
176
294
|
//return bridge.launchIntent(Uri.parse(url));
|
295
|
+
|
296
|
+
//return super.shouldOverrideUrlLoading(view, url);
|
297
|
+
|
177
298
|
return false;
|
178
299
|
}
|
179
300
|
|
180
301
|
@Override
|
181
302
|
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
182
303
|
|
183
|
-
|
304
|
+
debug("onPageStarted", url);
|
184
305
|
|
185
|
-
|
306
|
+
super.onPageStarted(view, url, favicon);
|
186
307
|
|
308
|
+
//bridge.getWebView().setVisibility(View.VISIBLE);
|
309
|
+
initLayout(true, false, false);
|
187
310
|
}
|
311
|
+
|
312
|
+
@Override
|
313
|
+
public void onPageFinished (WebView view, String url){
|
314
|
+
|
315
|
+
debug("onPageFinished", url);
|
316
|
+
//bridge.getWebView().setVisibility(View.VISIBLE);
|
317
|
+
}
|
318
|
+
|
319
|
+
@Override
|
320
|
+
public void onReceivedError (WebView view, int errorCode, String description, String failingUrl){
|
321
|
+
debug("onReceivedErrorOld", errorCode, description, failingUrl);
|
322
|
+
|
323
|
+
initLayout(false, true, true);
|
324
|
+
}
|
325
|
+
|
326
|
+
/*
|
327
|
+
@Override
|
328
|
+
public void onReceivedError (WebView view,
|
329
|
+
WebResourceRequest request,
|
330
|
+
WebResourceError error){
|
331
|
+
|
332
|
+
debug("onReceivedError2", request.getUrl());
|
333
|
+
}*/
|
188
334
|
}
|
189
335
|
|
336
|
+
|
337
|
+
|
190
338
|
}
|
@@ -12,105 +12,59 @@ import com.getcapacitor.Plugin;
|
|
12
12
|
import com.getcapacitor.PluginCall;
|
13
13
|
import com.getcapacitor.PluginMethod;
|
14
14
|
import com.getcapacitor.annotation.CapacitorPlugin;
|
15
|
-
|
16
|
-
import
|
15
|
+
|
16
|
+
import org.json.JSONException;
|
17
|
+
|
18
|
+
import java.io.Serializable;
|
19
|
+
import java.util.HashMap;
|
20
|
+
import java.util.Iterator;
|
21
|
+
import java.util.Map;
|
17
22
|
|
18
23
|
@CapacitorPlugin(name = "Core")
|
19
24
|
public class CorePlugin extends Plugin {
|
20
25
|
|
26
|
+
public static boolean DEBUG = false;
|
27
|
+
|
28
|
+
private static Map member;
|
29
|
+
|
30
|
+
private void debug(Object msg){
|
31
|
+
|
32
|
+
if(DEBUG){
|
33
|
+
System.out.println(msg);
|
34
|
+
}
|
35
|
+
|
36
|
+
}
|
37
|
+
|
38
|
+
public static void setMember(Map member){
|
39
|
+
CorePlugin.member = member;
|
40
|
+
}
|
21
41
|
|
22
42
|
@Override
|
23
43
|
protected void handleOnStart(){
|
24
44
|
|
25
|
-
prepareScan();
|
26
45
|
}
|
27
46
|
|
28
47
|
@PluginMethod()
|
29
48
|
public void echo(PluginCall call) {
|
30
49
|
String value = call.getString("value");
|
31
50
|
|
51
|
+
debug("CorePlugin echo:" + value);
|
52
|
+
|
32
53
|
JSObject ret = new JSObject();
|
33
54
|
ret.put("value", value);
|
34
55
|
call.resolve(ret);
|
35
56
|
}
|
36
57
|
|
37
|
-
private PluginCall scanCall;
|
38
|
-
|
39
58
|
@PluginMethod()
|
40
|
-
public void
|
41
|
-
|
42
|
-
System.err.println("SCANNING!!");
|
43
|
-
|
44
|
-
this.scanCall = call;
|
45
|
-
scanRaw();
|
46
|
-
|
47
|
-
|
48
|
-
}
|
49
|
-
|
50
|
-
// Register the launcher and result handler
|
51
|
-
|
52
|
-
private ActivityResultLauncher<ScanOptions> barcodeLauncher;
|
53
|
-
|
54
|
-
private void prepareScan(){
|
55
|
-
|
56
|
-
AppCompatActivity act = getActivity();
|
57
|
-
|
58
|
-
barcodeLauncher = act.registerForActivityResult(new ScanContract(),
|
59
|
-
result -> {
|
60
|
-
|
61
|
-
if(scanCall == null){
|
62
|
-
System.err.println("Missing scan callback");
|
63
|
-
return;
|
64
|
-
}
|
65
|
-
|
66
|
-
if(result.getContents() == null) {
|
67
|
-
//Toast.makeText(MyActivity.this, "Cancelled", Toast.LENGTH_LONG).show();
|
68
|
-
System.err.println("scan cancelled");
|
69
|
-
JSObject ret = new JSObject();
|
70
|
-
ret.put("hasContent", false);
|
71
|
-
ret.put("success", false);
|
72
|
-
scanCall.resolve(ret);
|
73
|
-
} else {
|
74
|
-
//Toast.makeText(MyActivity.this, "Scanned: " + result.getContents(), Toast.LENGTH_LONG).show();
|
75
|
-
String val = result.getContents();
|
76
|
-
|
77
|
-
System.err.println("scan result:" + val);
|
78
|
-
|
79
|
-
if(val != null && val.length() > 0){
|
80
|
-
|
81
|
-
JSObject ret = new JSObject();
|
82
|
-
ret.put("content", val);
|
83
|
-
ret.put("hasContent", true);
|
84
|
-
ret.put("success", true);
|
85
|
-
scanCall.resolve(ret);
|
86
|
-
}else{
|
87
|
-
|
88
|
-
JSObject ret = new JSObject();
|
89
|
-
ret.put("hasContent", false);
|
90
|
-
ret.put("success", false);
|
91
|
-
scanCall.resolve(ret);
|
92
|
-
}
|
59
|
+
public void getMember(PluginCall call) {
|
93
60
|
|
61
|
+
debug("CorePlugin getMember:" + member);
|
94
62
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
});
|
63
|
+
JSObject ret = new JSObject();
|
64
|
+
ret.put("member", member);
|
65
|
+
call.resolve(ret);
|
99
66
|
}
|
100
67
|
|
101
|
-
private void scanRaw(){
|
102
|
-
|
103
|
-
ScanOptions options = new ScanOptions();
|
104
|
-
//options.setDesiredBarcodeFormats(ScanOptions.ONE_D_CODE_TYPES);
|
105
|
-
options.setPrompt("");
|
106
|
-
//options.setCameraId(0); // Use a specific camera of the device
|
107
|
-
options.setBeepEnabled(false);
|
108
|
-
options.setOrientationLocked(false);
|
109
|
-
options.setBarcodeImageEnabled(true);
|
110
|
-
|
111
|
-
//options.setBarcodeImageEnabled(true);
|
112
|
-
barcodeLauncher.launch(options);
|
113
|
-
}
|
114
68
|
|
115
69
|
// Launch
|
116
70
|
//public void onButtonClick(View view) {
|
@@ -124,6 +78,13 @@ public class CorePlugin extends Plugin {
|
|
124
78
|
|
125
79
|
}
|
126
80
|
|
81
|
+
@PluginMethod()
|
82
|
+
public void dismiss(PluginCall call) {
|
83
|
+
|
84
|
+
getActivity().finish();
|
85
|
+
|
86
|
+
}
|
87
|
+
|
127
88
|
@PluginMethod()
|
128
89
|
public void openBrowser(PluginCall call) {
|
129
90
|
|
@@ -132,12 +93,31 @@ public class CorePlugin extends Plugin {
|
|
132
93
|
if(url == null) return;
|
133
94
|
|
134
95
|
JSObject options = call.getObject("options", null);
|
96
|
+
JSObject member = call.getObject("member", null);
|
97
|
+
|
98
|
+
Map memMap = new HashMap();
|
99
|
+
|
100
|
+
if(member != null){
|
101
|
+
Iterator<String> iter = member.keys();
|
102
|
+
while(iter.hasNext()){
|
103
|
+
String k = iter.next();
|
104
|
+
try {
|
105
|
+
Object v = member.get(k);
|
106
|
+
memMap.put(k, v);
|
107
|
+
} catch (JSONException e) {
|
108
|
+
e.printStackTrace();
|
109
|
+
}
|
110
|
+
|
111
|
+
}
|
112
|
+
}
|
135
113
|
|
136
114
|
Activity act = getActivity();
|
137
115
|
|
138
116
|
Intent intent = new Intent(act, WebContainerActivity.class);
|
139
117
|
|
140
|
-
intent.putExtra("
|
118
|
+
intent.putExtra("url", url);
|
119
|
+
intent.putExtra("member", (Serializable) memMap);
|
120
|
+
|
141
121
|
act.startActivity(intent);
|
142
122
|
|
143
123
|
JSObject ret = new JSObject();
|
@@ -0,0 +1,55 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
3
|
+
xmlns:app="http://schemas.android.com/apk/res-auto"
|
4
|
+
xmlns:tools="http://schemas.android.com/tools"
|
5
|
+
android:layout_width="match_parent"
|
6
|
+
android:layout_height="match_parent"
|
7
|
+
tools:context="com.getcapacitor.BridgeActivity"
|
8
|
+
>
|
9
|
+
|
10
|
+
<com.getcapacitor.CapacitorWebView
|
11
|
+
android:id="@+id/webview"
|
12
|
+
android:layout_width="fill_parent"
|
13
|
+
android:layout_height="fill_parent">
|
14
|
+
|
15
|
+
</com.getcapacitor.CapacitorWebView>
|
16
|
+
|
17
|
+
<LinearLayout
|
18
|
+
android:id="@+id/info"
|
19
|
+
android:layout_width="match_parent"
|
20
|
+
android:layout_height="match_parent"
|
21
|
+
android:gravity="center"
|
22
|
+
android:orientation="vertical">
|
23
|
+
|
24
|
+
<ProgressBar
|
25
|
+
android:id="@+id/progress"
|
26
|
+
style="?android:attr/progressBarStyle"
|
27
|
+
android:layout_width="match_parent"
|
28
|
+
android:layout_height="wrap_content" />
|
29
|
+
|
30
|
+
</LinearLayout>
|
31
|
+
|
32
|
+
<LinearLayout
|
33
|
+
android:id="@+id/error"
|
34
|
+
android:layout_width="match_parent"
|
35
|
+
android:layout_height="match_parent"
|
36
|
+
android:gravity="center"
|
37
|
+
android:orientation="horizontal">
|
38
|
+
|
39
|
+
<Button
|
40
|
+
android:id="@+id/back"
|
41
|
+
android:layout_width="wrap_content"
|
42
|
+
android:layout_height="wrap_content"
|
43
|
+
android:layout_marginRight="8dp"
|
44
|
+
android:text="Exit" />
|
45
|
+
|
46
|
+
<Button
|
47
|
+
android:id="@+id/reload"
|
48
|
+
android:layout_width="wrap_content"
|
49
|
+
android:layout_height="wrap_content"
|
50
|
+
android:text="Reload" />
|
51
|
+
|
52
|
+
</LinearLayout>
|
53
|
+
|
54
|
+
|
55
|
+
</FrameLayout>
|
package/dist/docs.json
CHANGED
@@ -21,6 +21,22 @@
|
|
21
21
|
"complexTypes": [],
|
22
22
|
"slug": "echo"
|
23
23
|
},
|
24
|
+
{
|
25
|
+
"name": "dismiss",
|
26
|
+
"signature": "(options: any) => Promise<any>",
|
27
|
+
"parameters": [
|
28
|
+
{
|
29
|
+
"name": "options",
|
30
|
+
"docs": "",
|
31
|
+
"type": "any"
|
32
|
+
}
|
33
|
+
],
|
34
|
+
"returns": "Promise<any>",
|
35
|
+
"tags": [],
|
36
|
+
"docs": "",
|
37
|
+
"complexTypes": [],
|
38
|
+
"slug": "dismiss"
|
39
|
+
},
|
24
40
|
{
|
25
41
|
"name": "finish",
|
26
42
|
"signature": "(options: any) => Promise<any>",
|
@@ -38,7 +54,7 @@
|
|
38
54
|
"slug": "finish"
|
39
55
|
},
|
40
56
|
{
|
41
|
-
"name": "
|
57
|
+
"name": "getMember",
|
42
58
|
"signature": "(options: any) => Promise<any>",
|
43
59
|
"parameters": [
|
44
60
|
{
|
@@ -51,10 +67,10 @@
|
|
51
67
|
"tags": [],
|
52
68
|
"docs": "",
|
53
69
|
"complexTypes": [],
|
54
|
-
"slug": "
|
70
|
+
"slug": "getmember"
|
55
71
|
},
|
56
72
|
{
|
57
|
-
"name": "
|
73
|
+
"name": "openBrowser",
|
58
74
|
"signature": "(options: any) => Promise<any>",
|
59
75
|
"parameters": [
|
60
76
|
{
|
@@ -67,7 +83,7 @@
|
|
67
83
|
"tags": [],
|
68
84
|
"docs": "",
|
69
85
|
"complexTypes": [],
|
70
|
-
"slug": "
|
86
|
+
"slug": "openbrowser"
|
71
87
|
}
|
72
88
|
],
|
73
89
|
"properties": []
|
@@ -1,6 +1,7 @@
|
|
1
1
|
export interface CorePlugin {
|
2
2
|
echo(options: any): Promise<any>;
|
3
|
+
dismiss(options: any): Promise<any>;
|
3
4
|
finish(options: any): Promise<any>;
|
5
|
+
getMember(options: any): Promise<any>;
|
4
6
|
openBrowser(options: any): Promise<any>;
|
5
|
-
scan(options: any): Promise<any>;
|
6
7
|
}
|
@@ -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 finish(options: any): Promise<any>;\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 openBrowser(options: any): Promise<any>;\n\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
@@ -2,7 +2,8 @@ import { WebPlugin } from '@capacitor/core';
|
|
2
2
|
import type { CorePlugin } from './definitions';
|
3
3
|
export declare class CoreWeb extends WebPlugin implements CorePlugin {
|
4
4
|
echo(options: any): Promise<any>;
|
5
|
+
getMember(options: any): Promise<any>;
|
6
|
+
dismiss(options: any): Promise<any>;
|
5
7
|
finish(options: any): Promise<any>;
|
6
8
|
openBrowser(options: any): Promise<any>;
|
7
|
-
scan(options: any): Promise<any>;
|
8
9
|
}
|
package/dist/esm/web.js
CHANGED
@@ -4,6 +4,18 @@ export class CoreWeb extends WebPlugin {
|
|
4
4
|
console.log('ECHO', options);
|
5
5
|
return options;
|
6
6
|
}
|
7
|
+
async getMember(options) {
|
8
|
+
var _a, _b;
|
9
|
+
console.log('GET MEMBER', options);
|
10
|
+
var result = {};
|
11
|
+
var w = window;
|
12
|
+
result.member = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.member;
|
13
|
+
return result;
|
14
|
+
}
|
15
|
+
async dismiss(options) {
|
16
|
+
console.log('DISMISS', options);
|
17
|
+
return options;
|
18
|
+
}
|
7
19
|
async finish(options) {
|
8
20
|
console.log('FINISH', options);
|
9
21
|
return options;
|
@@ -12,9 +24,5 @@ export class CoreWeb extends WebPlugin {
|
|
12
24
|
console.log(options);
|
13
25
|
throw new Error('Method not implemented.');
|
14
26
|
}
|
15
|
-
async scan(options) {
|
16
|
-
console.log(options);
|
17
|
-
throw new Error('Method not implemented.');
|
18
|
-
}
|
19
27
|
}
|
20
28
|
//# sourceMappingURL=web.js.map
|