@aigens/aigens-sdk-core 0.4.4 → 0.4.6
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 +51 -4
- package/android/src/main/java/com/aigens/sdk/WebContainerActivity.java +25 -0
- package/android/src/main/java/com/aigens/sdk/plugins/CorePlugin.java +58 -0
- package/dist/docs.json +146 -3
- package/dist/esm/definitions.d.ts +21 -1
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +3 -2
- package/dist/esm/web.js +4 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +3 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +3 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/CorePlugin.m +1 -0
- package/ios/Plugin/CorePlugin.swift +122 -3
- package/ios/Plugin/WebContainerViewController.swift +98 -74
- package/package.json +1 -1
package/README.md
CHANGED
@@ -27,6 +27,7 @@ npx cap sync
|
|
27
27
|
* [`setTextZoom(...)`](#settextzoom)
|
28
28
|
* [`readClipboard()`](#readclipboard)
|
29
29
|
* [`addCalendar(...)`](#addcalendar)
|
30
|
+
* [`makeHKFPSPayment(...)`](#makehkfpspayment)
|
30
31
|
* [Interfaces](#interfaces)
|
31
32
|
* [Type Aliases](#type-aliases)
|
32
33
|
|
@@ -113,12 +114,12 @@ getDeeplink(options: any) => Promise<{ deeplink: Deeplink; }>
|
|
113
114
|
### openBrowser(...)
|
114
115
|
|
115
116
|
```typescript
|
116
|
-
openBrowser(options:
|
117
|
+
openBrowser(options: BrowserOptions) => Promise<any>
|
117
118
|
```
|
118
119
|
|
119
|
-
| Param | Type
|
120
|
-
| ------------- |
|
121
|
-
| **`options`** | <code>
|
120
|
+
| Param | Type |
|
121
|
+
| ------------- | --------------------------------------------------------- |
|
122
|
+
| **`options`** | <code><a href="#browseroptions">BrowserOptions</a></code> |
|
122
123
|
|
123
124
|
**Returns:** <code>Promise<any></code>
|
124
125
|
|
@@ -235,6 +236,21 @@ addCalendar(options: CalendarOptions) => Promise<{ notPermission?: boolean; resu
|
|
235
236
|
--------------------
|
236
237
|
|
237
238
|
|
239
|
+
### makeHKFPSPayment(...)
|
240
|
+
|
241
|
+
```typescript
|
242
|
+
makeHKFPSPayment(options: FPSPaymentOptions) => Promise<FPSResultOptions>
|
243
|
+
```
|
244
|
+
|
245
|
+
| Param | Type |
|
246
|
+
| ------------- | --------------------------------------------------------------- |
|
247
|
+
| **`options`** | <code><a href="#fpspaymentoptions">FPSPaymentOptions</a></code> |
|
248
|
+
|
249
|
+
**Returns:** <code>Promise<<a href="#fpsresultoptions">FPSResultOptions</a>></code>
|
250
|
+
|
251
|
+
--------------------
|
252
|
+
|
253
|
+
|
238
254
|
### Interfaces
|
239
255
|
|
240
256
|
|
@@ -264,6 +280,18 @@ addCalendar(options: CalendarOptions) => Promise<{ notPermission?: boolean; resu
|
|
264
280
|
| **`"addOfferId"`** | <code>string</code> |
|
265
281
|
|
266
282
|
|
283
|
+
#### BrowserOptions
|
284
|
+
|
285
|
+
| Prop | Type |
|
286
|
+
| ---------------------------- | --------------------------------------------- |
|
287
|
+
| **`url`** | <code>string</code> |
|
288
|
+
| **`member`** | <code><a href="#member">Member</a></code> |
|
289
|
+
| **`deeplink`** | <code><a href="#deeplink">Deeplink</a></code> |
|
290
|
+
| **`externalProtocols`** | <code>string[]</code> |
|
291
|
+
| **`addPaddingProtocols`** | <code>string[]</code> |
|
292
|
+
| **`excludedUniversalLinks`** | <code>string[]</code> |
|
293
|
+
|
294
|
+
|
267
295
|
#### PermissionStatus
|
268
296
|
|
269
297
|
| Prop | Type |
|
@@ -283,6 +311,25 @@ addCalendar(options: CalendarOptions) => Promise<{ notPermission?: boolean; resu
|
|
283
311
|
| **`notes`** | <code>string</code> |
|
284
312
|
|
285
313
|
|
314
|
+
#### FPSResultOptions
|
315
|
+
|
316
|
+
| Prop | Type |
|
317
|
+
| ------------ | -------------------- |
|
318
|
+
| **`result`** | <code>boolean</code> |
|
319
|
+
| **`url`** | <code>string</code> |
|
320
|
+
| **`intent`** | <code>string</code> |
|
321
|
+
|
322
|
+
|
323
|
+
#### FPSPaymentOptions
|
324
|
+
|
325
|
+
| Prop | Type |
|
326
|
+
| ----------------------- | ------------------- |
|
327
|
+
| **`paymentRequestUrl`** | <code>string</code> |
|
328
|
+
| **`callbackUrl`** | <code>string</code> |
|
329
|
+
| **`typeIdentifier`** | <code>string</code> |
|
330
|
+
| **`title`** | <code>string</code> |
|
331
|
+
|
332
|
+
|
286
333
|
### Type Aliases
|
287
334
|
|
288
335
|
|
@@ -85,6 +85,11 @@ public class WebContainerActivity extends BridgeActivity {
|
|
85
85
|
add("mpay://");
|
86
86
|
}};
|
87
87
|
|
88
|
+
static List<String> excludedUniversalLinks = new ArrayList<String>() {{
|
89
|
+
add("aigenshkfps=true");
|
90
|
+
add("aigenshkfps/true");
|
91
|
+
}};
|
92
|
+
|
88
93
|
private void debug(Object... msgs) {
|
89
94
|
|
90
95
|
|
@@ -96,6 +101,15 @@ public class WebContainerActivity extends BridgeActivity {
|
|
96
101
|
}
|
97
102
|
}
|
98
103
|
|
104
|
+
private boolean isExcludedUniversalLink(String url) {
|
105
|
+
for (String p : WebContainerActivity.excludedUniversalLinks) {
|
106
|
+
if (url != null && url != "" && url.contains(p)) {
|
107
|
+
return true;
|
108
|
+
}
|
109
|
+
}
|
110
|
+
return false;
|
111
|
+
}
|
112
|
+
|
99
113
|
private String getRedirectUrl(Intent intent) {
|
100
114
|
try {
|
101
115
|
// Intent intent = getIntent();
|
@@ -114,6 +128,10 @@ public class WebContainerActivity extends BridgeActivity {
|
|
114
128
|
universalLink = null;
|
115
129
|
}
|
116
130
|
}
|
131
|
+
|
132
|
+
if (isExcludedUniversalLink(totalUrl)) {
|
133
|
+
return null;
|
134
|
+
}
|
117
135
|
// Log.i("Jason totalUrl", totalUrl+universalLink);
|
118
136
|
if (totalUrl != null && totalUrl.indexOf("redirect=") >= 0) {
|
119
137
|
redirectUrl = totalUrl.split("redirect=")[1];
|
@@ -217,6 +235,13 @@ public class WebContainerActivity extends BridgeActivity {
|
|
217
235
|
}
|
218
236
|
}
|
219
237
|
|
238
|
+
List<String> excludedUniversalLinks = (List<String>) intent.getSerializableExtra("excludedUniversalLinks");
|
239
|
+
if (excludedUniversalLinks != null) {
|
240
|
+
for (String s : excludedUniversalLinks) {
|
241
|
+
WebContainerActivity.excludedUniversalLinks.add(s);
|
242
|
+
}
|
243
|
+
}
|
244
|
+
|
220
245
|
if (this.member != null) {
|
221
246
|
CorePlugin.setMember(this.member);
|
222
247
|
}
|
@@ -256,6 +256,16 @@ public class CorePlugin extends Plugin {
|
|
256
256
|
e.printStackTrace();
|
257
257
|
}
|
258
258
|
|
259
|
+
JSArray excludedUniversalLinks = call.getArray("excludedUniversalLinks");
|
260
|
+
try {
|
261
|
+
if (excludedUniversalLinks != null) {
|
262
|
+
List<String> es = excludedUniversalLinks.toList();
|
263
|
+
intent.putExtra("excludedUniversalLinks", (Serializable) es);
|
264
|
+
}
|
265
|
+
} catch (JSONException e) {
|
266
|
+
e.printStackTrace();
|
267
|
+
}
|
268
|
+
|
259
269
|
intent.putExtra("url", url);
|
260
270
|
intent.putExtra("clearCache", clearCache);
|
261
271
|
intent.putExtra("member", (Serializable) memMap);
|
@@ -469,4 +479,52 @@ public class CorePlugin extends Plugin {
|
|
469
479
|
call.resolve(object);
|
470
480
|
}
|
471
481
|
|
482
|
+
|
483
|
+
@PluginMethod()
|
484
|
+
public void makeHKFPSPayment(PluginCall call) {
|
485
|
+
|
486
|
+
String paymentRequestUrl = call.getString("paymentRequestUrl", "");
|
487
|
+
if (paymentRequestUrl.isEmpty()) {
|
488
|
+
call.reject("missing paymentRequestUrl");
|
489
|
+
return;
|
490
|
+
}
|
491
|
+
|
492
|
+
String typeIdentifier = call.getString("typeIdentifier", "hk.com.hkicl");
|
493
|
+
String title = call.getString("title", "");
|
494
|
+
|
495
|
+
// 創建一個Intent對象
|
496
|
+
Intent intent = new Intent();
|
497
|
+
// 設置Intent的動作值為“hk.com.hkicl”
|
498
|
+
intent.setAction(typeIdentifier);
|
499
|
+
// 將支付請求的URL放入Intent對象的額外數據中,鍵為“url”
|
500
|
+
intent.putExtra("url", paymentRequestUrl);
|
501
|
+
|
502
|
+
|
503
|
+
getActivity().runOnUiThread(new Runnable() {
|
504
|
+
@Override
|
505
|
+
public void run() {
|
506
|
+
startActivityForResult(call, Intent.createChooser(intent, title), "hkfpsExcuteCallback");
|
507
|
+
}
|
508
|
+
});
|
509
|
+
|
510
|
+
}
|
511
|
+
|
512
|
+
@ActivityCallback
|
513
|
+
private void hkfpsExcuteCallback(PluginCall call, ActivityResult result) {
|
514
|
+
int resultCode = result.getResultCode();
|
515
|
+
Intent data = result.getData();
|
516
|
+
JSObject ret = new JSObject();
|
517
|
+
if (data != null) {
|
518
|
+
ret.put("intent", data.toString());
|
519
|
+
}
|
520
|
+
|
521
|
+
if (resultCode == Activity.RESULT_OK) {
|
522
|
+
ret.put("result", true);
|
523
|
+
} else if (resultCode == Activity.RESULT_CANCELED) { // 支付失敗 ,是失敗不一定是取消
|
524
|
+
ret.put("result", false);
|
525
|
+
}
|
526
|
+
|
527
|
+
call.resolve(ret);
|
528
|
+
}
|
529
|
+
|
472
530
|
}
|
package/dist/docs.json
CHANGED
@@ -91,18 +91,20 @@
|
|
91
91
|
},
|
92
92
|
{
|
93
93
|
"name": "openBrowser",
|
94
|
-
"signature": "(options:
|
94
|
+
"signature": "(options: BrowserOptions) => Promise<any>",
|
95
95
|
"parameters": [
|
96
96
|
{
|
97
97
|
"name": "options",
|
98
98
|
"docs": "",
|
99
|
-
"type": "
|
99
|
+
"type": "BrowserOptions"
|
100
100
|
}
|
101
101
|
],
|
102
102
|
"returns": "Promise<any>",
|
103
103
|
"tags": [],
|
104
104
|
"docs": "",
|
105
|
-
"complexTypes": [
|
105
|
+
"complexTypes": [
|
106
|
+
"BrowserOptions"
|
107
|
+
],
|
106
108
|
"slug": "openbrowser"
|
107
109
|
},
|
108
110
|
{
|
@@ -223,6 +225,25 @@
|
|
223
225
|
"CalendarOptions"
|
224
226
|
],
|
225
227
|
"slug": "addcalendar"
|
228
|
+
},
|
229
|
+
{
|
230
|
+
"name": "makeHKFPSPayment",
|
231
|
+
"signature": "(options: FPSPaymentOptions) => Promise<FPSResultOptions>",
|
232
|
+
"parameters": [
|
233
|
+
{
|
234
|
+
"name": "options",
|
235
|
+
"docs": "",
|
236
|
+
"type": "FPSPaymentOptions"
|
237
|
+
}
|
238
|
+
],
|
239
|
+
"returns": "Promise<FPSResultOptions>",
|
240
|
+
"tags": [],
|
241
|
+
"docs": "",
|
242
|
+
"complexTypes": [
|
243
|
+
"FPSResultOptions",
|
244
|
+
"FPSPaymentOptions"
|
245
|
+
],
|
246
|
+
"slug": "makehkfpspayment"
|
226
247
|
}
|
227
248
|
],
|
228
249
|
"properties": []
|
@@ -344,6 +365,61 @@
|
|
344
365
|
}
|
345
366
|
]
|
346
367
|
},
|
368
|
+
{
|
369
|
+
"name": "BrowserOptions",
|
370
|
+
"slug": "browseroptions",
|
371
|
+
"docs": "",
|
372
|
+
"tags": [],
|
373
|
+
"methods": [],
|
374
|
+
"properties": [
|
375
|
+
{
|
376
|
+
"name": "url",
|
377
|
+
"tags": [],
|
378
|
+
"docs": "",
|
379
|
+
"complexTypes": [],
|
380
|
+
"type": "string"
|
381
|
+
},
|
382
|
+
{
|
383
|
+
"name": "member",
|
384
|
+
"tags": [],
|
385
|
+
"docs": "",
|
386
|
+
"complexTypes": [
|
387
|
+
"Member"
|
388
|
+
],
|
389
|
+
"type": "Member"
|
390
|
+
},
|
391
|
+
{
|
392
|
+
"name": "deeplink",
|
393
|
+
"tags": [],
|
394
|
+
"docs": "",
|
395
|
+
"complexTypes": [
|
396
|
+
"Deeplink"
|
397
|
+
],
|
398
|
+
"type": "Deeplink"
|
399
|
+
},
|
400
|
+
{
|
401
|
+
"name": "externalProtocols",
|
402
|
+
"tags": [],
|
403
|
+
"docs": "",
|
404
|
+
"complexTypes": [],
|
405
|
+
"type": "string[] | undefined"
|
406
|
+
},
|
407
|
+
{
|
408
|
+
"name": "addPaddingProtocols",
|
409
|
+
"tags": [],
|
410
|
+
"docs": "",
|
411
|
+
"complexTypes": [],
|
412
|
+
"type": "string[] | undefined"
|
413
|
+
},
|
414
|
+
{
|
415
|
+
"name": "excludedUniversalLinks",
|
416
|
+
"tags": [],
|
417
|
+
"docs": "",
|
418
|
+
"complexTypes": [],
|
419
|
+
"type": "string[] | undefined"
|
420
|
+
}
|
421
|
+
]
|
422
|
+
},
|
347
423
|
{
|
348
424
|
"name": "PermissionStatus",
|
349
425
|
"slug": "permissionstatus",
|
@@ -412,6 +488,73 @@
|
|
412
488
|
"type": "string | undefined"
|
413
489
|
}
|
414
490
|
]
|
491
|
+
},
|
492
|
+
{
|
493
|
+
"name": "FPSResultOptions",
|
494
|
+
"slug": "fpsresultoptions",
|
495
|
+
"docs": "",
|
496
|
+
"tags": [],
|
497
|
+
"methods": [],
|
498
|
+
"properties": [
|
499
|
+
{
|
500
|
+
"name": "result",
|
501
|
+
"tags": [],
|
502
|
+
"docs": "",
|
503
|
+
"complexTypes": [],
|
504
|
+
"type": "boolean"
|
505
|
+
},
|
506
|
+
{
|
507
|
+
"name": "url",
|
508
|
+
"tags": [],
|
509
|
+
"docs": "",
|
510
|
+
"complexTypes": [],
|
511
|
+
"type": "string | undefined"
|
512
|
+
},
|
513
|
+
{
|
514
|
+
"name": "intent",
|
515
|
+
"tags": [],
|
516
|
+
"docs": "",
|
517
|
+
"complexTypes": [],
|
518
|
+
"type": "string | undefined"
|
519
|
+
}
|
520
|
+
]
|
521
|
+
},
|
522
|
+
{
|
523
|
+
"name": "FPSPaymentOptions",
|
524
|
+
"slug": "fpspaymentoptions",
|
525
|
+
"docs": "",
|
526
|
+
"tags": [],
|
527
|
+
"methods": [],
|
528
|
+
"properties": [
|
529
|
+
{
|
530
|
+
"name": "paymentRequestUrl",
|
531
|
+
"tags": [],
|
532
|
+
"docs": "",
|
533
|
+
"complexTypes": [],
|
534
|
+
"type": "string"
|
535
|
+
},
|
536
|
+
{
|
537
|
+
"name": "callbackUrl",
|
538
|
+
"tags": [],
|
539
|
+
"docs": "",
|
540
|
+
"complexTypes": [],
|
541
|
+
"type": "string | undefined"
|
542
|
+
},
|
543
|
+
{
|
544
|
+
"name": "typeIdentifier",
|
545
|
+
"tags": [],
|
546
|
+
"docs": "",
|
547
|
+
"complexTypes": [],
|
548
|
+
"type": "string | undefined"
|
549
|
+
},
|
550
|
+
{
|
551
|
+
"name": "title",
|
552
|
+
"tags": [],
|
553
|
+
"docs": "",
|
554
|
+
"complexTypes": [],
|
555
|
+
"type": "string | undefined"
|
556
|
+
}
|
557
|
+
]
|
415
558
|
}
|
416
559
|
],
|
417
560
|
"enums": [],
|
@@ -9,7 +9,7 @@ export interface CorePlugin {
|
|
9
9
|
getDeeplink(options: any): Promise<{
|
10
10
|
deeplink: Deeplink;
|
11
11
|
}>;
|
12
|
-
openBrowser(options:
|
12
|
+
openBrowser(options: BrowserOptions): Promise<any>;
|
13
13
|
isInstalledApp(options: {
|
14
14
|
key: string;
|
15
15
|
}): Promise<{
|
@@ -40,6 +40,26 @@ export interface CorePlugin {
|
|
40
40
|
notPermission?: boolean;
|
41
41
|
resultCode?: number;
|
42
42
|
}>;
|
43
|
+
makeHKFPSPayment(options: FPSPaymentOptions): Promise<FPSResultOptions>;
|
44
|
+
}
|
45
|
+
export interface FPSPaymentOptions {
|
46
|
+
paymentRequestUrl: string;
|
47
|
+
callbackUrl?: string;
|
48
|
+
typeIdentifier?: string;
|
49
|
+
title?: string;
|
50
|
+
}
|
51
|
+
export interface FPSResultOptions {
|
52
|
+
result: boolean;
|
53
|
+
url?: string;
|
54
|
+
intent?: string;
|
55
|
+
}
|
56
|
+
export interface BrowserOptions {
|
57
|
+
url: string;
|
58
|
+
member?: Member;
|
59
|
+
deeplink?: Deeplink;
|
60
|
+
externalProtocols?: string[];
|
61
|
+
addPaddingProtocols?: string[];
|
62
|
+
excludedUniversalLinks?: string[];
|
43
63
|
}
|
44
64
|
export interface CalendarOptions {
|
45
65
|
title: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PermissionState } from '@capacitor/core';\nexport 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<{ member: Member }>;\n getDeeplink(options: any): Promise<{ deeplink: Deeplink }>;\n openBrowser(options:
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PermissionState } from '@capacitor/core';\nexport 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<{ member: Member }>;\n getDeeplink(options: any): Promise<{ deeplink: Deeplink }>;\n openBrowser(options: BrowserOptions): Promise<any>;\n isInstalledApp(options: { key: string }): Promise<{ install: boolean }>;\n getIsProductionEnvironment(): Promise<{ isPrd: boolean }>;\n openExternalUrl(options: { url: string }): Promise<any>;\n checkNotificationPermissions(): Promise<PermissionStatus>;\n getFinishData(options: any): Promise<{closedData: any}>;\n /**\n *\n * @param value : 0 - 1\n */\n setTextZoom(options: { value: number }): Promise<any>;\n\n /**\n * Promise<any>: { value: string, type: 'text/plain' }\n */\n readClipboard(): Promise<any>;\n\n addCalendar(options: CalendarOptions): Promise<{notPermission?: boolean, resultCode?: number}>;\n\n makeHKFPSPayment(options: FPSPaymentOptions): Promise<FPSResultOptions>;\n}\n\nexport interface FPSPaymentOptions {\n paymentRequestUrl: string,\n callbackUrl?: string,\n typeIdentifier?: string,\n title?: string,\n}\nexport interface FPSResultOptions {\n result: boolean,\n url?: string,\n intent?: string\n}\n\nexport interface BrowserOptions {\n url: string,\n member?: Member,\n deeplink?: Deeplink,\n externalProtocols?: string[],\n addPaddingProtocols?: string[],\n excludedUniversalLinks?: string[],\n}\n\nexport interface CalendarOptions {\n title: string,\n isAllDay?: boolean,\n beginTime?: number,\n endTime?: number,\n location?: string,\n notes?: string\n}\n\nexport interface Member {\n \"memberCode\"?: string;\n \"source\"?: string;\n \"sessionId\"?: string;\n \"pushId\"?: string;\n \"deviceId\": string;\n \"universalLink\"?: string;\n \"appleMerchantId\"?: string;\n \"cachedOrderContext\"?: boolean;\n \"name\"?: string;\n \"email\"?: string;\n \"phone\"?: string;\n}\nexport interface Deeplink {\n \"addItemId\"?: string;\n \"addDiscountCode\"?: string;\n \"addOfferId\"?: string;\n}\n\nexport interface PermissionStatus {\n display: PermissionState;\n}\n\n"]}
|
package/dist/esm/web.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { WebPlugin } from '@capacitor/core';
|
2
|
-
import type { CalendarOptions, CorePlugin, Deeplink, Member, PermissionStatus } from './definitions';
|
2
|
+
import type { BrowserOptions, CalendarOptions, CorePlugin, Deeplink, FPSPaymentOptions, FPSResultOptions, Member, PermissionStatus } 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<{
|
@@ -10,7 +10,7 @@ export declare class CoreWeb extends WebPlugin implements CorePlugin {
|
|
10
10
|
}>;
|
11
11
|
dismiss(options: any): Promise<any>;
|
12
12
|
finish(options: any): Promise<any>;
|
13
|
-
openBrowser(options:
|
13
|
+
openBrowser(options: BrowserOptions): Promise<any>;
|
14
14
|
isInstalledApp(options: {
|
15
15
|
key: string;
|
16
16
|
}): Promise<{
|
@@ -34,4 +34,5 @@ export declare class CoreWeb extends WebPlugin implements CorePlugin {
|
|
34
34
|
notPermission?: boolean;
|
35
35
|
resultCode?: number;
|
36
36
|
}>;
|
37
|
+
makeHKFPSPayment(options: FPSPaymentOptions): Promise<FPSResultOptions>;
|
37
38
|
}
|
package/dist/esm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AAE,CAAC;QAClD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAAwB;QACtC,OAAO,CAAA;QACP,OAAO,EAAC,aAAa,EAAE,IAAI,EAAC,CAAA;IAChC,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,OAA0B;QAC7C,OAAO,CAAA;QACP,OAAO,EAAS,CAAC;IACrB,CAAC;CAEJ","sourcesContent":["import { WebPlugin } from '@capacitor/core';\nimport type { BrowserOptions, CalendarOptions, CorePlugin, Deeplink, FPSPaymentOptions, FPSResultOptions, Member, PermissionStatus } 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<{ member: Member }> {\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<{ deeplink: Deeplink }> {\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: BrowserOptions): 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 async checkNotificationPermissions(): Promise<PermissionStatus> {\n throw new Error('checkNotificationPermissions not supported in browser.');\n }\n\n async getFinishData(options: any): Promise<{ closedData: any }> {\n return { closedData: options }\n }\n\n async setTextZoom(options: { value: number }): Promise<any> {\n if (typeof document !== 'undefined') {\n try {\n document.body.style.webkitTextSizeAdjust = `${Math.round(options.value * 100)}%`;\n } catch (error) {\n }\n }\n return options;\n }\n\n async readClipboard(): Promise<any> {\n if (\n typeof navigator === 'undefined' ||\n !navigator.clipboard ||\n !navigator.clipboard.readText\n ) {\n throw this.unavailable(\n 'Reading from clipboard not supported in this browser',\n );\n }\n\n const text = await navigator.clipboard.readText();\n return { value: text, type: 'text/plain' };\n }\n\n async addCalendar(options: CalendarOptions): Promise<{notPermission?: boolean, resultCode?: number}> {\n options\n return {notPermission: true}\n }\n\n async makeHKFPSPayment(options: FPSPaymentOptions): Promise<FPSResultOptions> {\n options\n return {} as any;\n }\n\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
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 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 async checkNotificationPermissions() {\n throw new Error('checkNotificationPermissions not supported in browser.');\n }\n async getFinishData(options) {\n return { closedData: options };\n }\n async setTextZoom(options) {\n if (typeof document !== 'undefined') {\n try {\n document.body.style.webkitTextSizeAdjust = `${Math.round(options.value * 100)}%`;\n }\n catch (error) {\n }\n }\n return options;\n }\n async readClipboard() {\n if (typeof navigator === 'undefined' ||\n !navigator.clipboard ||\n !navigator.clipboard.readText) {\n throw this.unavailable('Reading from clipboard not supported in this browser');\n }\n const text = await navigator.clipboard.readText();\n return { value: text, type: 'text/plain' };\n }\n async addCalendar(options) {\n options;\n return { notPermission: 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,G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AAC,SAAS;AAChC,YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE;AAC3C,YAAY,MAAM,IAAI,CAAC,WAAW,CAAC,sDAAsD,CAAC,CAAC;AAC3F,SAAS;AACT,QAAQ,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;AAC1D,QAAQ,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;AACnD,KAAK;AACL,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;AAE/B,QAAQ,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;AACvC,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 async checkNotificationPermissions() {\n throw new Error('checkNotificationPermissions not supported in browser.');\n }\n async getFinishData(options) {\n return { closedData: options };\n }\n async setTextZoom(options) {\n if (typeof document !== 'undefined') {\n try {\n document.body.style.webkitTextSizeAdjust = `${Math.round(options.value * 100)}%`;\n }\n catch (error) {\n }\n }\n return options;\n }\n async readClipboard() {\n if (typeof navigator === 'undefined' ||\n !navigator.clipboard ||\n !navigator.clipboard.readText) {\n throw this.unavailable('Reading from clipboard not supported in this browser');\n }\n const text = await navigator.clipboard.readText();\n return { value: text, type: 'text/plain' };\n }\n async addCalendar(options) {\n options;\n return { notPermission: true };\n }\n async makeHKFPSPayment(options) {\n options;\n return {};\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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E;AAC3C,YAAY,MAAM,IAAI,CAAC,WAAW,CAAC,sDAAsD,CAAC,CAAC;AAC3F,SAAS;AACT,QAAQ,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;AAC1D,QAAQ,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;AACnD,KAAK;AACL,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;AAE/B,QAAQ,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;AACvC,KAAK;AACL,IAAI,MAAM,gBAAgB,CAAC,OAAO,EAAE;AAEpC,QAAQ,OAAO,EAAE,CAAC;AAClB,KAAK;AACL;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
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 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 async checkNotificationPermissions() {\n throw new Error('checkNotificationPermissions not supported in browser.');\n }\n async getFinishData(options) {\n return { closedData: options };\n }\n async setTextZoom(options) {\n if (typeof document !== 'undefined') {\n try {\n document.body.style.webkitTextSizeAdjust = `${Math.round(options.value * 100)}%`;\n }\n catch (error) {\n }\n }\n return options;\n }\n async readClipboard() {\n if (typeof navigator === 'undefined' ||\n !navigator.clipboard ||\n !navigator.clipboard.readText) {\n throw this.unavailable('Reading from clipboard not supported in this browser');\n }\n const text = await navigator.clipboard.readText();\n return { value: text, type: 'text/plain' };\n }\n async addCalendar(options) {\n options;\n return { notPermission: 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,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,GAA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Y,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE;IAC3C,YAAY,MAAM,IAAI,CAAC,WAAW,CAAC,sDAAsD,CAAC,CAAC;IAC3F,SAAS;IACT,QAAQ,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;IAC1D,QAAQ,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IACnD,KAAK;IACL,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;IAE/B,QAAQ,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;IACvC,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 async checkNotificationPermissions() {\n throw new Error('checkNotificationPermissions not supported in browser.');\n }\n async getFinishData(options) {\n return { closedData: options };\n }\n async setTextZoom(options) {\n if (typeof document !== 'undefined') {\n try {\n document.body.style.webkitTextSizeAdjust = `${Math.round(options.value * 100)}%`;\n }\n catch (error) {\n }\n }\n return options;\n }\n async readClipboard() {\n if (typeof navigator === 'undefined' ||\n !navigator.clipboard ||\n !navigator.clipboard.readText) {\n throw this.unavailable('Reading from clipboard not supported in this browser');\n }\n const text = await navigator.clipboard.readText();\n return { value: text, type: 'text/plain' };\n }\n async addCalendar(options) {\n options;\n return { notPermission: true };\n }\n async makeHKFPSPayment(options) {\n options;\n return {};\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,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,MAAM,MAAM,IAAI,IAAI,EAAE,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M,IAAI,CAAC,WAAW,CAAC,sDAAsD,CAAC,CAAC;IAC3F,SAAS;IACT,QAAQ,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;IAC1D,QAAQ,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IACnD,KAAK;IACL,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;IAE/B,QAAQ,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;IACvC,KAAK;IACL,IAAI,MAAM,gBAAgB,CAAC,OAAO,EAAE;IAEpC,QAAQ,OAAO,EAAE,CAAC;IAClB,KAAK;IACL;;;;;;;;;;;;;;;;;"}
|
package/ios/Plugin/CorePlugin.m
CHANGED
@@ -18,6 +18,7 @@ CAP_PLUGIN(CorePlugin, "Core",
|
|
18
18
|
CAP_PLUGIN_METHOD(setTextZoom, CAPPluginReturnPromise);
|
19
19
|
CAP_PLUGIN_METHOD(readClipboard, CAPPluginReturnPromise);
|
20
20
|
CAP_PLUGIN_METHOD(addCalendar, CAPPluginReturnPromise);
|
21
|
+
CAP_PLUGIN_METHOD(makeHKFPSPayment, CAPPluginReturnPromise);
|
21
22
|
|
22
23
|
|
23
24
|
)
|
@@ -1,7 +1,12 @@
|
|
1
1
|
import Foundation
|
2
2
|
import Capacitor
|
3
3
|
import UIKit
|
4
|
+
|
5
|
+
#if DISABLE_ADD_CALENDER
|
6
|
+
#else
|
4
7
|
import EventKitUI
|
8
|
+
#endif
|
9
|
+
|
5
10
|
|
6
11
|
@objc public protocol CoreDelegate: AnyObject {
|
7
12
|
func isInterceptedUrl(url: URL, webview: WKWebView) -> Bool
|
@@ -22,6 +27,105 @@ public class CorePlugin: CAPPlugin {
|
|
22
27
|
public static var member: Dictionary<String, Any>?
|
23
28
|
public static var deeplink: Dictionary<String, Any>?
|
24
29
|
|
30
|
+
|
31
|
+
public override func load() {
|
32
|
+
handleOpenUrl()
|
33
|
+
}
|
34
|
+
|
35
|
+
private func handleOpenUrl() {
|
36
|
+
NotificationCenter.default.addObserver(self, selector: #selector(self.handleUniversalLink(notification:)), name: Notification.Name.capacitorOpenUniversalLink, object: nil)
|
37
|
+
|
38
|
+
NotificationCenter.default.addObserver(self, selector: #selector(self.handleUrlOpened(notification:)), name: Notification.Name.capacitorOpenURL, object: nil)
|
39
|
+
}
|
40
|
+
|
41
|
+
@objc func handleUrlOpened(notification: NSNotification) {
|
42
|
+
guard let object = notification.object as? [String: Any?] else {
|
43
|
+
return
|
44
|
+
}
|
45
|
+
|
46
|
+
aigensprint("CorePlugin handleUrlOpened url:\(object)")
|
47
|
+
guard let url = object["url"] as? URL else {
|
48
|
+
return
|
49
|
+
}
|
50
|
+
|
51
|
+
handleHKFPSUniversalLink(url)
|
52
|
+
|
53
|
+
}
|
54
|
+
|
55
|
+
@objc func handleUniversalLink(notification: NSNotification) {
|
56
|
+
guard let object = notification.object as? [String: Any?] else {
|
57
|
+
return
|
58
|
+
}
|
59
|
+
|
60
|
+
aigensprint("CorePlugin handleUniversalLink url:\(object)")
|
61
|
+
guard let url = object["url"] as? URL else {
|
62
|
+
return
|
63
|
+
}
|
64
|
+
|
65
|
+
handleHKFPSUniversalLink(url)
|
66
|
+
|
67
|
+
}
|
68
|
+
|
69
|
+
private func decodeURIComponent(_ url: URL) -> URL {
|
70
|
+
let str = url.absoluteString
|
71
|
+
let urlStr = str.removingPercentEncoding ?? str
|
72
|
+
return URL(string: urlStr) ?? url
|
73
|
+
}
|
74
|
+
|
75
|
+
private func decodeURIComponent(_ str: String) -> String {
|
76
|
+
return str.removingPercentEncoding ?? str
|
77
|
+
}
|
78
|
+
|
79
|
+
@objc func handleHKFPSUniversalLink(_ url: URL) {
|
80
|
+
let url_ = decodeURIComponent(url.absoluteString)
|
81
|
+
if (!(url_.contains("aigenshkfps=true") || url_.contains("aigenshkfps/true"))) {
|
82
|
+
return
|
83
|
+
}
|
84
|
+
// 當universal link 並調用時, 會給多個參數: is_successful: 1 => 成功; 0 => 不成功
|
85
|
+
DispatchQueue.main.async {
|
86
|
+
CorePlugin.HKFPSCall?.resolve(["url": url_, "result": (url_.contains("is_successful=1") || url_.contains("is_successful=true")) ? true: false])
|
87
|
+
CorePlugin.HKFPSCall = nil
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
private static var HKFPSCall: CAPPluginCall?
|
92
|
+
@objc func makeHKFPSPayment(_ call: CAPPluginCall) {
|
93
|
+
let paymentRequestUrl = call.getString("paymentRequestUrl", "")
|
94
|
+
let callbackUrl = call.getString("callbackUrl", "")
|
95
|
+
if paymentRequestUrl == "" || callbackUrl == "" {
|
96
|
+
call.reject("missing paymentRequestUrl or callbackUrl")
|
97
|
+
return
|
98
|
+
}
|
99
|
+
|
100
|
+
let typeIdentifier = call.getString("typeIdentifier", "hk.com.hkicl");
|
101
|
+
|
102
|
+
let paymentData: [String: Any] = ["URL": paymentRequestUrl, "callback": callbackUrl]
|
103
|
+
// let jsonData = try! JSONSerialization.data(withJSONObject: paymentData, options: [])
|
104
|
+
// let itemProvider = NSItemProvider(item: jsonData as NSSecureCoding, typeIdentifier: typeIdentifier)
|
105
|
+
let itemProvider = NSItemProvider(item: paymentData as NSSecureCoding, typeIdentifier: typeIdentifier)
|
106
|
+
let extensionItem = NSExtensionItem()
|
107
|
+
extensionItem.attachments = [itemProvider]
|
108
|
+
|
109
|
+
// Invoke UIActivityViewController to choose Payment App
|
110
|
+
let activityViewController = UIActivityViewController(activityItems: [extensionItem], applicationActivities: nil)
|
111
|
+
|
112
|
+
activityViewController.completionWithItemsHandler = { (activityType, completed, returnedItems, activityError) in
|
113
|
+
// Start the activity chosen to complete the payment
|
114
|
+
print("Start the activity chosen to complete the payment : \(completed)")
|
115
|
+
if !completed {
|
116
|
+
CorePlugin.HKFPSCall?.keepAlive = false;
|
117
|
+
CorePlugin.HKFPSCall = nil;
|
118
|
+
}
|
119
|
+
}
|
120
|
+
DispatchQueue.main.async {
|
121
|
+
self.bridge?.viewController?.present(activityViewController, animated: true, completion: nil)
|
122
|
+
|
123
|
+
call.keepAlive = true;
|
124
|
+
CorePlugin.HKFPSCall = call;
|
125
|
+
}
|
126
|
+
|
127
|
+
}
|
128
|
+
|
25
129
|
@objc public func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
|
26
130
|
NotificationCenter.default.post(name: .capacitorOpenURL, object: [
|
27
131
|
"url": url,
|
@@ -171,6 +275,7 @@ public class CorePlugin: CAPPlugin {
|
|
171
275
|
let deeplink = call.getObject("deeplink")
|
172
276
|
let externalProtocols = call.getArray("externalProtocols")
|
173
277
|
let addPaddingProtocols = call.getArray("addPaddingProtocols")
|
278
|
+
let excludedUniversalLinks = call.getArray("excludedUniversalLinks")
|
174
279
|
|
175
280
|
let clearCache = call.getBool("clearCache") ?? false
|
176
281
|
aigensDebug = call.getBool("debug") ?? false
|
@@ -197,6 +302,9 @@ public class CorePlugin: CAPPlugin {
|
|
197
302
|
if (addPaddingProtocols != nil) {
|
198
303
|
options["addPaddingProtocols"] = addPaddingProtocols as AnyObject
|
199
304
|
}
|
305
|
+
if (excludedUniversalLinks != nil) {
|
306
|
+
options["excludedUniversalLinks"] = excludedUniversalLinks as AnyObject
|
307
|
+
}
|
200
308
|
|
201
309
|
bridgeVC.options = options;
|
202
310
|
|
@@ -275,6 +383,11 @@ public class CorePlugin: CAPPlugin {
|
|
275
383
|
}
|
276
384
|
|
277
385
|
private func showNewEvent(_ askPermission: Bool, _ call: CAPPluginCall) {
|
386
|
+
|
387
|
+
|
388
|
+
#if DISABLE_ADD_CALENDER
|
389
|
+
call.reject("Please remove (-D DISABLE_ADD_CALENDER from (AigensSdkCore) Build Settings -> Other Swift Flags) first")
|
390
|
+
#else
|
278
391
|
let store = EKEventStore()
|
279
392
|
if askPermission {
|
280
393
|
store.requestAccess(to: .event) { (granted, error) in
|
@@ -304,8 +417,8 @@ public class CorePlugin: CAPPlugin {
|
|
304
417
|
}
|
305
418
|
let isAllDay = call.getBool("isAllDay", false)
|
306
419
|
event.isAllDay = isAllDay
|
307
|
-
// event.availability = .busy
|
308
|
-
// event.structuredLocation = ...
|
420
|
+
// event.availability = .busy
|
421
|
+
// event.structuredLocation = ...
|
309
422
|
if let beginTime = call.getDouble("beginTime") {
|
310
423
|
event.startDate = Date(timeIntervalSince1970: beginTime / 1000)
|
311
424
|
}
|
@@ -322,6 +435,8 @@ public class CorePlugin: CAPPlugin {
|
|
322
435
|
self.bridge?.viewController?.present(vc, animated: true, completion: nil)
|
323
436
|
|
324
437
|
call.resolve(["notPermission": false, "resultCode": 0])
|
438
|
+
#endif
|
439
|
+
|
325
440
|
|
326
441
|
}
|
327
442
|
|
@@ -393,9 +508,13 @@ func aigensprint<T>(_ message:T,file:String = #file,_ funcName:String = #functio
|
|
393
508
|
|
394
509
|
}
|
395
510
|
|
396
|
-
|
511
|
+
#if DISABLE_ADD_CALENDER
|
512
|
+
#else
|
397
513
|
extension CorePlugin: EKEventEditViewDelegate {
|
398
514
|
public func eventEditViewController(_ controller: EKEventEditViewController, didCompleteWith action: EKEventEditViewAction) {
|
399
515
|
controller.dismiss(animated: true)
|
400
516
|
}
|
401
517
|
}
|
518
|
+
#endif
|
519
|
+
|
520
|
+
|
@@ -40,6 +40,11 @@ import Capacitor
|
|
40
40
|
"https://pay.macaupass.com",
|
41
41
|
]
|
42
42
|
|
43
|
+
var excludedUniversalLinks: [String] = [
|
44
|
+
"aigenshkfps=true",
|
45
|
+
"aigenshkfps/true"
|
46
|
+
]
|
47
|
+
|
43
48
|
let containerView = WebContainer.webContainer()
|
44
49
|
var webContainerView: WebContainer {
|
45
50
|
return containerView
|
@@ -132,8 +137,23 @@ import Capacitor
|
|
132
137
|
NotificationCenter.default.addObserver(self, selector: #selector(self.handleUrlOpened(notification:)), name: Notification.Name.capacitorOpenURL, object: nil)
|
133
138
|
}
|
134
139
|
|
140
|
+
private func isExcludedUniversalLink(_ url: String) -> Bool {
|
141
|
+
var result = false
|
142
|
+
|
143
|
+
excludedUniversalLinks.forEach { (url_) in
|
144
|
+
if url.contains(url_) {
|
145
|
+
result = true
|
146
|
+
}
|
147
|
+
}
|
148
|
+
return result
|
149
|
+
}
|
150
|
+
|
135
151
|
private func isParseUrl(_ url: String) -> Bool {
|
136
152
|
|
153
|
+
if isExcludedUniversalLink(url) {
|
154
|
+
return false
|
155
|
+
}
|
156
|
+
|
137
157
|
if url.contains("aigens=true") || url.contains("aigens/true") {
|
138
158
|
return true;
|
139
159
|
}
|
@@ -146,17 +166,8 @@ import Capacitor
|
|
146
166
|
return false;
|
147
167
|
}
|
148
168
|
|
149
|
-
|
150
|
-
|
151
|
-
return
|
152
|
-
}
|
153
|
-
|
154
|
-
aigensprint("handleUrlOpened url:\(object)")
|
155
|
-
guard var url = object["url"] as? URL else {
|
156
|
-
return
|
157
|
-
}
|
158
|
-
|
159
|
-
url = decodeURIComponent(url);
|
169
|
+
private func fromAppUrl(_ url_: URL) {
|
170
|
+
let url = decodeURIComponent(url_);
|
160
171
|
|
161
172
|
|
162
173
|
if !isParseUrl(url.absoluteString) {
|
@@ -166,51 +177,59 @@ import Capacitor
|
|
166
177
|
let rUrl = URLRequest(url: url)
|
167
178
|
|
168
179
|
let newUrl = url;
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
180
|
+
var redirectUrl: String? = nil;
|
181
|
+
if newUrl.absoluteString.range(of: "redirect=") != nil, var redirect = newUrl.absoluteString.components(separatedBy:"redirect=").last, !redirect.isEmpty {
|
182
|
+
if !redirect.starts(with: "http://") && !redirect.starts(with: "https://") {
|
183
|
+
redirect = "https://" + redirect
|
184
|
+
}
|
185
|
+
redirectUrl = redirect;
|
186
|
+
aigensprint("handleUniversalLink has -- redirect:\(redirect)");
|
187
|
+
}else if newUrl.absoluteString.range(of: "aigensRedirect/") != nil, var redirect = newUrl.absoluteString.components(separatedBy:"aigensRedirect/").last, !redirect.isEmpty {
|
188
|
+
if !redirect.starts(with: "http://") && !redirect.starts(with: "https://") {
|
189
|
+
redirect = "https://" + redirect
|
190
|
+
}
|
191
|
+
redirectUrl = redirect;
|
192
|
+
aigensprint("handleUniversalLink has -- aigensRedirect:\(redirect)");
|
193
|
+
}
|
194
|
+
|
195
|
+
if let redirect = redirectUrl, let redirectUrl = URL(string: redirect) {
|
196
|
+
self.redirectLink = redirect
|
175
197
|
webContainerView.showLoading(true)
|
176
198
|
webContainerView.showError(false)
|
199
|
+
let rUrl = URLRequest(url: redirectUrl)
|
200
|
+
webView?.load(rUrl)
|
201
|
+
return;
|
177
202
|
}
|
178
203
|
|
204
|
+
webContainerView.showLoading(true)
|
205
|
+
webContainerView.showError(false)
|
179
206
|
webView?.load(rUrl)
|
180
207
|
}
|
181
208
|
|
182
|
-
@objc func
|
209
|
+
@objc func handleUrlOpened(notification: NSNotification) {
|
183
210
|
guard let object = notification.object as? [String: Any?] else {
|
184
211
|
return
|
185
212
|
}
|
186
213
|
|
187
|
-
aigensprint("
|
214
|
+
aigensprint("handleUrlOpened url:\(object)")
|
188
215
|
guard var url = object["url"] as? URL else {
|
189
216
|
return
|
190
217
|
}
|
191
218
|
|
192
|
-
|
219
|
+
fromAppUrl(url);
|
220
|
+
}
|
193
221
|
|
194
|
-
|
195
|
-
|
222
|
+
@objc func handleUniversalLink(notification: NSNotification) {
|
223
|
+
guard let object = notification.object as? [String: Any?] else {
|
224
|
+
return
|
196
225
|
}
|
197
226
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
let newUrl = url;
|
202
|
-
if newUrl.absoluteString.range(of: "redirect=") != nil, let redirect = newUrl.absoluteString.components(separatedBy:"redirect=").last, !redirect.isEmpty {
|
203
|
-
aigensprint("handleUniversalLink has -- redirect:\(redirect)")
|
204
|
-
webContainerView.showLoading(true)
|
205
|
-
webContainerView.showError(false)
|
206
|
-
}else if newUrl.absoluteString.range(of: "aigensRedirect/") != nil, let redirect = newUrl.absoluteString.components(separatedBy:"aigensRedirect/").last, !redirect.isEmpty {
|
207
|
-
aigensprint("handleUniversalLink has -- aigensRedirect:\(redirect)")
|
208
|
-
webContainerView.showLoading(true)
|
209
|
-
webContainerView.showError(false)
|
227
|
+
aigensprint("handleUniversalLink url:\(object)")
|
228
|
+
guard var url = object["url"] as? URL else {
|
229
|
+
return
|
210
230
|
}
|
211
231
|
|
212
|
-
|
213
|
-
webView?.load(rUrl)
|
232
|
+
fromAppUrl(url);
|
214
233
|
|
215
234
|
}
|
216
235
|
private func initView(){
|
@@ -266,6 +285,10 @@ import Capacitor
|
|
266
285
|
self.addPaddingProtocols.append(contentsOf: addPaddingProtocols)
|
267
286
|
}
|
268
287
|
|
288
|
+
if let excludedUniversalLinks = options?["excludedUniversalLinks"] as? [String] {
|
289
|
+
self.excludedUniversalLinks.append(contentsOf: excludedUniversalLinks)
|
290
|
+
}
|
291
|
+
|
269
292
|
}
|
270
293
|
|
271
294
|
private func decodeURIComponent(_ url: URL) -> URL {
|
@@ -334,7 +357,7 @@ import Capacitor
|
|
334
357
|
var configLoc = Bundle.main.url(forResource: "capacitor.config", withExtension: "json")
|
335
358
|
|
336
359
|
//if config is missing, it's a dynamic page, load config from sdk core
|
337
|
-
if(configLoc == nil){
|
360
|
+
if(wwwLoc == nil || configLoc == nil){
|
338
361
|
configLoc = Bundle(for: WebContainerViewController.self).url(forResource: "capacitor.config", withExtension: "json")
|
339
362
|
|
340
363
|
//www folder will be dynamic, set to anything is ok
|
@@ -342,8 +365,7 @@ import Capacitor
|
|
342
365
|
wwwLoc = FileManager.default.temporaryDirectory
|
343
366
|
}
|
344
367
|
|
345
|
-
|
346
|
-
let descriptor = InstanceDescriptor.init(at: wwwLoc!, configuration: configLoc, cordovaConfiguration: nil)
|
368
|
+
let descriptor = InstanceDescriptor.init(at: wwwLoc ?? FileManager.default.temporaryDirectory, configuration: configLoc, cordovaConfiguration: nil)
|
347
369
|
|
348
370
|
descriptor.appendedUserAgentString = "AigensSDK"
|
349
371
|
|
@@ -397,41 +419,6 @@ extension WebContainerViewController: WKNavigationDelegate {
|
|
397
419
|
}
|
398
420
|
|
399
421
|
aigensprint("navURL--:\(navURL)")
|
400
|
-
if isParseUrl(navURL.absoluteString) {
|
401
|
-
|
402
|
-
if navURL.absoluteString.range(of: "redirect=") != nil, var redirect = navURL.absoluteString.components(separatedBy:"redirect=").last{
|
403
|
-
if !redirect.starts(with: "http://") && !redirect.starts(with: "https://") {
|
404
|
-
redirect = "https://" + redirect
|
405
|
-
}
|
406
|
-
if let redirectUrl = URL(string: redirect) {
|
407
|
-
self.redirectLink = redirect
|
408
|
-
aigensprint("navURL-- redirect:\(redirect)")
|
409
|
-
webContainerView.showLoading(true)
|
410
|
-
webContainerView.showError(false)
|
411
|
-
let rUrl = URLRequest(url: redirectUrl)
|
412
|
-
webView.load(rUrl)
|
413
|
-
decisionHandler(.cancel)
|
414
|
-
return;
|
415
|
-
}
|
416
|
-
}
|
417
|
-
|
418
|
-
if navURL.absoluteString.range(of: "aigensRedirect/") != nil, var redirect = navURL.absoluteString.components(separatedBy:"aigensRedirect/").last, !redirect.isEmpty{
|
419
|
-
if !redirect.starts(with: "http://") && !redirect.starts(with: "https://") {
|
420
|
-
redirect = "https://" + redirect
|
421
|
-
}
|
422
|
-
if let redirectUrl = URL(string: redirect) {
|
423
|
-
self.redirectLink = redirect
|
424
|
-
aigensprint("navURL-- aigensRedirect:\(redirect)")
|
425
|
-
webContainerView.showLoading(true)
|
426
|
-
webContainerView.showError(false)
|
427
|
-
let rUrl = URLRequest(url: redirectUrl)
|
428
|
-
webView.load(rUrl)
|
429
|
-
decisionHandler(.cancel)
|
430
|
-
return;
|
431
|
-
}
|
432
|
-
}
|
433
|
-
|
434
|
-
}
|
435
422
|
|
436
423
|
var isCanOpen = false
|
437
424
|
if externalProtocols.count > 0 {
|
@@ -453,6 +440,43 @@ extension WebContainerViewController: WKNavigationDelegate {
|
|
453
440
|
return;
|
454
441
|
}
|
455
442
|
|
443
|
+
// if isParseUrl(navURL.absoluteString) {
|
444
|
+
//
|
445
|
+
// if navURL.absoluteString.range(of: "redirect=") != nil, var redirect = navURL.absoluteString.components(separatedBy:"redirect=").last{
|
446
|
+
// if !redirect.starts(with: "http://") && !redirect.starts(with: "https://") {
|
447
|
+
// redirect = "https://" + redirect
|
448
|
+
// }
|
449
|
+
// if let redirectUrl = URL(string: redirect) {
|
450
|
+
// self.redirectLink = redirect
|
451
|
+
// aigensprint("navURL-- redirect:\(redirect)")
|
452
|
+
// webContainerView.showLoading(true)
|
453
|
+
// webContainerView.showError(false)
|
454
|
+
// let rUrl = URLRequest(url: redirectUrl)
|
455
|
+
// webView.load(rUrl)
|
456
|
+
// decisionHandler(.cancel)
|
457
|
+
// return;
|
458
|
+
// }
|
459
|
+
// }
|
460
|
+
//
|
461
|
+
// if navURL.absoluteString.range(of: "aigensRedirect/") != nil, var redirect = navURL.absoluteString.components(separatedBy:"aigensRedirect/").last, !redirect.isEmpty{
|
462
|
+
// if !redirect.starts(with: "http://") && !redirect.starts(with: "https://") {
|
463
|
+
// redirect = "https://" + redirect
|
464
|
+
// }
|
465
|
+
// if let redirectUrl = URL(string: redirect) {
|
466
|
+
// self.redirectLink = redirect
|
467
|
+
// aigensprint("navURL-- aigensRedirect:\(redirect)")
|
468
|
+
// webContainerView.showLoading(true)
|
469
|
+
// webContainerView.showError(false)
|
470
|
+
// let rUrl = URLRequest(url: redirectUrl)
|
471
|
+
// webView.load(rUrl)
|
472
|
+
// decisionHandler(.cancel)
|
473
|
+
// return;
|
474
|
+
// }
|
475
|
+
// }
|
476
|
+
//
|
477
|
+
// }
|
478
|
+
|
479
|
+
|
456
480
|
|
457
481
|
// first, give plugins the chance to handle the decision
|
458
482
|
// for pluginObject in bridge.plugins {
|