@hanwha-ss1/sharedpreference
v0.0.1
Published
SharedPreference
Downloads
1
Readme
capacitor-plugin-hanwha-sharedpreference
SharedPreference
Install
npm install capacitor-plugin-hanwha-sharedpreference
npx cap sync
Example
SharedPreference.configuration({ appgroup: 'group.akde.kd.com', iv: '' });
// Set
await SharedPreference.set({
key: 'currentUserInfo2',
value: '저장',
encrypt: true,
});
// Get
const { results } = await SharedPreference.get({
key: 'currentUserInfo2',
default: '11',
encrypt: true,
});
API
configuration(...)
configuration(options: { appgroup: string; iv: string; }) => Promise<any>
SharedPreference를 사용하기 위한 기본값 세팅
| Param | Type | Description |
| ------------- | ---------------------------------------------- | -------------------------------- |
| options
| { appgroup: string; iv: string; } | - appgroup: 앱그룹아이디, iv: AES IV 값 |
Returns: Promise<any>
Since: 1.0.0
getAll()
getAll() => Promise<any>
모든 SharedPreference를 값 출력
Returns: Promise<any>
get(...)
get(options: { key: string; default: string; encrypt?: boolean; }) => Promise<any>
Key에 매핑되는 SharedPreference 값 출력
| Param | Type | Description |
| ------------- | ----------------------------------------------------------------- | ---------------------------------------------------- |
| options
| { key: string; default: string; encrypt?: boolean; } | - key: key, default: 기본값, encrypt: 암호화여부(true/false) |
Returns: Promise<any>
Since: 1.0.0
set(...)
set(options: { key: string; value: string; encrypt?: boolean; }) => Promise<any>
Key에 매핑되는 SharedPreference 값 저장
| Param | Type | Description |
| ------------- | --------------------------------------------------------------- | -------------------------------------------------- |
| options
| { key: string; value: string; encrypt?: boolean; } | - key: key, value: 저장값, encrypt: 암호화여부(true/false) |
Returns: Promise<any>
Since: 1.0.0
delete(...)
delete(options: { key: string; }) => Promise<any>
Key에 매핑되는 SharedPreference 값 삭제
| Param | Type | Description |
| ------------- | ----------------------------- | ----------- |
| options
| { key: string; } | - key: key |
Returns: Promise<any>
Since: 1.0.0
deleteAll()
deleteAll() => void
모든 SharedPreference 값 삭제
Since: 1.0.0