@aigens/aigens-sdk-core 0.0.1 → 0.0.5
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/{CapacitorCommunityAigensCore.podspec → AigensAigensSdkCore.podspec} +1 -1
- package/README.md +32 -0
- package/android/build.gradle +4 -0
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/aigens/sdk/WebContainerActivity.java +199 -10
- package/android/src/main/java/com/aigens/sdk/plugins/CorePlugin.java +153 -1
- package/android/src/main/res/layout/sdk_layout_main.xml +55 -0
- package/dist/docs.json +32 -0
- package/dist/esm/definitions.d.ts +2 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +2 -0
- package/dist/esm/web.js +12 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +12 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +12 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/CorePlugin.m +4 -0
- package/ios/Plugin/CorePlugin.swift +716 -2
- package/ios/Plugin/WebContainerViewController.swift +76 -0
- package/package.json +2 -2
- package/android/src/main/java/com/aigens/sdk/plugins/Core.java +0 -11
@@ -0,0 +1,76 @@
|
|
1
|
+
//
|
2
|
+
// WebContainerViewController.swift
|
3
|
+
// AigensAigensSdkCore
|
4
|
+
//
|
5
|
+
// Created by Peter Liu on 5/3/2022.
|
6
|
+
//
|
7
|
+
import UIKit;
|
8
|
+
import Foundation
|
9
|
+
import Capacitor
|
10
|
+
|
11
|
+
|
12
|
+
@objc open class WebContainerViewController: CAPBridgeViewController {
|
13
|
+
|
14
|
+
public var options: Dictionary<String, Any>?
|
15
|
+
|
16
|
+
override open func viewDidLoad() {
|
17
|
+
|
18
|
+
print("WebContainerViewController viewDidLoad")
|
19
|
+
|
20
|
+
self.becomeFirstResponder()
|
21
|
+
loadWebViewCustom()
|
22
|
+
//loadWebView()
|
23
|
+
}
|
24
|
+
|
25
|
+
//this method overwrite parent to return a desc with custom config.json
|
26
|
+
override open func instanceDescriptor() -> InstanceDescriptor {
|
27
|
+
|
28
|
+
//print("WebContainerViewController custom instanceDescriptor")
|
29
|
+
|
30
|
+
//let configLoc = Bundle.main.url(forResource: "capacitor.config", withExtension: "json")
|
31
|
+
|
32
|
+
//default config paths
|
33
|
+
var wwwLoc = Bundle.main.url(forResource: "public", withExtension: nil)
|
34
|
+
var configLoc = Bundle.main.url(forResource: "capacitor.config", withExtension: "json")
|
35
|
+
|
36
|
+
//if config is missing, it's a dynamic page, load config from sdk core
|
37
|
+
if(configLoc == nil){
|
38
|
+
configLoc = Bundle(for: WebContainerViewController.self).url(forResource: "capacitor.config", withExtension: "json")
|
39
|
+
|
40
|
+
//www folder will be dynamic, set to anything is ok
|
41
|
+
//wwwLoc = configLoc
|
42
|
+
wwwLoc = FileManager.default.temporaryDirectory
|
43
|
+
}
|
44
|
+
|
45
|
+
|
46
|
+
let descriptor = InstanceDescriptor.init(at: wwwLoc!, configuration: configLoc, cordovaConfiguration: nil)
|
47
|
+
|
48
|
+
|
49
|
+
return descriptor
|
50
|
+
}
|
51
|
+
|
52
|
+
public final func loadWebViewCustom() {
|
53
|
+
|
54
|
+
//let bridge = self.bridge
|
55
|
+
//let plugins = self.bridge["plugins"]
|
56
|
+
|
57
|
+
|
58
|
+
let urlString = self.options?["url"] as? String;
|
59
|
+
|
60
|
+
if(urlString == nil){
|
61
|
+
return;
|
62
|
+
}
|
63
|
+
|
64
|
+
let url = URL(string: urlString!)
|
65
|
+
|
66
|
+
let member = self.options?["member"] as? Dictionary<String, Any>
|
67
|
+
|
68
|
+
CorePlugin.member = member
|
69
|
+
|
70
|
+
|
71
|
+
//bridge.webViewDelegationHandler.willLoadWebview(webView)
|
72
|
+
_ = webView?.load(URLRequest(url: url!))
|
73
|
+
|
74
|
+
|
75
|
+
}
|
76
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@aigens/aigens-sdk-core",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.5",
|
4
4
|
"description": "Aigens Order.Place Core Plugin",
|
5
5
|
"main": "dist/plugin.cjs.js",
|
6
6
|
"module": "dist/esm/index.js",
|
@@ -11,7 +11,7 @@
|
|
11
11
|
"android/build.gradle",
|
12
12
|
"dist/",
|
13
13
|
"ios/Plugin/",
|
14
|
-
"
|
14
|
+
"AigensAigensSdkCore.podspec"
|
15
15
|
],
|
16
16
|
"author": "Aigens",
|
17
17
|
"license": "MIT",
|