@hanwha-ss1/plugin 0.7.0-beta.2 → 0.7.0
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/HanwhaSs1Plugin.podspec +4 -1
- package/android/src/main/java/com/plugin/linker/LinkerPlugin.java +20 -1
- package/dist/esm/definitions.d.ts +6 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +3 -0
- package/dist/esm/web.js +9 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +9 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +9 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/Keyboard/KeyboardMenu.swift +128 -0
- package/ios/Plugin/Keyboard/KeyboardMenuPlugin.swift +50 -0
- package/ios/Plugin/Keyboard/menu-icons.xcassets/Contents.json +6 -0
- package/ios/Plugin/Keyboard/menu-icons.xcassets/collabo-link.imageset/Contents.json +21 -0
- package/ios/Plugin/Keyboard/menu-icons.xcassets/collabo-link.imageset/icon-collabo-link.svg +12 -0
- package/ios/Plugin/Keyboard/menu-icons.xcassets/file.imageset/Contents.json +21 -0
- package/ios/Plugin/Keyboard/menu-icons.xcassets/file.imageset/icon-file.svg +3 -0
- package/ios/Plugin/Keyboard/menu-icons.xcassets/img.imageset/Contents.json +21 -0
- package/ios/Plugin/Keyboard/menu-icons.xcassets/img.imageset/icon-img.svg +3 -0
- package/ios/Plugin/Keyboard/menu-icons.xcassets/todo.imageset/Contents.json +21 -0
- package/ios/Plugin/Keyboard/menu-icons.xcassets/todo.imageset/icon-todo.svg +4 -0
- package/ios/Plugin/Keyboard/menu-icons.xcassets/url-link.imageset/Contents.json +21 -0
- package/ios/Plugin/Keyboard/menu-icons.xcassets/url-link.imageset/icon-url-link.svg +3 -0
- package/ios/Plugin/Plugin.m +7 -0
- package/ios/Plugin/Plugin.swift +190 -4
- package/package.json +1 -1
package/HanwhaSs1Plugin.podspec
CHANGED
|
@@ -10,7 +10,10 @@ Pod::Spec.new do |s|
|
|
|
10
10
|
s.homepage = package['repository']['url']
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
|
|
13
|
-
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp,xib,
|
|
13
|
+
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp,xib,png}'
|
|
14
|
+
s.resource_bundles = {
|
|
15
|
+
'KeyboardMenuIcon' => ['ios/Plugin/Keyboard/*.xcassets']
|
|
16
|
+
}
|
|
14
17
|
s.ios.deployment_target = '12.0'
|
|
15
18
|
s.dependency 'Capacitor'
|
|
16
19
|
s.swift_version = '5.1'
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
package com.plugin.linker;
|
|
2
2
|
|
|
3
|
+
import android.os.Handler;
|
|
4
|
+
import android.os.Looper;
|
|
5
|
+
import android.os.Message;
|
|
6
|
+
|
|
3
7
|
import com.getcapacitor.JSObject;
|
|
4
8
|
import com.getcapacitor.Plugin;
|
|
5
9
|
import com.getcapacitor.PluginCall;
|
|
@@ -11,7 +15,6 @@ import com.plugin.download.FileDownload;
|
|
|
11
15
|
import com.plugin.openbrowser.OpenBrowser;
|
|
12
16
|
import com.plugin.opencamera.OpenCamera;
|
|
13
17
|
|
|
14
|
-
|
|
15
18
|
@CapacitorPlugin(name = "Plugin")
|
|
16
19
|
public class LinkerPlugin extends Plugin{
|
|
17
20
|
private Linker implementation = new Linker();
|
|
@@ -157,4 +160,20 @@ public class LinkerPlugin extends Plugin{
|
|
|
157
160
|
}
|
|
158
161
|
});
|
|
159
162
|
}
|
|
163
|
+
|
|
164
|
+
public void handleDocumentsViewer(String filePath) {
|
|
165
|
+
Handler handler = new Handler(Looper.getMainLooper()) {
|
|
166
|
+
@Override
|
|
167
|
+
public void handleMessage(Message msg) {
|
|
168
|
+
if(hasListeners("DocumentViewer")) {
|
|
169
|
+
JSObject data = new JSObject();
|
|
170
|
+
data.put("file", filePath);
|
|
171
|
+
notifyListeners("DocumentViewer", data);
|
|
172
|
+
} else {
|
|
173
|
+
sendEmptyMessageDelayed(-1, 200);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
handler.sendEmptyMessage(-1);
|
|
178
|
+
}
|
|
160
179
|
}
|
|
@@ -25,6 +25,7 @@ export interface Plugin {
|
|
|
25
25
|
}): Promise<{
|
|
26
26
|
value: string;
|
|
27
27
|
}>;
|
|
28
|
+
getCertificateProvisioning(): Promise<any>;
|
|
28
29
|
/**
|
|
29
30
|
* TouchID, FaceID
|
|
30
31
|
*/
|
|
@@ -87,4 +88,9 @@ export interface Plugin {
|
|
|
87
88
|
}): Promise<{
|
|
88
89
|
value: string;
|
|
89
90
|
}>;
|
|
91
|
+
/**
|
|
92
|
+
* iOS 키보드 메뉴 바
|
|
93
|
+
*/
|
|
94
|
+
addKeyboardMenu(): any;
|
|
95
|
+
removeKeyboardMenu(): any;
|
|
90
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface Plugin {\n /**\n * 앱 실행\n * @param options package : 패키지명\n */\n executeApp(options: {\n package: string;\n }): Promise<{ value: string }>;\n\n /**\n * 연락처 저장\n * @param options name : 성명\n * @param options phone : 전화번호\n * @param options email : 이메일\n * @param options dept : 소속\n * @param options ext : 내선번호\n */\n addContact(options: {\n name: string;\n phone: string;\n email: string;\n dept: string;\n ext: string;\n }): Promise<{ value: string }>;\n\n /**\n * TouchID, FaceID\n */\n auth(): Promise<{ value: string }>;\n\n /**\n * 시스템에 설정된 지역이 서울인지 확인\n */\n checkSeoulTimeZone(): Promise<{ value: string }>;\n\n timezone(): Promise<{ value: string }>;\n\n /**\n *\n * @param options url : \"웹 페이지 주소\"\n * @param options ext : false(내부 웹뷰), true(외부 브라우저)\n */\n open(options: { url: string; ext: boolean; isCloseBtn?: boolean; clear?: boolean }): Promise<{ value: string }>;\n\n /**\n * EdgeSwipe 허용\n * @see default false\n */\n edgeSwipe(options: {on: boolean}): Promise<{ value: string }>;\n\n\n /**\n * 카메라앱 열기\n * @see default false\n */\n openCamera(): Promise<{ value: string }>;\n\n\n /**\n * 파일 다운로드\n * @see default false\n */\n fileDownload(options: {file: string; }): Promise<{ value: string }>;\n\n /**\n * iOS 캡쳐 방지\n * @see default false\n */\n doDisabledCapture(options: {disabled: boolean; }): Promise<{ value: string }>;\n
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface Plugin {\n /**\n * 앱 실행\n * @param options package : 패키지명\n */\n executeApp(options: {\n package: string;\n }): Promise<{ value: string }>;\n\n /**\n * 연락처 저장\n * @param options name : 성명\n * @param options phone : 전화번호\n * @param options email : 이메일\n * @param options dept : 소속\n * @param options ext : 내선번호\n */\n addContact(options: {\n name: string;\n phone: string;\n email: string;\n dept: string;\n ext: string;\n }): Promise<{ value: string }>;\n\n // 인증서 만료일 확인\n getCertificateProvisioning(): Promise<any>;\n /**\n * TouchID, FaceID\n */\n auth(): Promise<{ value: string }>;\n\n /**\n * 시스템에 설정된 지역이 서울인지 확인\n */\n checkSeoulTimeZone(): Promise<{ value: string }>;\n\n timezone(): Promise<{ value: string }>;\n\n /**\n *\n * @param options url : \"웹 페이지 주소\"\n * @param options ext : false(내부 웹뷰), true(외부 브라우저)\n */\n open(options: { url: string; ext: boolean; isCloseBtn?: boolean; clear?: boolean }): Promise<{ value: string }>;\n\n /**\n * EdgeSwipe 허용\n * @see default false\n */\n edgeSwipe(options: {on: boolean}): Promise<{ value: string }>;\n\n\n /**\n * 카메라앱 열기\n * @see default false\n */\n openCamera(): Promise<{ value: string }>;\n\n\n /**\n * 파일 다운로드\n * @see default false\n */\n fileDownload(options: {file: string; }): Promise<{ value: string }>;\n\n /**\n * iOS 캡쳐 방지\n * @see default false\n */\n doDisabledCapture(options: {disabled: boolean; }): Promise<{ value: string }>;\n /**\n * iOS 키보드 메뉴 바\n */\n addKeyboardMenu():any;\n removeKeyboardMenu():any;\n}"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -3,7 +3,10 @@ import type { Plugin } from './definitions';
|
|
|
3
3
|
export declare class PluginWeb extends WebPlugin implements Plugin {
|
|
4
4
|
executeApp(): Promise<any>;
|
|
5
5
|
addContact(): Promise<any>;
|
|
6
|
+
addKeyboardMenu(): any;
|
|
7
|
+
removeKeyboardMenu(): any;
|
|
6
8
|
auth(): Promise<any>;
|
|
9
|
+
getCertificateProvisioning(): Promise<any>;
|
|
7
10
|
checkSeoulTimeZone(): Promise<any>;
|
|
8
11
|
timezone(): Promise<any>;
|
|
9
12
|
open(_options: {
|
package/dist/esm/web.js
CHANGED
|
@@ -7,9 +7,18 @@ export class PluginWeb extends WebPlugin {
|
|
|
7
7
|
async addContact() {
|
|
8
8
|
return { results: {} };
|
|
9
9
|
}
|
|
10
|
+
addKeyboardMenu() {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
removeKeyboardMenu() {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
10
16
|
async auth() {
|
|
11
17
|
return { results: {} };
|
|
12
18
|
}
|
|
19
|
+
async getCertificateProvisioning() {
|
|
20
|
+
return { result: false };
|
|
21
|
+
}
|
|
13
22
|
async checkSeoulTimeZone() {
|
|
14
23
|
return { results: {} };
|
|
15
24
|
}
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAGrD,MAAM,OAAO,SAAU,SAAQ,SAAS;IAEtC,KAAK,CAAC,UAAU;QACd,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC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zB,CAAC;IAED,KAAK,CAAC,UAAU;QACd,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAAyB;QAC1C,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,QAA8B;QACpD,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;YACrC,OAAO,OAAO,CAAC,MAAM,CAAC,6CAA6C,CAAC,CAAC;SACtE;QACD,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACzB,CAAC;CACF","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport {Capacitor, WebPlugin} from '@capacitor/core';\nimport type {Plugin} from './definitions';\n\nexport class PluginWeb extends WebPlugin implements Plugin {\n\n async executeApp(): Promise<any> {\n return { results: {} };\n }\n\n async addContact(): Promise<any> {\n return { results: {} };\n }\n addKeyboardMenu():any {\n return;\n }\n removeKeyboardMenu():any {\n return;\n }\n\n async auth(): Promise<any> {\n return { results: {} };\n }\n async getCertificateProvisioning(): Promise<any> {\n return {result:false};\n }\n async checkSeoulTimeZone(): Promise<any> {\n return { results: {} };\n }\n\n async timezone(): Promise<any> {\n return { results: {} };\n }\n\n async open(_options: { url: string, ext: boolean, isCloseBtn?: boolean; clear?: boolean }): Promise<any> {\n return { results: {} };\n }\n\n async edgeSwipe(_options: { on: boolean }): Promise<any> {\n if (Capacitor.getPlatform() !== 'ios') {\n return Promise.reject('edgeSwipe is only supported on iOS.');\n }\n return { results: {} };\n }\n\n async openCamera(): Promise<any> {\n return { results: {} };\n }\n\n async fileDownload(_options: { file: string}): Promise<any> {\n return { results: {} };\n }\n\n async doDisabledCapture(_options: { disabled: boolean}): Promise<any> {\n if (Capacitor.getPlatform() !== 'ios') {\n return Promise.reject('doDisabledCapture is only supported on iOS.');\n }\n return { results: {} };\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -16,9 +16,18 @@ class PluginWeb extends core.WebPlugin {
|
|
|
16
16
|
async addContact() {
|
|
17
17
|
return { results: {} };
|
|
18
18
|
}
|
|
19
|
+
addKeyboardMenu() {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
removeKeyboardMenu() {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
19
25
|
async auth() {
|
|
20
26
|
return { results: {} };
|
|
21
27
|
}
|
|
28
|
+
async getCertificateProvisioning() {
|
|
29
|
+
return { result: false };
|
|
30
|
+
}
|
|
22
31
|
async checkSeoulTimeZone() {
|
|
23
32
|
return { results: {} };
|
|
24
33
|
}
|
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 HanwhaPlugin = registerPlugin('Plugin', {\n web: () => import('./web').then(m => new m.PluginWeb()),\n});\nexport * from './definitions';\nexport { HanwhaPlugin };\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { Capacitor, WebPlugin } from '@capacitor/core';\nexport class PluginWeb extends WebPlugin {\n async executeApp() {\n return { results: {} };\n }\n async addContact() {\n return { results: {} };\n }\n async auth() {\n return { results: {} };\n }\n async checkSeoulTimeZone() {\n return { results: {} };\n }\n async timezone() {\n return { results: {} };\n }\n async open(_options) {\n return { results: {} };\n }\n async edgeSwipe(_options) {\n if (Capacitor.getPlatform() !== 'ios') {\n return Promise.reject('edgeSwipe is only supported on iOS.');\n }\n return { results: {} };\n }\n async openCamera() {\n return { results: {} };\n }\n async fileDownload(_options) {\n return { results: {} };\n }\n async doDisabledCapture(_options) {\n if (Capacitor.getPlatform() !== 'ios') {\n return Promise.reject('doDisabledCapture is only supported on iOS.');\n }\n return { results: {} };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin","Capacitor"],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AAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAC/B,KAAK;AACL,IAAI,MAAM,iBAAiB,CAAC,QAAQ,EAAE;AACtC,QAAQ,IAAIA,cAAS,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;AAC/C,YAAY,OAAO,OAAO,CAAC,MAAM,CAAC,6CAA6C,CAAC,CAAC;AACjF,SAAS;AACT,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,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 HanwhaPlugin = registerPlugin('Plugin', {\n web: () => import('./web').then(m => new m.PluginWeb()),\n});\nexport * from './definitions';\nexport { HanwhaPlugin };\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { Capacitor, WebPlugin } from '@capacitor/core';\nexport class PluginWeb extends WebPlugin {\n async executeApp() {\n return { results: {} };\n }\n async addContact() {\n return { results: {} };\n }\n addKeyboardMenu() {\n return;\n }\n removeKeyboardMenu() {\n return;\n }\n async auth() {\n return { results: {} };\n }\n async getCertificateProvisioning() {\n return { result: false };\n }\n async checkSeoulTimeZone() {\n return { results: {} };\n }\n async timezone() {\n return { results: {} };\n }\n async open(_options) {\n return { results: {} };\n }\n async edgeSwipe(_options) {\n if (Capacitor.getPlatform() !== 'ios') {\n return Promise.reject('edgeSwipe is only supported on iOS.');\n }\n return { results: {} };\n }\n async openCamera() {\n return { results: {} };\n }\n async fileDownload(_options) {\n return { results: {} };\n }\n async doDisabledCapture(_options) {\n if (Capacitor.getPlatform() !== 'ios') {\n return Promise.reject('doDisabledCapture is only supported on iOS.');\n }\n return { results: {} };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin","Capacitor"],"mappings":";;;;;;AACK,MAAC,YAAY,GAAGA,mBAAc,CAAC,QAAQ,EAA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I,MAAM,UAAU,GAAG;AACvB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAC/B,KAAK;AACL,IAAI,MAAM,YAAY,CAAC,QAAQ,EAAE;AACjC,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAC/B,KAAK;AACL,IAAI,MAAM,iBAAiB,CAAC,QAAQ,EAAE;AACtC,QAAQ,IAAIA,cAAS,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;AAC/C,YAAY,OAAO,OAAO,CAAC,MAAM,CAAC,6CAA6C,CAAC,CAAC;AACjF,SAAS;AACT,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAC/B,KAAK;AACL;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -13,9 +13,18 @@ var capacitorContact = (function (exports, core) {
|
|
|
13
13
|
async addContact() {
|
|
14
14
|
return { results: {} };
|
|
15
15
|
}
|
|
16
|
+
addKeyboardMenu() {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
removeKeyboardMenu() {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
16
22
|
async auth() {
|
|
17
23
|
return { results: {} };
|
|
18
24
|
}
|
|
25
|
+
async getCertificateProvisioning() {
|
|
26
|
+
return { result: false };
|
|
27
|
+
}
|
|
19
28
|
async checkSeoulTimeZone() {
|
|
20
29
|
return { results: {} };
|
|
21
30
|
}
|
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 HanwhaPlugin = registerPlugin('Plugin', {\n web: () => import('./web').then(m => new m.PluginWeb()),\n});\nexport * from './definitions';\nexport { HanwhaPlugin };\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { Capacitor, WebPlugin } from '@capacitor/core';\nexport class PluginWeb extends WebPlugin {\n async executeApp() {\n return { results: {} };\n }\n async addContact() {\n return { results: {} };\n }\n async auth() {\n return { results: {} };\n }\n async checkSeoulTimeZone() {\n return { results: {} };\n }\n async timezone() {\n return { results: {} };\n }\n async open(_options) {\n return { results: {} };\n }\n async edgeSwipe(_options) {\n if (Capacitor.getPlatform() !== 'ios') {\n return Promise.reject('edgeSwipe is only supported on iOS.');\n }\n return { results: {} };\n }\n async openCamera() {\n return { results: {} };\n }\n async fileDownload(_options) {\n return { results: {} };\n }\n async doDisabledCapture(_options) {\n if (Capacitor.getPlatform() !== 'ios') {\n return Promise.reject('doDisabledCapture is only supported on iOS.');\n }\n return { results: {} };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin","Capacitor"],"mappings":";;;AACK,UAAC,YAAY,GAAGA,mBAAc,CAAC,QAAQ,EAAE;IAC9C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;IAC3D,CAAC;;ICHD;IAEO,MAAM,SAAS,SAASC,cAAS,CAAC;IACzC,IAAI,MAAM,UAAU,GAAG;IACvB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL,IAAI,MAAM,UAAU,GAAG;IACvB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL,IAAI,MAAM,IAAI,GAAG;IACjB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL,IAAI,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL,IAAI,MAAM,QAAQ,GAAG;IACrB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL,IAAI,MAAM,IAAI,CAAC,QAAQ,EAAE;IACzB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL,IAAI,MAAM,SAAS,CAAC,QAAQ,EAAE;IAC9B,QAAQ,IAAIC,cAAS,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;IAC/C,YAAY,OAAO,OAAO,CAAC,MAAM,CAAC,qCAAqC,CAAC,CAAC;IACzE,SAAS;IACT,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL,IAAI,MAAM,UAAU,GAAG;IACvB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL,IAAI,MAAM,YAAY,CAAC,QAAQ,EAAE;IACjC,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL,IAAI,MAAM,iBAAiB,CAAC,QAAQ,EAAE;IACtC,QAAQ,IAAIA,cAAS,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;IAC/C,YAAY,OAAO,OAAO,CAAC,MAAM,CAAC,6CAA6C,CAAC,CAAC;IACjF,SAAS;IACT,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,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 HanwhaPlugin = registerPlugin('Plugin', {\n web: () => import('./web').then(m => new m.PluginWeb()),\n});\nexport * from './definitions';\nexport { HanwhaPlugin };\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { Capacitor, WebPlugin } from '@capacitor/core';\nexport class PluginWeb extends WebPlugin {\n async executeApp() {\n return { results: {} };\n }\n async addContact() {\n return { results: {} };\n }\n addKeyboardMenu() {\n return;\n }\n removeKeyboardMenu() {\n return;\n }\n async auth() {\n return { results: {} };\n }\n async getCertificateProvisioning() {\n return { result: false };\n }\n async checkSeoulTimeZone() {\n return { results: {} };\n }\n async timezone() {\n return { results: {} };\n }\n async open(_options) {\n return { results: {} };\n }\n async edgeSwipe(_options) {\n if (Capacitor.getPlatform() !== 'ios') {\n return Promise.reject('edgeSwipe is only supported on iOS.');\n }\n return { results: {} };\n }\n async openCamera() {\n return { results: {} };\n }\n async fileDownload(_options) {\n return { results: {} };\n }\n async doDisabledCapture(_options) {\n if (Capacitor.getPlatform() !== 'ios') {\n return Promise.reject('doDisabledCapture is only supported on iOS.');\n }\n return { results: {} };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin","Capacitor"],"mappings":";;;AACK,UAAC,YAAY,GAAGA,mBAAc,CAAC,QAAQ,EAAE;IAC9C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;IAC3D,CAAC;;ICHD;IAEO,MAAM,SAAS,SAASC,cAAS,CAAC;IACzC,IAAI,MAAM,UAAU,GAAG;IACvB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL,IAAI,MAAM,UAAU,GAAG;IACvB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL,IAAI,eAAe,GAAG;IACtB,QAAQ,OAAO;IACf,KAAK;IACL,IAAI,kBAAkB,GAAG;IACzB,QAAQ,OAAO;IACf,KAAK;IACL,IAAI,MAAM,IAAI,GAAG;IACjB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL,IAAI,MAAM,0BAA0B,GAAG;IACvC,QAAQ,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IACjC,KAAK;IACL,IAAI,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL,IAAI,MAAM,QAAQ,GAAG;IACrB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL,IAAI,MAAM,IAAI,CAAC,QAAQ,EAAE;IACzB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL,IAAI,MAAM,SAAS,CAAC,QAAQ,EAAE;IAC9B,QAAQ,IAAIC,cAAS,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;IAC/C,YAAY,OAAO,OAAO,CAAC,MAAM,CAAC,qCAAqC,CAAC,CAAC;IACzE,SAAS;IACT,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL,IAAI,MAAM,UAAU,GAAG;IACvB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL,IAAI,MAAM,YAAY,CAAC,QAAQ,EAAE;IACjC,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL,IAAI,MAAM,iBAAiB,CAAC,QAAQ,EAAE;IACtC,QAAQ,IAAIA,cAAS,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;IAC/C,YAAY,OAAO,OAAO,CAAC,MAAM,CAAC,6CAA6C,CAAC,CAAC;IACjF,SAAS;IACT,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import UIKit
|
|
4
|
+
import Foundation
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
protocol KeyboardMenuDelegate: AnyObject {
|
|
8
|
+
func menuTapped(_ sender: UIButton)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
class KeyboardMenu: UIStackView {
|
|
12
|
+
// MARK: - Properties
|
|
13
|
+
var delegate: KeyboardMenuDelegate?
|
|
14
|
+
private var bottomConstraint: NSLayoutConstraint?
|
|
15
|
+
|
|
16
|
+
// MARK: - Initializer
|
|
17
|
+
override init(frame: CGRect) {
|
|
18
|
+
super.init(frame: frame)
|
|
19
|
+
self.setup()
|
|
20
|
+
self.setupKeyboardObservers()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
required init(coder: NSCoder) {
|
|
24
|
+
super.init(coder: coder)
|
|
25
|
+
self.setup()
|
|
26
|
+
self.setupKeyboardObservers()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
override func didMoveToSuperview() {
|
|
30
|
+
super.didMoveToSuperview()
|
|
31
|
+
if let superview = self.superview {
|
|
32
|
+
self.bottomConstraint = self.bottomAnchor.constraint(equalTo: superview.bottomAnchor)
|
|
33
|
+
self.bottomConstraint?.isActive = true
|
|
34
|
+
self.widthAnchor.constraint(equalTo: self.superview!.widthAnchor).isActive = true
|
|
35
|
+
self.createAddButton();
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//create add button
|
|
40
|
+
func createAddButton() {
|
|
41
|
+
let imgArray = ["todo","img","file","collabo-link","url-link"];
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
for i in 0..<imgArray.count{
|
|
45
|
+
let addButton = UIButton()
|
|
46
|
+
// svg 이미지에서 file 이미지 가져와서 사용
|
|
47
|
+
|
|
48
|
+
let podBundle = Bundle(for: KeyboardMenu.self)
|
|
49
|
+
|
|
50
|
+
if let resourceBundleURL = podBundle.url(forResource: "KeyboardMenuIcon", withExtension: "bundle"),
|
|
51
|
+
let resourceBundle = Bundle(url: resourceBundleURL) {
|
|
52
|
+
let image = UIImage(named: imgArray[i], in: resourceBundle, compatibleWith: nil)
|
|
53
|
+
addButton.setImage(image, for: .normal);
|
|
54
|
+
addButton.accessibilityHint = imgArray[i];
|
|
55
|
+
addButton.backgroundColor = .white
|
|
56
|
+
addButton.addTarget(self, action: #selector(menuTapped(_:)), for: .touchUpInside)
|
|
57
|
+
self.addArrangedSubview(addButton)
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// MARK: - Setup
|
|
65
|
+
private func setup() {
|
|
66
|
+
self.axis = .horizontal
|
|
67
|
+
self.distribution = .fillEqually
|
|
68
|
+
self.spacing = 0
|
|
69
|
+
self.translatesAutoresizingMaskIntoConstraints = false
|
|
70
|
+
self.heightAnchor.constraint(equalToConstant: 66).isActive = true
|
|
71
|
+
|
|
72
|
+
// Add shadow
|
|
73
|
+
self.layer.shadowColor = UIColor.black.cgColor
|
|
74
|
+
self.layer.shadowOpacity = 0.16
|
|
75
|
+
self.layer.shadowOffset = CGSize(width: 0, height: 0)
|
|
76
|
+
self.layer.shadowRadius = 16 // 1rem = 16px
|
|
77
|
+
self.layer.masksToBounds = false
|
|
78
|
+
|
|
79
|
+
// keyboardMenu.bottomAnchor.constraint(equalTo: self.view.bottomAnchor).isActive = true
|
|
80
|
+
// keyboardMenu.heightAnchor.constraint(equalToConstant: 50).isActive = true
|
|
81
|
+
//
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
self.isHidden = true;
|
|
85
|
+
// width constraint 100%
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
private func setupKeyboardObservers() {
|
|
89
|
+
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(_:)), name: UIResponder.keyboardWillShowNotification, object: nil)
|
|
90
|
+
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(_:)), name: UIResponder.keyboardWillHideNotification, object: nil)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@objc private func keyboardWillShow(_ notification: Notification) {
|
|
94
|
+
self.isHidden = false;
|
|
95
|
+
if let userInfo = notification.userInfo,
|
|
96
|
+
let keyboardFrame = userInfo[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect,
|
|
97
|
+
let superview = self.superview {
|
|
98
|
+
let keyboardHeight = keyboardFrame.height
|
|
99
|
+
self.bottomConstraint?.constant = -keyboardHeight
|
|
100
|
+
UIView.animate(withDuration: 0.3) {
|
|
101
|
+
superview.layoutIfNeeded()
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@objc private func keyboardWillHide(_ notification: Notification) {
|
|
107
|
+
self.isHidden = true;
|
|
108
|
+
// self.removeFromSuperview();
|
|
109
|
+
|
|
110
|
+
//remove from superview
|
|
111
|
+
self.bottomConstraint?.constant = 0
|
|
112
|
+
UIView.animate(withDuration: 0.3) {
|
|
113
|
+
self.superview?.layoutIfNeeded()
|
|
114
|
+
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@IBAction func menuTapped(_ sender: UIButton) {
|
|
119
|
+
// print("menuTapped", sender.accessibilityHint!);
|
|
120
|
+
self.delegate?.menuTapped(sender)
|
|
121
|
+
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
deinit {
|
|
125
|
+
NotificationCenter.default.removeObserver(self)
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import Foundation
|
|
5
|
+
import Capacitor
|
|
6
|
+
import Contacts
|
|
7
|
+
/**
|
|
8
|
+
* Please read the Capacitor iOS Plugin Development Guide
|
|
9
|
+
* here: https://capacitorjs.com/docs/plugins/ios
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
public class KeyboardMenuPlugin: CAPPlugin, KeyboardMenuDelegate {
|
|
13
|
+
func menuTapped(_ sender: UIButton) {
|
|
14
|
+
let name = sender.accessibilityHint!;
|
|
15
|
+
|
|
16
|
+
if let _listener = self.listener {
|
|
17
|
+
_listener.notifyListeners("keyboardMenuTapped", data: ["name":name]);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
private static var keyboardMenu: KeyboardMenu?
|
|
22
|
+
private var listener: CAPPlugin?
|
|
23
|
+
// implement remove keyboardmenu view
|
|
24
|
+
@objc func remove(_ call: CAPPluginCall) {
|
|
25
|
+
|
|
26
|
+
DispatchQueue.main.async {
|
|
27
|
+
if let menu = KeyboardMenuPlugin.keyboardMenu {
|
|
28
|
+
menu.removeFromSuperview()
|
|
29
|
+
KeyboardMenuPlugin.keyboardMenu = nil
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@objc func add(_ call: CAPPluginCall, _bridge: CAPBridgeProtocol, listener: CAPPlugin) {
|
|
37
|
+
self.listener = listener;
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
DispatchQueue.main.async {
|
|
41
|
+
KeyboardMenuPlugin.keyboardMenu = KeyboardMenu(frame: CGRectZero)
|
|
42
|
+
KeyboardMenuPlugin.keyboardMenu?.delegate = self;
|
|
43
|
+
|
|
44
|
+
// add keyboard menu main view
|
|
45
|
+
_bridge.viewController!.view.addSubview(KeyboardMenuPlugin.keyboardMenu!)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"images" : [
|
|
3
|
+
{
|
|
4
|
+
"idiom" : "universal",
|
|
5
|
+
"scale" : "1x"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"idiom" : "universal",
|
|
9
|
+
"scale" : "2x"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"filename" : "icon-collabo-link.svg",
|
|
13
|
+
"idiom" : "universal",
|
|
14
|
+
"scale" : "3x"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"info" : {
|
|
18
|
+
"author" : "xcode",
|
|
19
|
+
"version" : 1
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#vadub7xtna)" stroke="#AAA" stroke-width="1.6" stroke-linejoin="round">
|
|
3
|
+
<path d="M3.61 6.286A9.988 9.988 0 0 1 11.819 2c3.398 0 6.4 1.695 8.208 4.286l.364-2.857M20.39 17.714A9.989 9.989 0 0 1 12.182 22a9.988 9.988 0 0 1-8.207-4.286l-.364 2.857" stroke-linecap="round"/>
|
|
4
|
+
<path d="m6.105 9.856 5.714-4.286 5.714 4.286-5.714 4.286-5.714-4.286z"/>
|
|
5
|
+
<path d="m4.675 12.715 7.143 5.714 7.143-5.714" stroke-linecap="round"/>
|
|
6
|
+
</g>
|
|
7
|
+
<defs>
|
|
8
|
+
<clipPath id="vadub7xtna">
|
|
9
|
+
<path fill="#fff" d="M0 0h24v24H0z"/>
|
|
10
|
+
</clipPath>
|
|
11
|
+
</defs>
|
|
12
|
+
</svg>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"images" : [
|
|
3
|
+
{
|
|
4
|
+
"idiom" : "universal",
|
|
5
|
+
"scale" : "1x"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"idiom" : "universal",
|
|
9
|
+
"scale" : "2x"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"filename" : "icon-file.svg",
|
|
13
|
+
"idiom" : "universal",
|
|
14
|
+
"scale" : "3x"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"info" : {
|
|
18
|
+
"author" : "xcode",
|
|
19
|
+
"version" : 1
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M19.118 10.65V7.32c0-1.512 0-2.268-.289-2.846a2.674 2.674 0 0 0-1.157-1.18C17.106 3 16.365 3 14.882 3H9.235c-1.482 0-2.223 0-2.79.294a2.674 2.674 0 0 0-1.156 1.18C5 5.052 5 5.808 5 7.32v9.36c0 1.512 0 2.268.289 2.846.253.508.658.92 1.156 1.18.567.294 1.308.294 2.79.294h2.824m5.294-.9v-5.4m-2.647 2.7H20" stroke="#AAA" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"images" : [
|
|
3
|
+
{
|
|
4
|
+
"idiom" : "universal",
|
|
5
|
+
"scale" : "1x"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"idiom" : "universal",
|
|
9
|
+
"scale" : "2x"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"filename" : "icon-img.svg",
|
|
13
|
+
"idiom" : "universal",
|
|
14
|
+
"scale" : "3x"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"info" : {
|
|
18
|
+
"author" : "xcode",
|
|
19
|
+
"version" : 1
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M12 3.5H7.3c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2.5 5.78 2.5 6.62 2.5 8.3v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311c.642.327 1.482.327 3.162.327h9.2c.93 0 1.395 0 1.776-.102a3 3 0 0 0 2.122-2.122c.102-.381.102-.846.102-1.776m-2-9v-6m-3 3h6M10 9a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm4.49 3.418-8.459 7.69c-.476.433-.714.649-.735.836a.5.5 0 0 0 .167.431c.142.125.463.125 1.106.125h9.387c1.44 0 2.159 0 2.724-.242a3 3 0 0 0 1.578-1.578c.242-.565.242-1.285.242-2.724 0-.484 0-.726-.053-.952a2.001 2.001 0 0 0-.374-.778c-.143-.182-.332-.333-.71-.636l-2.797-2.237c-.379-.303-.568-.454-.776-.508a1 1 0 0 0-.557.018c-.205.066-.384.23-.743.555z" stroke="#AAA" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"images" : [
|
|
3
|
+
{
|
|
4
|
+
"idiom" : "universal",
|
|
5
|
+
"scale" : "1x"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"idiom" : "universal",
|
|
9
|
+
"scale" : "2x"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"filename" : "icon-todo.svg",
|
|
13
|
+
"idiom" : "universal",
|
|
14
|
+
"scale" : "3x"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"info" : {
|
|
18
|
+
"author" : "xcode",
|
|
19
|
+
"version" : 1
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M22.5 4 10.715 14.5l-2.358-2.327-1.178-1.164" stroke="#AAA" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
<path d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2c1.422 0 2.775.297 4 .832" stroke="#AAA" stroke-width="1.6" stroke-linecap="round"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"images" : [
|
|
3
|
+
{
|
|
4
|
+
"idiom" : "universal",
|
|
5
|
+
"scale" : "1x"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"idiom" : "universal",
|
|
9
|
+
"scale" : "2x"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"filename" : "icon-url-link.svg",
|
|
13
|
+
"idiom" : "universal",
|
|
14
|
+
"scale" : "3x"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"info" : {
|
|
18
|
+
"author" : "xcode",
|
|
19
|
+
"version" : 1
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="m12.688 18.197-1.377 1.377a4.869 4.869 0 0 1-6.885-6.886l1.377-1.377m12.394 1.377 1.377-1.377a4.869 4.869 0 0 0-6.886-6.885l-1.377 1.377m-2.72 9.605 6.817-6.816" stroke="#AAA" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
package/ios/Plugin/Plugin.m
CHANGED
|
@@ -13,4 +13,11 @@ CAP_PLUGIN(Plugin, "Plugin",
|
|
|
13
13
|
CAP_PLUGIN_METHOD(edgeSwipe, CAPPluginReturnPromise);
|
|
14
14
|
CAP_PLUGIN_METHOD(fileDownload, CAPPluginReturnPromise);
|
|
15
15
|
CAP_PLUGIN_METHOD(doDisabledCapture, CAPPluginReturnPromise);
|
|
16
|
+
CAP_PLUGIN_METHOD(addKeyboardMenu, CAPPluginReturnPromise);
|
|
17
|
+
CAP_PLUGIN_METHOD(removeKeyboardMenu, CAPPluginReturnPromise);
|
|
18
|
+
CAP_PLUGIN_METHOD(executeApp, CAPPluginReturnPromise);
|
|
19
|
+
CAP_PLUGIN_METHOD(getCertificateProvisioning, CAPPluginReturnPromise);
|
|
20
|
+
CAP_PLUGIN_METHOD(saveUserDefault, CAPPluginReturnPromise);
|
|
21
|
+
CAP_PLUGIN_METHOD(getUserDefault, CAPPluginReturnPromise);
|
|
22
|
+
|
|
16
23
|
)
|
package/ios/Plugin/Plugin.swift
CHANGED
|
@@ -13,9 +13,179 @@ import Contacts
|
|
|
13
13
|
public class Plugin: CAPPlugin {
|
|
14
14
|
|
|
15
15
|
|
|
16
|
+
|
|
17
|
+
@objc func getUserDefault(_ call: CAPPluginCall) {
|
|
18
|
+
guard let userInfo = call.getString("data") else {
|
|
19
|
+
call.reject("No data string provided")
|
|
20
|
+
return
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
print("UserDefaults에 저장할 데이터: \(userInfo)")
|
|
24
|
+
|
|
25
|
+
guard let data = userInfo.data(using: .utf8) else {
|
|
26
|
+
call.reject("Failed to convert string to data")
|
|
27
|
+
return
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
do {
|
|
31
|
+
guard let jsonObject = try JSONSerialization.jsonObject(with: data) as? [String: Any] else {
|
|
32
|
+
call.reject("Failed to convert string to jsonObject")
|
|
33
|
+
return
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
guard let keyName = jsonObject["key"] as? String else {
|
|
37
|
+
call.reject("Failed to get key from jsonObject")
|
|
38
|
+
return
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
guard let sharedDefaults = UserDefaults(suiteName: "group.com.hanwha.cleverselite") else {
|
|
42
|
+
call.reject("Failed to access shared UserDefaults")
|
|
43
|
+
return
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if let value = sharedDefaults.string(forKey: keyName) {
|
|
47
|
+
// 성공적으로 가져온 값 반환
|
|
48
|
+
call.resolve([
|
|
49
|
+
"data": value
|
|
50
|
+
])
|
|
51
|
+
// call.resolve([
|
|
52
|
+
// "data": value
|
|
53
|
+
// ])
|
|
54
|
+
} else {
|
|
55
|
+
call.reject("No value found for key: \(keyName)")
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
} catch {
|
|
59
|
+
call.reject("JSON parsing error: \(error.localizedDescription)")
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
@objc func saveUserDefault(_ call: CAPPluginCall) {
|
|
65
|
+
if let userInfo = call.getString("data") {
|
|
66
|
+
print("UserDefaults에 저장할 데이터: \(userInfo)")
|
|
67
|
+
|
|
68
|
+
// data 매개변수가 없으면 에러
|
|
69
|
+
guard let data = userInfo.data(using: .utf8) else {
|
|
70
|
+
call.reject("Failed to convert string to data")
|
|
71
|
+
return
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
do {
|
|
75
|
+
// json 직렬화 안되면 에러
|
|
76
|
+
guard let jsonObject = try JSONSerialization.jsonObject(with: data) as? [String: Any] else {
|
|
77
|
+
call.reject("Failed to convert string to jsonObject")
|
|
78
|
+
return
|
|
79
|
+
}
|
|
80
|
+
// 키 값이 없으면 에러
|
|
81
|
+
guard let keyName = jsonObject["key"] as? String else {
|
|
82
|
+
call.reject("Failed to get key from jsonObject")
|
|
83
|
+
return
|
|
84
|
+
}
|
|
85
|
+
// value 값이 없으면 에러
|
|
86
|
+
guard let valueAny = jsonObject["value"] else {
|
|
87
|
+
call.reject("Failed to get key from value")
|
|
88
|
+
return
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
let valueData = try JSONSerialization.data(withJSONObject: valueAny, options: [])
|
|
92
|
+
|
|
93
|
+
guard let valueString = String(data: valueData, encoding: .utf8) else {
|
|
94
|
+
call.reject("Failed to valueString Data to String")
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
// 그룹 설정에 대한 UserDefaults를 가져오지 못하면 에러
|
|
100
|
+
guard let sharedDefaults = UserDefaults(suiteName: "group.com.hanwha.cleverselite") else {
|
|
101
|
+
call.reject("Failed to access shared UserDefaults")
|
|
102
|
+
return
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
sharedDefaults.set(valueString, forKey: keyName);
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
} catch {
|
|
109
|
+
call.reject("JSON parsing error: \(error.localizedDescription)")
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
|
|
16
117
|
override public func load() {
|
|
17
118
|
// 문서뷰어 요청 이벤트
|
|
18
119
|
NotificationCenter.default.addObserver(self, selector: #selector(handleDocumentViewRequest(_:)), name: .documentViewRequest, object: nil)
|
|
120
|
+
|
|
121
|
+
// keyboard event
|
|
122
|
+
NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboard(_:)), name: UIResponder.keyboardDidShowNotification, object: nil)
|
|
123
|
+
NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboard(_:)), name: UIResponder.keyboardWillShowNotification, object: nil)
|
|
124
|
+
NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboard(_:)), name: UIResponder.keyboardWillHideNotification, object: nil)
|
|
125
|
+
NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboard(_:)), name: UIResponder.keyboardDidHideNotification, object: nil)
|
|
126
|
+
}
|
|
127
|
+
@objc func handleKeyboard(_ notification: Notification) {
|
|
128
|
+
|
|
129
|
+
//calc keyboard height
|
|
130
|
+
let userInfo = notification.userInfo!
|
|
131
|
+
let keyboardSize = (userInfo[UIResponder.keyboardFrameEndUserInfoKey] as! NSValue).cgRectValue.size
|
|
132
|
+
// data 매개변수에 keyboardsize를 전달
|
|
133
|
+
self.notifyListeners(notification.name.rawValue, data: ["size": keyboardSize.height])
|
|
134
|
+
}
|
|
135
|
+
// ios 인증서 만료일을 가져온다
|
|
136
|
+
@objc func getCertificateProvisioning(_ call: CAPPluginCall){
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
guard let path = Bundle.main.path(forResource: "embedded", ofType: "mobileprovision"),
|
|
140
|
+
let content = try? Data(contentsOf: URL(fileURLWithPath: path)) else {
|
|
141
|
+
print("embedded.mobileprovision not found")
|
|
142
|
+
call.resolve([
|
|
143
|
+
"result": false,
|
|
144
|
+
"message": "embedded.mobileprovision not found"
|
|
145
|
+
])
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// 구형기기에서는 ascii, 최신기기는 isoLatin1
|
|
150
|
+
guard let contentString = String(data: content, encoding: .isoLatin1) ?? String(data: content, encoding: .ascii),
|
|
151
|
+
let startRange = contentString.range(of: "<plist"),
|
|
152
|
+
let endRange = contentString.range(of: "</plist>") else {
|
|
153
|
+
print("Failed to parse plist from provisioning profile")
|
|
154
|
+
call.resolve([
|
|
155
|
+
"result": false,
|
|
156
|
+
"message": "Failed to parse plist from provisioning profile"
|
|
157
|
+
])
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
let plistString = String(contentString[startRange.lowerBound...endRange.upperBound])
|
|
162
|
+
guard let plistData = plistString.data(using: .utf8) else { call.resolve([
|
|
163
|
+
"result": false
|
|
164
|
+
])
|
|
165
|
+
return; }
|
|
166
|
+
|
|
167
|
+
do {
|
|
168
|
+
if let plist = try PropertyListSerialization.propertyList(from: plistData, options: [], format: nil) as? [String: Any],
|
|
169
|
+
let expirationDate = plist["ExpirationDate"] as? Date {
|
|
170
|
+
// Date를 timestamp로 변환
|
|
171
|
+
let timestamp = expirationDate.timeIntervalSince1970
|
|
172
|
+
|
|
173
|
+
call.resolve([
|
|
174
|
+
"result": true,
|
|
175
|
+
"timestamp": timestamp,
|
|
176
|
+
"date": expirationDate.description,
|
|
177
|
+
])
|
|
178
|
+
return;
|
|
179
|
+
// return expirationDate
|
|
180
|
+
}
|
|
181
|
+
} catch {
|
|
182
|
+
print("Plist parsing failed: \(error)")
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return;
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
19
189
|
}
|
|
20
190
|
|
|
21
191
|
@objc func handleDocumentViewRequest(_ notification: Notification) {
|
|
@@ -32,15 +202,31 @@ public class Plugin: CAPPlugin {
|
|
|
32
202
|
안드로이드에서만 사용
|
|
33
203
|
*/
|
|
34
204
|
@objc func executeApp(_ call: CAPPluginCall) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
if let url = URL(string: call.getString("package") ?? "") {
|
|
208
|
+
DispatchQueue.main.async {
|
|
209
|
+
UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
|
|
39
214
|
}
|
|
40
215
|
|
|
41
216
|
@objc func auth(_ call: CAPPluginCall) {
|
|
42
217
|
AuthPlugin().auth(call)
|
|
43
218
|
}
|
|
219
|
+
@objc func addKeyboardMenu(_ call: CAPPluginCall) {
|
|
220
|
+
|
|
221
|
+
KeyboardMenuPlugin().add(call, _bridge: self.bridge!, listener: self)
|
|
222
|
+
}
|
|
223
|
+
@objc func removeKeyboardMenu(_ call: CAPPluginCall) {
|
|
224
|
+
|
|
225
|
+
KeyboardMenuPlugin().remove(call)
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
44
230
|
|
|
45
231
|
@objc func addContact(_ call: CAPPluginCall) {
|
|
46
232
|
ContactPlugin().addContact(call)
|