@aigens/aigens-sdk-core 0.0.25 → 0.0.27
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 +17 -2
- package/android/src/main/java/com/aigens/sdk/plugins/CorePlugin.java +16 -0
- package/dist/docs.json +55 -1
- package/dist/esm/definitions.d.ts +5 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +2 -1
- package/dist/esm/web.js +3 -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 +39 -5
- package/ios/Plugin/WebContainer.swift +10 -10
- package/ios/Plugin/WebContainerViewController.swift +36 -29
- package/package.json +1 -1
package/README.md
CHANGED
@@ -22,7 +22,9 @@ npx cap sync
|
|
22
22
|
* [`isInstalledApp(...)`](#isinstalledapp)
|
23
23
|
* [`getIsProductionEnvironment()`](#getisproductionenvironment)
|
24
24
|
* [`openExternalUrl(...)`](#openexternalurl)
|
25
|
+
* [`checkNotificationPermissions()`](#checknotificationpermissions)
|
25
26
|
* [Interfaces](#interfaces)
|
27
|
+
* [Type Aliases](#type-aliases)
|
26
28
|
|
27
29
|
</docgen-index>
|
28
30
|
|
@@ -160,6 +162,17 @@ openExternalUrl(options: { url: string; }) => Promise<any>
|
|
160
162
|
--------------------
|
161
163
|
|
162
164
|
|
165
|
+
### checkNotificationPermissions()
|
166
|
+
|
167
|
+
```typescript
|
168
|
+
checkNotificationPermissions() => Promise<PermissionStatus>
|
169
|
+
```
|
170
|
+
|
171
|
+
**Returns:** <code>Promise<<a href="#permissionstatus">PermissionStatus</a>></code>
|
172
|
+
|
173
|
+
--------------------
|
174
|
+
|
175
|
+
|
163
176
|
### Interfaces
|
164
177
|
|
165
178
|
|
@@ -188,4 +201,19 @@ openExternalUrl(options: { url: string; }) => Promise<any>
|
|
188
201
|
| **`"addDiscountCode"`** | <code>string</code> |
|
189
202
|
| **`"addOfferId"`** | <code>string</code> |
|
190
203
|
|
204
|
+
|
205
|
+
#### PermissionStatus
|
206
|
+
|
207
|
+
| Prop | Type |
|
208
|
+
| ------------- | ----------------------------------------------------------- |
|
209
|
+
| **`display`** | <code><a href="#permissionstate">PermissionState</a></code> |
|
210
|
+
|
211
|
+
|
212
|
+
### Type Aliases
|
213
|
+
|
214
|
+
|
215
|
+
#### PermissionState
|
216
|
+
|
217
|
+
<code>'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'</code>
|
218
|
+
|
191
219
|
</docgen-api>
|
@@ -17,6 +17,7 @@ import android.webkit.ServiceWorkerController;
|
|
17
17
|
import android.webkit.ValueCallback;
|
18
18
|
import android.webkit.WebResourceRequest;
|
19
19
|
import android.webkit.WebResourceResponse;
|
20
|
+
import android.webkit.WebSettings;
|
20
21
|
import android.webkit.WebView;
|
21
22
|
import android.widget.Button;
|
22
23
|
|
@@ -49,6 +50,7 @@ import java.util.Map;
|
|
49
50
|
|
50
51
|
public class WebContainerActivity extends BridgeActivity {
|
51
52
|
|
53
|
+
private boolean isFirstError = true;
|
52
54
|
static Bundle perviousInstanceState;
|
53
55
|
static Intent perviousIntent;
|
54
56
|
private boolean DEBUG = CorePlugin.DEBUG;
|
@@ -233,11 +235,19 @@ public class WebContainerActivity extends BridgeActivity {
|
|
233
235
|
wvc.activity = this;
|
234
236
|
wvc.externalProtocols = this.externalProtocols;
|
235
237
|
this.bridge.getWebView().setWebViewClient(wvc);
|
236
|
-
|
238
|
+
if (DEBUG) {
|
239
|
+
this.bridge.getWebView().setWebContentsDebuggingEnabled(true);
|
240
|
+
}else {
|
241
|
+
this.bridge.getWebView().setWebContentsDebuggingEnabled(false);
|
242
|
+
}
|
237
243
|
|
244
|
+
// disable zoom
|
238
245
|
this.bridge.getWebView().getSettings().setUseWideViewPort(true);
|
239
246
|
this.bridge.getWebView().getSettings().setLoadWithOverviewMode(true);
|
240
247
|
|
248
|
+
// set http & https mixed
|
249
|
+
this.bridge.getWebView().getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
250
|
+
|
241
251
|
if (clearCache) {
|
242
252
|
this.bridge.getWebView().clearCache(true);
|
243
253
|
}
|
@@ -675,7 +685,12 @@ public class WebContainerActivity extends BridgeActivity {
|
|
675
685
|
@Override
|
676
686
|
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
|
677
687
|
debug("onReceivedErrorOld", errorCode, description, failingUrl);
|
678
|
-
|
688
|
+
System.out.println("onReceivedErrorOld:"+description+failingUrl);
|
689
|
+
if (isFirstError) { // reload
|
690
|
+
isFirstError = false;
|
691
|
+
reload();
|
692
|
+
return;
|
693
|
+
}
|
679
694
|
initLayout(false, true, true);
|
680
695
|
}
|
681
696
|
|
@@ -9,6 +9,7 @@ import android.os.Parcelable;
|
|
9
9
|
|
10
10
|
import androidx.activity.result.ActivityResultLauncher;
|
11
11
|
import androidx.appcompat.app.AppCompatActivity;
|
12
|
+
import androidx.core.app.NotificationManagerCompat;
|
12
13
|
|
13
14
|
import com.aigens.sdk.WebContainerActivity;
|
14
15
|
import com.getcapacitor.JSArray;
|
@@ -133,6 +134,7 @@ public class CorePlugin extends Plugin {
|
|
133
134
|
boolean clearCache = call.getBoolean("clearCache", false);
|
134
135
|
boolean ENVIRONMENT_PRODUCTION = call.getBoolean("ENVIRONMENT_PRODUCTION", true);
|
135
136
|
CorePlugin.setENVIRONMENT_PRODUCTION(ENVIRONMENT_PRODUCTION);
|
137
|
+
CorePlugin.DEBUG = call.getBoolean("debug", false);
|
136
138
|
|
137
139
|
Map memMap = new HashMap();
|
138
140
|
Map deeplinkMap = new HashMap();
|
@@ -239,4 +241,18 @@ public class CorePlugin extends Plugin {
|
|
239
241
|
}
|
240
242
|
}
|
241
243
|
|
244
|
+
@PluginMethod
|
245
|
+
public void checkNotificationPermissions(PluginCall call) {
|
246
|
+
NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(getContext());
|
247
|
+
boolean areNotificationsEnabled = notificationManagerCompat.areNotificationsEnabled();
|
248
|
+
JSObject object = new JSObject();
|
249
|
+
try {
|
250
|
+
object.put("display", "granted");
|
251
|
+
} catch (Exception e) {
|
252
|
+
object.put("display", "denied");
|
253
|
+
e.printStackTrace();
|
254
|
+
}
|
255
|
+
call.resolve(object);
|
256
|
+
}
|
257
|
+
|
242
258
|
}
|
package/dist/docs.json
CHANGED
@@ -146,6 +146,18 @@
|
|
146
146
|
"docs": "",
|
147
147
|
"complexTypes": [],
|
148
148
|
"slug": "openexternalurl"
|
149
|
+
},
|
150
|
+
{
|
151
|
+
"name": "checkNotificationPermissions",
|
152
|
+
"signature": "() => Promise<PermissionStatus>",
|
153
|
+
"parameters": [],
|
154
|
+
"returns": "Promise<PermissionStatus>",
|
155
|
+
"tags": [],
|
156
|
+
"docs": "",
|
157
|
+
"complexTypes": [
|
158
|
+
"PermissionStatus"
|
159
|
+
],
|
160
|
+
"slug": "checknotificationpermissions"
|
149
161
|
}
|
150
162
|
],
|
151
163
|
"properties": []
|
@@ -266,9 +278,51 @@
|
|
266
278
|
"type": "string | undefined"
|
267
279
|
}
|
268
280
|
]
|
281
|
+
},
|
282
|
+
{
|
283
|
+
"name": "PermissionStatus",
|
284
|
+
"slug": "permissionstatus",
|
285
|
+
"docs": "",
|
286
|
+
"tags": [],
|
287
|
+
"methods": [],
|
288
|
+
"properties": [
|
289
|
+
{
|
290
|
+
"name": "display",
|
291
|
+
"tags": [],
|
292
|
+
"docs": "",
|
293
|
+
"complexTypes": [
|
294
|
+
"PermissionState"
|
295
|
+
],
|
296
|
+
"type": "PermissionState"
|
297
|
+
}
|
298
|
+
]
|
269
299
|
}
|
270
300
|
],
|
271
301
|
"enums": [],
|
272
|
-
"typeAliases": [
|
302
|
+
"typeAliases": [
|
303
|
+
{
|
304
|
+
"name": "PermissionState",
|
305
|
+
"slug": "permissionstate",
|
306
|
+
"docs": "",
|
307
|
+
"types": [
|
308
|
+
{
|
309
|
+
"text": "'prompt'",
|
310
|
+
"complexTypes": []
|
311
|
+
},
|
312
|
+
{
|
313
|
+
"text": "'prompt-with-rationale'",
|
314
|
+
"complexTypes": []
|
315
|
+
},
|
316
|
+
{
|
317
|
+
"text": "'granted'",
|
318
|
+
"complexTypes": []
|
319
|
+
},
|
320
|
+
{
|
321
|
+
"text": "'denied'",
|
322
|
+
"complexTypes": []
|
323
|
+
}
|
324
|
+
]
|
325
|
+
}
|
326
|
+
],
|
273
327
|
"pluginConfigs": []
|
274
328
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import type { PermissionState } from '@capacitor/core';
|
1
2
|
export interface CorePlugin {
|
2
3
|
echo(options: any): Promise<any>;
|
3
4
|
dismiss(options: any): Promise<any>;
|
@@ -20,6 +21,7 @@ export interface CorePlugin {
|
|
20
21
|
openExternalUrl(options: {
|
21
22
|
url: string;
|
22
23
|
}): Promise<any>;
|
24
|
+
checkNotificationPermissions(): Promise<PermissionStatus>;
|
23
25
|
}
|
24
26
|
export interface Member {
|
25
27
|
"memberCode"?: string;
|
@@ -39,3 +41,6 @@ export interface Deeplink {
|
|
39
41
|
"addDiscountCode"?: string;
|
40
42
|
"addOfferId"?: string;
|
41
43
|
}
|
44
|
+
export interface PermissionStatus {
|
45
|
+
display: PermissionState;
|
46
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["
|
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: any): 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\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 { CorePlugin, Deeplink, Member } from './definitions';
|
2
|
+
import type { CorePlugin, Deeplink, 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<{
|
@@ -22,4 +22,5 @@ export declare class CoreWeb extends WebPlugin implements CorePlugin {
|
|
22
22
|
getIsProductionEnvironment(): Promise<{
|
23
23
|
isPrd: boolean;
|
24
24
|
}>;
|
25
|
+
checkNotificationPermissions(): Promise<PermissionStatus>;
|
25
26
|
}
|
package/dist/esm/web.js
CHANGED
@@ -45,5 +45,8 @@ export class CoreWeb extends WebPlugin {
|
|
45
45
|
async getIsProductionEnvironment() {
|
46
46
|
return { isPrd: true };
|
47
47
|
}
|
48
|
+
async checkNotificationPermissions() {
|
49
|
+
throw new Error('checkNotificationPermissions not supported in browser.');
|
50
|
+
}
|
48
51
|
}
|
49
52
|
//# sourceMappingURL=web.js.map
|
package/dist/esm/web.js.map
CHAN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AAC;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, Deeplink, Member } 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: 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"]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AAI,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;IAED,KAAK,CAAC,4BAA4B;QAC9B,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC9E,CAAC;CAGJ","sourcesContent":["import { WebPlugin } from '@capacitor/core';\nimport type { CorePlugin, Deeplink, 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: 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 async checkNotificationPermissions(): Promise<PermissionStatus> {\n throw new Error('checkNotificationPermissions not supported in browser.');\n }\n\n\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
@@ -54,6 +54,9 @@ class CoreWeb extends core.WebPlugin {
|
|
54
54
|
async getIsProductionEnvironment() {
|
55
55
|
return { isPrd: true };
|
56
56
|
}
|
57
|
+
async checkNotificationPermissions() {
|
58
|
+
throw new Error('checkNotificationPermissions not supported in browser.');
|
59
|
+
}
|
57
60
|
}
|
58
61
|
|
59
62
|
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 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,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;AAC9I,QAAQ,OAAO,MAAM,CAAC;AACtB,KAAK;AACL,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;AAC/B,QAAQ,IAAI,EAAE,EAAE,EAAE,CAAC;AACnB,QAAQ,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;AAC7C,QAAQ,IAAI,MAAM,GAA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AA0B,GAAG;AACvC,QAAQ,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC/B,KAAK;AACL;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Core = registerPlugin('Core', {\n web: () => import('./web').then(m => new m.CoreWeb()),\n});\nexport * from './definitions';\nexport { Core };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CoreWeb extends WebPlugin {\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async getMember(options) {\n var _a, _b;\n console.log('GET MEMBER', options);\n var result = {};\n var w = window;\n result.member = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.member;\n return result;\n }\n async getDeeplink(options) {\n var _a, _b;\n console.log('GET Deeplink', options);\n var result = {};\n var w = window;\n result.deeplink = (_b = (_a = w.aigens) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.deeplink;\n return result;\n }\n async dismiss(options) {\n console.log('DISMISS', options);\n return options;\n }\n async finish(options) {\n console.log('FINISH', options);\n return options;\n }\n async openBrowser(options) {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n async isInstalledApp(options) {\n console.log(options);\n throw new Error('Method not implemented.');\n }\n async openExternalUrl(options) {\n window.open(options.url, \"_blank\");\n return {\n open: true\n };\n }\n async getIsProductionEnvironment() {\n return { isPrd: true };\n }\n async checkNotificationPermissions() {\n throw new Error('checkNotificationPermissions not supported in browser.');\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,MAA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
53
|
}
|
54
|
+
async checkNotificationPermissions() {
|
55
|
+
throw new Error('checkNotificationPermissions not supported in browser.');
|
56
|
+
}
|
54
57
|
}
|
55
58
|
|
56
59
|
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 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,CAA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,GAAG,EAAE,CAAC,QAAQ,CAAC;IAClJ,QAAQ,OAAO,MAAM,CAAC;IACtB,KAAK;IACL,IAAI,MAAM,OAAO,CAAC,OAAO,EAAE;IAC3B,QAAQ,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACxC,QAAQ,OAAO,OAAO,CAAC;IACvB,KAAK;IACL,IAAI,MAAM,MAAM,CAAC,OAAO,EAAE;IAC1B,QAAQ,OAAO,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;;;;;;;;;;;;;;;;;"}
|
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}\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,GA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AAE,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,IAAI,MAAM,4BAA4B,GAAG;IACzC,QAAQ,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAClF,KAAK;IACL;;;;;;;;;;;;;;;;;"}
|
package/ios/Plugin/CorePlugin.m
CHANGED
@@ -13,4 +13,5 @@ CAP_PLUGIN(CorePlugin, "Core",
|
|
13
13
|
CAP_PLUGIN_METHOD(isInstalledApp, CAPPluginReturnPromise);
|
14
14
|
CAP_PLUGIN_METHOD(openExternalUrl, CAPPluginReturnPromise);
|
15
15
|
CAP_PLUGIN_METHOD(getIsProductionEnvironment, CAPPluginReturnPromise);
|
16
|
+
CAP_PLUGIN_METHOD(checkNotificationPermissions, CAPPluginReturnPromise);
|
16
17
|
)
|
@@ -2,6 +2,8 @@ import Foundation
|
|
2
2
|
import Capacitor
|
3
3
|
import UIKit
|
4
4
|
|
5
|
+
|
6
|
+
var aigensDebug = false;
|
5
7
|
/**
|
6
8
|
* Please read the Capacitor iOS Plugin Development Guide
|
7
9
|
* here: https://capacitorjs.com/docs/plugins/ios
|
@@ -60,7 +62,7 @@ public class CorePlugin: CAPPlugin {
|
|
60
62
|
let dateFrom = Date(timeIntervalSince1970: 0)
|
61
63
|
if let websiteDataTypes = websiteDataTypes as? Set<String> {
|
62
64
|
WKWebsiteDataStore.default().removeData(ofTypes: websiteDataTypes, modifiedSince: dateFrom, completionHandler: {
|
63
|
-
|
65
|
+
aigensprint("removeData completionHandler");
|
64
66
|
})
|
65
67
|
}
|
66
68
|
} else {
|
@@ -73,7 +75,7 @@ public class CorePlugin: CAPPlugin {
|
|
73
75
|
|
74
76
|
@objc func echo(_ call: CAPPluginCall) {
|
75
77
|
|
76
|
-
|
78
|
+
aigensprint("CorePlugin echo")
|
77
79
|
|
78
80
|
let value = call.getString("value") ?? ""
|
79
81
|
call.resolve([
|
@@ -85,7 +87,7 @@ public class CorePlugin: CAPPlugin {
|
|
85
87
|
|
86
88
|
@objc func dismiss(_ call: CAPPluginCall) {
|
87
89
|
|
88
|
-
|
90
|
+
aigensprint("CorePlugin dismiss")
|
89
91
|
|
90
92
|
DispatchQueue.main.async {
|
91
93
|
self.bridge?.viewController?.dismiss(animated: true);
|
@@ -116,7 +118,7 @@ public class CorePlugin: CAPPlugin {
|
|
116
118
|
|
117
119
|
@objc func finish(_ call: CAPPluginCall) {
|
118
120
|
|
119
|
-
|
121
|
+
aigensprint("CorePlugin finish")
|
120
122
|
|
121
123
|
DispatchQueue.main.async {
|
122
124
|
self.bridge?.viewController?.dismiss(animated: true);
|
@@ -133,7 +135,7 @@ public class CorePlugin: CAPPlugin {
|
|
133
135
|
|
134
136
|
@objc func openBrowser(_ call: CAPPluginCall) {
|
135
137
|
|
136
|
-
|
138
|
+
aigensprint("CorePlugin openBrowser")
|
137
139
|
|
138
140
|
let url = call.getString("url")
|
139
141
|
|
@@ -146,6 +148,7 @@ public class CorePlugin: CAPPlugin {
|
|
146
148
|
let deeplink = call.getObject("deeplink")
|
147
149
|
let externalProtocols = call.getArray("externalProtocols")
|
148
150
|
let clearCache = call.getBool("clearCache") ?? false
|
151
|
+
aigensDebug = call.getBool("debug") ?? false
|
149
152
|
|
150
153
|
DispatchQueue.main.async {
|
151
154
|
|
@@ -224,6 +227,26 @@ public class CorePlugin: CAPPlugin {
|
|
224
227
|
return
|
225
228
|
}
|
226
229
|
}
|
230
|
+
@objc func checkNotificationPermissions(_ call: CAPPluginCall) {
|
231
|
+
let center = UNUserNotificationCenter.current()
|
232
|
+
center.getNotificationSettings { settings in
|
233
|
+
let status = settings.authorizationStatus
|
234
|
+
let permission: String
|
235
|
+
switch status {
|
236
|
+
case .authorized, .ephemeral, .provisional:
|
237
|
+
permission = "granted"
|
238
|
+
case .denied:
|
239
|
+
permission = "denied"
|
240
|
+
case .notDetermined:
|
241
|
+
permission = "prompt"
|
242
|
+
@unknown default:
|
243
|
+
permission = "prompt"
|
244
|
+
}
|
245
|
+
|
246
|
+
call.resolve(["display": permission])
|
247
|
+
|
248
|
+
}
|
249
|
+
}
|
227
250
|
|
228
251
|
|
229
252
|
|
@@ -247,4 +270,15 @@ public class CorePlugin: CAPPlugin {
|
|
247
270
|
|
248
271
|
|
249
272
|
|
273
|
+
}
|
274
|
+
|
275
|
+
|
276
|
+
///全局函数
|
277
|
+
func aigensprint<T>(_ message:T,file:String = #file,_ funcName:String = #function,_ lineNum:Int = #line){
|
278
|
+
|
279
|
+
if aigensDebug {
|
280
|
+
let file = (file as NSString).lastPathComponent;
|
281
|
+
print("\(file):(\(lineNum))--:\(message)");
|
282
|
+
}
|
283
|
+
|
250
284
|
}
|
@@ -9,13 +9,13 @@ import UIKit
|
|
9
9
|
|
10
10
|
class WebContainer: UIView {
|
11
11
|
@IBOutlet weak var activity: UIActivityIndicatorView!
|
12
|
-
|
12
|
+
|
13
13
|
@IBOutlet weak var errorWrapper: UIView!
|
14
|
-
|
14
|
+
|
15
15
|
@IBOutlet weak var errorTextView: UITextView!
|
16
|
-
|
16
|
+
|
17
17
|
public weak var vc: WebContainerViewController?
|
18
|
-
|
18
|
+
|
19
19
|
public func setTheme(_ color: String) {
|
20
20
|
if let color = UIColor.getHex(hex: color) {
|
21
21
|
self.backgroundColor = color
|
@@ -23,16 +23,16 @@ class WebContainer: UIView {
|
|
23
23
|
}
|
24
24
|
override func awakeFromNib() {
|
25
25
|
super.awakeFromNib()
|
26
|
-
|
26
|
+
aigensprint("awakeFromNib")
|
27
27
|
}
|
28
|
-
|
28
|
+
|
29
29
|
private func hiddenSelf() {
|
30
30
|
self.alpha = 1.0
|
31
31
|
UIView.animate(withDuration: 0.5, animations: {
|
32
32
|
self.alpha = 0
|
33
33
|
})
|
34
34
|
}
|
35
|
-
|
35
|
+
|
36
36
|
public func showLoading(_ show: Bool) {
|
37
37
|
if show {
|
38
38
|
self.alpha = 1.0
|
@@ -56,9 +56,9 @@ class WebContainer: UIView {
|
|
56
56
|
errorWrapper?.isHidden = true
|
57
57
|
self.alpha = 0
|
58
58
|
}
|
59
|
-
|
59
|
+
|
60
60
|
}
|
61
|
-
|
61
|
+
|
62
62
|
/*
|
63
63
|
// Only override draw() if you perform custom drawing.
|
64
64
|
// An empty implementation adversely affects performance during animation.
|
@@ -69,7 +69,7 @@ class WebContainer: UIView {
|
|
69
69
|
@IBAction func dismiss(_ sender: UIButton) {
|
70
70
|
self.vc?.dismiss(animated: true);
|
71
71
|
}
|
72
|
-
|
72
|
+
|
73
73
|
@IBAction func reload(_ sender: UIButton) {
|
74
74
|
self.vc?.webView?.reload()
|
75
75
|
}
|
@@ -13,7 +13,7 @@ import Capacitor
|
|
13
13
|
|
14
14
|
// {themeColor: "#xxxxxx"}
|
15
15
|
public var options: Dictionary<String, Any>?
|
16
|
-
|
16
|
+
private var isFirstError = true
|
17
17
|
private var redirectLink = ""
|
18
18
|
private var universalLink = ""
|
19
19
|
var externalProtocols: [String] = [
|
@@ -25,7 +25,7 @@ import Capacitor
|
|
25
25
|
}
|
26
26
|
override open func viewDidLoad() {
|
27
27
|
|
28
|
-
|
28
|
+
aigensprint("WebContainerViewController viewDidLoad")
|
29
29
|
|
30
30
|
self.becomeFirstResponder()
|
31
31
|
loadWebViewCustom()
|
@@ -46,7 +46,7 @@ import Capacitor
|
|
46
46
|
return
|
47
47
|
}
|
48
48
|
|
49
|
-
|
49
|
+
aigensprint("handleUrlOpened url:\(object)")
|
50
50
|
guard let url = object["url"] as? URL else {
|
51
51
|
return
|
52
52
|
}
|
@@ -64,7 +64,7 @@ import Capacitor
|
|
64
64
|
return
|
65
65
|
}
|
66
66
|
|
67
|
-
|
67
|
+
aigensprint("handleUniversalLink url:\(object)")
|
68
68
|
guard let url = object["url"] as? URL else {
|
69
69
|
return
|
70
70
|
}
|
@@ -80,7 +80,7 @@ import Capacitor
|
|
80
80
|
}
|
81
81
|
private func initView(){
|
82
82
|
|
83
|
-
|
83
|
+
aigensprint("VC initView")
|
84
84
|
|
85
85
|
//let bundle = Bundle(for: WebContainerViewController.self)
|
86
86
|
//let containerView = WebContainerView()
|
@@ -185,7 +185,7 @@ import Capacitor
|
|
185
185
|
}
|
186
186
|
|
187
187
|
deinit {
|
188
|
-
|
188
|
+
aigensprint("WebContainerViewController deinit")
|
189
189
|
NotificationCenter.default.removeObserver(self)
|
190
190
|
}
|
191
191
|
|
@@ -217,13 +217,13 @@ extension WebContainerViewController: WKNavigationDelegate {
|
|
217
217
|
return
|
218
218
|
}
|
219
219
|
|
220
|
-
|
220
|
+
aigensprint("navURL--:\(navURL)")
|
221
221
|
|
222
222
|
if !universalLink.isEmpty && navURL.absoluteString.starts(with: universalLink) {
|
223
223
|
|
224
224
|
if navURL.absoluteString.range(of: "redirect=") != nil, let redirect = navURL.absoluteString.components(separatedBy:"redirect=").last, let redirectUrl = URL(string: redirect) {
|
225
225
|
self.redirectLink = redirect
|
226
|
-
|
226
|
+
aigensprint("navURL-- redirect:\(redirect)")
|
227
227
|
webContainerView.showLoading(true)
|
228
228
|
webContainerView.showError(false)
|
229
229
|
let rUrl = URLRequest(url: redirectUrl)
|
@@ -309,37 +309,44 @@ extension WebContainerViewController: WKNavigationDelegate {
|
|
309
309
|
// The force unwrap is part of the protocol declaration, so we should keep it.
|
310
310
|
// swiftlint:disable:next implicitly_unwrapped_optional
|
311
311
|
public func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) {
|
312
|
-
// if case .initialLoad(let isOpaque) = webViewLoadingState {
|
313
|
-
// webView.isOpaque = isOpaque
|
314
|
-
// webViewLoadingState = .subsequentLoad
|
315
|
-
// }
|
316
|
-
webContainerView.showLoading(false)
|
317
|
-
|
318
|
-
webContainerView.showError(true, error.localizedDescription)
|
319
312
|
CAPLog.print("⚡️ WebView failed to load")
|
320
313
|
CAPLog.print("⚡️ Error: " + error.localizedDescription)
|
314
|
+
webContainerView.showLoading(false)
|
315
|
+
|
316
|
+
if isFirstError {
|
317
|
+
CAPLog.print("⚡️ WebView failed didFail reload")
|
318
|
+
isFirstError = false
|
319
|
+
// reload
|
320
|
+
webView.reload()
|
321
|
+
return;
|
322
|
+
}
|
323
|
+
|
324
|
+
let e = error as NSError
|
325
|
+
if (e.code == NSURLErrorCancelled || e.code == -999) {
|
326
|
+
}else {
|
327
|
+
webContainerView.showError(true, error.localizedDescription)
|
328
|
+
}
|
329
|
+
|
321
330
|
}
|
322
331
|
|
323
332
|
// // The force unwrap is part of the protocol declaration, so we should keep it.
|
324
333
|
// // swiftlint:disable:next implicitly_unwrapped_optional
|
325
334
|
// public func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) {
|
326
|
-
// webContainerView.showLoading(false)
|
327
|
-
// // cancel
|
328
|
-
// let e = error as NSError
|
329
|
-
// if (e.code == NSURLErrorCancelled || e.code == -999) {
|
330
|
-
// webContainerView.showError(false)
|
331
|
-
// }
|
332
335
|
// CAPLog.print("⚡️ WebView failed provisional navigation")
|
333
336
|
// CAPLog.print("⚡️ Error: " + error.localizedDescription)
|
334
337
|
//
|
335
|
-
//
|
336
|
-
//
|
337
|
-
//
|
338
|
-
//
|
339
|
-
//
|
340
|
-
//
|
341
|
-
//
|
342
|
-
//
|
338
|
+
// webContainerView.showLoading(false)
|
339
|
+
//
|
340
|
+
// if isFirstError {
|
341
|
+
// CAPLog.print("⚡️ WebView failed provisional reload")
|
342
|
+
// isFirstError = false
|
343
|
+
// // reload
|
344
|
+
// webView.reload()
|
345
|
+
// return;
|
346
|
+
// }
|
347
|
+
//
|
348
|
+
// let e = error as NSError
|
349
|
+
// if (e.code == NSURLErrorCancelled || e.code == -999) {
|
343
350
|
// }else {
|
344
351
|
// webContainerView.showError(true, error.localizedDescription)
|
345
352
|
// }
|