@hanwha-ss1/plugin 0.2.7 → 0.2.9
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/android/src/main/java/com/plugin/bio/Bio.java +2 -2
- package/android/src/main/java/com/plugin/bio/BioAuthManager.java +116 -112
- package/android/src/main/java/com/plugin/bio/BioPlugin.java +0 -25
- package/android/src/main/java/com/plugin/linker/LinkerPlugin.java +27 -0
- package/dist/esm/definitions.d.ts +9 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +2 -0
- package/dist/esm/web.js +6 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +6 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +6 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/Plugin.m +2 -0
- package/ios/Plugin/Plugin.swift +8 -0
- package/ios/Plugin/TimeZone/TimeZonePlugin.swift +20 -0
- package/ios/Plugin/TimeZone/TimeZoneService.swift +27 -0
- package/package.json +1 -1
|
@@ -108,127 +108,131 @@ public class BioAuthManager {
|
|
|
108
108
|
|
|
109
109
|
|
|
110
110
|
public void authenticate(Activity activity, Bio.OnBioResult callback) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
@Override
|
|
131
|
-
public void onAuthenticationSucceeded(@NonNull BiometricPrompt.AuthenticationResult result) {
|
|
132
|
-
super.onAuthenticationSucceeded(result);
|
|
133
|
-
Log.d("bioAuth", "auth success");
|
|
134
|
-
if(callback != null) {
|
|
135
|
-
callback.onSuccess();
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
@Override
|
|
140
|
-
public void onAuthenticationFailed() {
|
|
141
|
-
super.onAuthenticationFailed();
|
|
142
|
-
Log.d("bioAuth", "auth failed");
|
|
143
|
-
if(callback != null) {
|
|
144
|
-
callback.onFail("auth failed");
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
// DEVICE_CREDENTIAL 및 BIOMETRIC_STRING | DEVICE_CREDENTIAL 은 안드로이드 10 이하에서 지원되지 않는다.
|
|
150
|
-
// 안드로이드 10 이하에서 PIN 이나 패턴, 비밀번호가 있는지 확인하려면 KeyguardManager.isDeviceSecure() 함수를 사용할 것
|
|
151
|
-
promptInfo = new BiometricPrompt.PromptInfo.Builder()
|
|
152
|
-
.setTitle("지문 인증")
|
|
153
|
-
.setSubtitle("기기에 등록된 지문을 이용하여 지문을 인증해주세요.")
|
|
154
|
-
// .setDescription("생체 인증 설명")
|
|
155
|
-
// BIOMETRIC_STRONG 은 안드로이드 11 에서 정의한 클래스 3 생체 인식을 사용하는 인증 - 암호회된 키 필요
|
|
156
|
-
// BIOMETRIC_WEAK 은 안드로이드 11 에서 정의한 클래스 2 생체 인식을 사용하는 인증 - 암호화된 키까지 필요하지는 않음
|
|
157
|
-
// DEVICE_CREDENTIAL 은 화면 잠금 사용자 인증 정보를 사용하는 인증 - 사용자의 PIN, 패턴 또는 비밀번호
|
|
158
|
-
.setAllowedAuthenticators(BIOMETRIC_STRONG)
|
|
159
|
-
.setConfirmationRequired(false) // 명시적인 사용자 작업 ( 생체 인식 전 한번더 체크 ) 없이 인증할건지 default : true
|
|
160
|
-
.setNegativeButtonText("취소")
|
|
161
|
-
.build();
|
|
162
|
-
|
|
163
|
-
keyManager.generateKey();
|
|
164
|
-
|
|
165
|
-
if (keyManager.cipherInit()) {
|
|
166
|
-
bioCryptoObject = new BiometricPrompt.CryptoObject(keyManager.getCipher());
|
|
167
|
-
biometricPrompt.authenticate(promptInfo, bioCryptoObject);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
biometricPrompt.authenticate(promptInfo);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
// api 23 ( ANDROID 6.0 ) 부터 api 28 ( ANDROID 9.0 ) 까지는 fingerprint 사용
|
|
175
|
-
else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
176
|
-
Log.d("fingerprint", "fingerprint start");
|
|
177
|
-
|
|
178
|
-
fingerprintManager = (FingerprintManager) activity.getSystemService(FINGERPRINT_SERVICE);
|
|
179
|
-
keyguardManager = (KeyguardManager) activity.getSystemService(KEYGUARD_SERVICE);
|
|
180
|
-
|
|
181
|
-
if (canAuthenticate(activity)) {
|
|
182
|
-
Log.d("fingerprint", "requirement fingerprint needed all pass");
|
|
183
|
-
|
|
184
|
-
keyManager.generateKey();
|
|
185
|
-
|
|
186
|
-
if (keyManager.cipherInit()) {
|
|
187
|
-
|
|
188
|
-
Cipher cipher = keyManager.getCipher();
|
|
189
|
-
|
|
190
|
-
cryptoObject = new FingerprintManager.CryptoObject(cipher);
|
|
191
|
-
|
|
192
|
-
fingerprintManager.authenticate(cryptoObject, new CancellationSignal(), 0, new FingerprintManager.AuthenticationCallback() {
|
|
193
|
-
@Override
|
|
194
|
-
public void onAuthenticationError(int errorCode, CharSequence errString) {
|
|
195
|
-
super.onAuthenticationError(errorCode, errString);
|
|
196
|
-
Log.d("fingerprint", String.valueOf(errorCode));
|
|
197
|
-
if(callback != null) {
|
|
198
|
-
callback.onFail(errString.toString());
|
|
111
|
+
activity.runOnUiThread(new Runnable() {
|
|
112
|
+
@Override
|
|
113
|
+
public void run() {
|
|
114
|
+
keyManager = KeyManager.getInstance();
|
|
115
|
+
// api 28 ( ANDROID 9.0 ) 이상은 biometricPrompt 사용
|
|
116
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
|
117
|
+
Log.d("bioAuth", "start biometricPrompt");
|
|
118
|
+
|
|
119
|
+
if (canAuthenticate(activity)) {
|
|
120
|
+
executor = activity.getMainExecutor();
|
|
121
|
+
|
|
122
|
+
biometricPrompt = new BiometricPrompt((FragmentActivity) activity, executor, new BiometricPrompt.AuthenticationCallback() {
|
|
123
|
+
@Override
|
|
124
|
+
public void onAuthenticationError(int errorCode, @NonNull CharSequence errString) {
|
|
125
|
+
super.onAuthenticationError(errorCode, errString);
|
|
126
|
+
Log.d("bioAuth", errString.toString());
|
|
127
|
+
if(callback != null) {
|
|
128
|
+
callback.onFail(errorCode);
|
|
129
|
+
}
|
|
199
130
|
}
|
|
200
|
-
}
|
|
201
131
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
132
|
+
@Override
|
|
133
|
+
public void onAuthenticationSucceeded(@NonNull BiometricPrompt.AuthenticationResult result) {
|
|
134
|
+
super.onAuthenticationSucceeded(result);
|
|
135
|
+
Log.d("bioAuth", "auth success");
|
|
136
|
+
if(callback != null) {
|
|
137
|
+
callback.onSuccess(result.getAuthenticationType());
|
|
138
|
+
}
|
|
208
139
|
}
|
|
209
|
-
}
|
|
210
140
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
141
|
+
@Override
|
|
142
|
+
public void onAuthenticationFailed() {
|
|
143
|
+
super.onAuthenticationFailed();
|
|
144
|
+
Log.d("bioAuth", "auth failed");
|
|
145
|
+
if(callback != null) {
|
|
146
|
+
callback.onFail(-1);
|
|
147
|
+
}
|
|
217
148
|
}
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// DEVICE_CREDENTIAL 및 BIOMETRIC_STRING | DEVICE_CREDENTIAL 은 안드로이드 10 이하에서 지원되지 않는다.
|
|
152
|
+
// 안드로이드 10 이하에서 PIN 이나 패턴, 비밀번호가 있는지 확인하려면 KeyguardManager.isDeviceSecure() 함수를 사용할 것
|
|
153
|
+
promptInfo = new BiometricPrompt.PromptInfo.Builder()
|
|
154
|
+
.setTitle("지문 인증")
|
|
155
|
+
.setSubtitle("기기에 등록된 지문을 이용하여 지문을 인증해주세요.")
|
|
156
|
+
.setDescription("생체 인증")
|
|
157
|
+
// BIOMETRIC_STRONG 은 안드로이드 11 에서 정의한 클래스 3 생체 인식을 사용하는 인증 - 암호회된 키 필요
|
|
158
|
+
// BIOMETRIC_WEAK 은 안드로이드 11 에서 정의한 클래스 2 생체 인식을 사용하는 인증 - 암호화된 키까지 필요하지는 않음
|
|
159
|
+
// DEVICE_CREDENTIAL 은 화면 잠금 사용자 인증 정보를 사용하는 인증 - 사용자의 PIN, 패턴 또는 비밀번호
|
|
160
|
+
.setAllowedAuthenticators(BIOMETRIC_STRONG)
|
|
161
|
+
.setConfirmationRequired(false) // 명시적인 사용자 작업 ( 생체 인식 전 한번더 체크 ) 없이 인증할건지 default : true
|
|
162
|
+
.setNegativeButtonText("취소")
|
|
163
|
+
.build();
|
|
164
|
+
|
|
165
|
+
keyManager.generateKey();
|
|
166
|
+
|
|
167
|
+
if (keyManager.cipherInit()) {
|
|
168
|
+
bioCryptoObject = new BiometricPrompt.CryptoObject(keyManager.getCipher());
|
|
169
|
+
biometricPrompt.authenticate(promptInfo, bioCryptoObject);
|
|
218
170
|
}
|
|
219
171
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
super.onAuthenticationHelp(helpCode, helpString);
|
|
223
|
-
Log.d("fingerprint", helpString.toString());
|
|
224
|
-
if(callback != null) {
|
|
225
|
-
callback.onFail(helpString.toString());
|
|
226
|
-
}
|
|
227
|
-
}
|
|
172
|
+
biometricPrompt.authenticate(promptInfo);
|
|
173
|
+
}
|
|
228
174
|
|
|
229
|
-
|
|
175
|
+
}
|
|
176
|
+
// api 23 ( ANDROID 6.0 ) 부터 api 28 ( ANDROID 9.0 ) 까지는 fingerprint 사용
|
|
177
|
+
else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
178
|
+
Log.d("fingerprint", "fingerprint start");
|
|
179
|
+
|
|
180
|
+
fingerprintManager = (FingerprintManager) activity.getSystemService(FINGERPRINT_SERVICE);
|
|
181
|
+
keyguardManager = (KeyguardManager) activity.getSystemService(KEYGUARD_SERVICE);
|
|
182
|
+
|
|
183
|
+
if (canAuthenticate(activity)) {
|
|
184
|
+
Log.d("fingerprint", "requirement fingerprint needed all pass");
|
|
185
|
+
|
|
186
|
+
keyManager.generateKey();
|
|
187
|
+
|
|
188
|
+
if (keyManager.cipherInit()) {
|
|
189
|
+
|
|
190
|
+
Cipher cipher = keyManager.getCipher();
|
|
191
|
+
|
|
192
|
+
cryptoObject = new FingerprintManager.CryptoObject(cipher);
|
|
193
|
+
|
|
194
|
+
fingerprintManager.authenticate(cryptoObject, new CancellationSignal(), 0, new FingerprintManager.AuthenticationCallback() {
|
|
195
|
+
@Override
|
|
196
|
+
public void onAuthenticationError(int errorCode, CharSequence errString) {
|
|
197
|
+
super.onAuthenticationError(errorCode, errString);
|
|
198
|
+
Log.d("fingerprint", String.valueOf(errorCode));
|
|
199
|
+
if(callback != null) {
|
|
200
|
+
callback.onFail(errorCode);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
@Override
|
|
205
|
+
public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
|
|
206
|
+
super.onAuthenticationSucceeded(result);
|
|
207
|
+
Log.d("fingerprint", "auth success");
|
|
208
|
+
if(callback != null) {
|
|
209
|
+
callback.onSuccess(-1);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
@Override
|
|
214
|
+
public void onAuthenticationFailed() {
|
|
215
|
+
super.onAuthenticationFailed();
|
|
216
|
+
Log.d("fingerprint", "auth failed");
|
|
217
|
+
if(callback != null) {
|
|
218
|
+
callback.onFail(-1);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
@Override
|
|
223
|
+
public void onAuthenticationHelp(int helpCode, CharSequence helpString) {
|
|
224
|
+
super.onAuthenticationHelp(helpCode, helpString);
|
|
225
|
+
Log.d("fingerprint", helpString.toString());
|
|
226
|
+
if(callback != null) {
|
|
227
|
+
callback.onFail(helpCode);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
}, null);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
230
234
|
}
|
|
231
235
|
}
|
|
232
|
-
}
|
|
236
|
+
});
|
|
233
237
|
}
|
|
234
238
|
}
|
|
@@ -19,29 +19,4 @@ public class BioPlugin extends Plugin{
|
|
|
19
19
|
ret.put("value", implementation.echo(value));
|
|
20
20
|
call.resolve(ret);
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
@PluginMethod
|
|
24
|
-
public void auth(PluginCall call) {
|
|
25
|
-
if(implementation == null) {
|
|
26
|
-
implementation = new Bio();
|
|
27
|
-
}
|
|
28
|
-
implementation.authenticate(getActivity(), new Bio.OnBioResult() {
|
|
29
|
-
@Override
|
|
30
|
-
public void onSuccess() {
|
|
31
|
-
JSObject ret = new JSObject();
|
|
32
|
-
ret.put("result", true);
|
|
33
|
-
ret.put("message", "완료");
|
|
34
|
-
call.resolve(ret);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
@Override
|
|
38
|
-
public void onFail(String error) {
|
|
39
|
-
JSObject ret = new JSObject();
|
|
40
|
-
ret.put("result", false);
|
|
41
|
-
ret.put("message", error);
|
|
42
|
-
call.resolve(ret);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
}
|
|
47
22
|
}
|
|
@@ -5,11 +5,13 @@ import com.getcapacitor.Plugin;
|
|
|
5
5
|
import com.getcapacitor.PluginCall;
|
|
6
6
|
import com.getcapacitor.PluginMethod;
|
|
7
7
|
import com.getcapacitor.annotation.CapacitorPlugin;
|
|
8
|
+
import com.plugin.bio.Bio;
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
@CapacitorPlugin(name = "Plugin")
|
|
11
12
|
public class LinkerPlugin extends Plugin{
|
|
12
13
|
private Linker implementation = new Linker();
|
|
14
|
+
private Bio bioImplementation = new Bio();
|
|
13
15
|
|
|
14
16
|
@PluginMethod
|
|
15
17
|
public void echo(PluginCall call) {
|
|
@@ -44,4 +46,29 @@ public class LinkerPlugin extends Plugin{
|
|
|
44
46
|
}
|
|
45
47
|
});
|
|
46
48
|
}
|
|
49
|
+
|
|
50
|
+
@PluginMethod
|
|
51
|
+
public void auth(PluginCall call) {
|
|
52
|
+
if(bioImplementation == null) {
|
|
53
|
+
bioImplementation = new Bio();
|
|
54
|
+
}
|
|
55
|
+
bioImplementation.authenticate(getActivity(), new Bio.OnBioResult() {
|
|
56
|
+
@Override
|
|
57
|
+
public void onSuccess(int type) {
|
|
58
|
+
JSObject ret = new JSObject();
|
|
59
|
+
ret.put("isAvailable", true);
|
|
60
|
+
ret.put("biometryType", type);
|
|
61
|
+
call.resolve(ret);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@Override
|
|
65
|
+
public void onFail(int code) {
|
|
66
|
+
JSObject ret = new JSObject();
|
|
67
|
+
ret.put("isAvailable", false);
|
|
68
|
+
ret.put("biometryType", -1);
|
|
69
|
+
ret.put("errorCode", code);
|
|
70
|
+
call.resolve(ret);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
47
74
|
}
|
|
@@ -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"]}
|
|
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"]}
|
package/dist/esm/web.d.ts
CHANGED
package/dist/esm/web.js
CHANGED
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,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,OAAO,SAAU,SAAQ,SAAS;IAEtC,KAAK,CAAC,UAAU;QACd,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,UAAU;QACd,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,IAAI;QACR,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACzB,CAAC;CACF","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { WebPlugin } from '@capacitor/core';\nimport type { Plugin } from './definitions';\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\n async auth(): Promise<any> {\n return { results: {} };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,OAAO,SAAU,SAAQ,SAAS;IAEtC,KAAK,CAAC,UAAU;QACd,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,UAAU;QACd,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,IAAI;QACR,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACzB,CAAC;CACF","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { WebPlugin } from '@capacitor/core';\nimport type { Plugin } from './definitions';\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\n async auth(): Promise<any> {\n return { results: {} };\n }\n\n async checkSeoulTimeZone(): Promise<any> {\n return { results: {} };\n }\n\n async timezone(): Promise<any> {\n return { results: {} };\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -19,6 +19,12 @@ class PluginWeb extends core.WebPlugin {
|
|
|
19
19
|
async auth() {
|
|
20
20
|
return { results: {} };
|
|
21
21
|
}
|
|
22
|
+
async checkSeoulTimeZone() {
|
|
23
|
+
return { results: {} };
|
|
24
|
+
}
|
|
25
|
+
async timezone() {
|
|
26
|
+
return { results: {} };
|
|
27
|
+
}
|
|
22
28
|
}
|
|
23
29
|
|
|
24
30
|
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 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 { 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}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;;;AACK,MAAC,YAAY,GAAGA,mBAAc,CAAC,QAAQ,EAAE;AAC9C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;AAC3D,CAAC;;ACHD;AAEO,MAAM,SAAS,SAASC,cAAS,CAAC;AACzC,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAC/B,KAAK;AACL,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAC/B,KAAK;AACL,IAAI,MAAM,IAAI,GAAG;AACjB,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 { 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}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;;;AACK,MAAC,YAAY,GAAGA,mBAAc,CAAC,QAAQ,EAAE;AAC9C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;AAC3D,CAAC;;ACHD;AAEO,MAAM,SAAS,SAASC,cAAS,CAAC;AACzC,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAC/B,KAAK;AACL,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAC/B,KAAK;AACL,IAAI,MAAM,IAAI,GAAG;AACjB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAC/B,KAAK;AACL,IAAI,MAAM,kBAAkB,GAAG;AAC/B,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAC/B,KAAK;AACL,IAAI,MAAM,QAAQ,GAAG;AACrB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAC/B,KAAK;AACL;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -16,6 +16,12 @@ var capacitorContact = (function (exports, core) {
|
|
|
16
16
|
async auth() {
|
|
17
17
|
return { results: {} };
|
|
18
18
|
}
|
|
19
|
+
async checkSeoulTimeZone() {
|
|
20
|
+
return { results: {} };
|
|
21
|
+
}
|
|
22
|
+
async timezone() {
|
|
23
|
+
return { results: {} };
|
|
24
|
+
}
|
|
19
25
|
}
|
|
20
26
|
|
|
21
27
|
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 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 { 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}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"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;;;;;;;;;;;;;;;;;"}
|
|
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 { 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}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"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;;;;;;;;;;;;;;;;;"}
|
package/ios/Plugin/Plugin.m
CHANGED
package/ios/Plugin/Plugin.swift
CHANGED
|
@@ -26,5 +26,13 @@ public class Plugin: CAPPlugin {
|
|
|
26
26
|
ContactPlugin().addContact(call)
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
@objc func checkSeoulTimeZone(_ call: CAPPluginCall) {
|
|
30
|
+
TimeZonePlugin().checkSeoulTimeZone(call)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@objc func timezone(_ call: CAPPluginCall) {
|
|
34
|
+
TimeZonePlugin().timezone(call)
|
|
35
|
+
}
|
|
36
|
+
|
|
29
37
|
}
|
|
30
38
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import Capacitor
|
|
3
|
+
import Contacts
|
|
4
|
+
/**
|
|
5
|
+
* Please read the Capacitor iOS Plugin Development Guide
|
|
6
|
+
* here: https://capacitorjs.com/docs/plugins/ios
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
public class TimeZonePlugin: CAPPlugin {
|
|
10
|
+
private let implementation = TimeZoneService()
|
|
11
|
+
|
|
12
|
+
@objc func checkSeoulTimeZone(_ call: CAPPluginCall) {
|
|
13
|
+
implementation.checkSeoulTimeZone(call: call)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@objc func timezone(_ call: CAPPluginCall) {
|
|
17
|
+
implementation.timezone(call: call)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import UIKit
|
|
3
|
+
|
|
4
|
+
import Capacitor
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
public class TimeZoneService: NSObject {
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
TimeZone 서울 여부 확인
|
|
12
|
+
*/
|
|
13
|
+
public func checkSeoulTimeZone(call: CAPPluginCall) {
|
|
14
|
+
call.resolve([
|
|
15
|
+
"result": TimeZone.current.identifier.description.lowercased().contains("seoul"),
|
|
16
|
+
])
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
TImeZone 반환
|
|
21
|
+
*/
|
|
22
|
+
public func timezone(call: CAPPluginCall) {
|
|
23
|
+
call.resolve([
|
|
24
|
+
"result": TimeZone.current.identifier,
|
|
25
|
+
])
|
|
26
|
+
}
|
|
27
|
+
}
|