@capgo/capacitor-persistent-account を使用します。
Capacitor Persistent Account プラグイン。
インストール
bun add @capgo/capacitor-persistent-account
bunx cap sync
This Plugin Exposes
readAccount- 永続ストレージから保存されたアカウントデータを読み取ります。saveAccount- アカウントデータを永続ストレージに保存します。
Example Usage
readAccount
永続ストレージから保存されたアカウントデータを読み取ります。
import { CapacitorPersistentAccount } from '@capgo/capacitor-persistent-account';
const result = await CapacitorPersistentAccount.readAccount();
if (result.data) {
console.log('Account data:', result.data);
} else {
console.log('No account data found');
}
saveAccount
アカウントデータを永続ストレージに保存します。
import { CapacitorPersistentAccount } from '@capgo/capacitor-persistent-account';
await CapacitorPersistentAccount.saveAccount({
data: {
userId: '12345',
username: 'john.doe',
email: 'john@example.com'
}
});
Full Reference
- GitHub: https://github.com/Cap-go/capacitor-persistent-account/
- ドキュメント: /docs/plugins/persistent-account/
Keep going from Using @capgo/capacitor-persistent-account
Capacitor-__CAPGO_KEEP_1__を使用している場合 Using @capgo/capacitor-persistent-account @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-persistent-account Capacitor-capacitorの実装詳細については、@capgo/capacitor-persistent-account for the implementation detail in @capgo/capacitor-persistent-account, Getting Startedの実装詳細については、 Capacitor プラグイン ディレクトリ Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, and プラグインの追加または更新 プラグインの追加または更新の実装詳細用に