ガイド
永続的なアカウントに関するチュートリアル
使用方法: @capgo/capacitor-persistent-account
Capacitor 永続アカウント プラグイン
インストール
bun add @capgo/capacitor-persistent-account
bunx cap sync
このプラグインが提供するもの
readAccount- 永続ストレージから保存されたアカウントデータを読み取ります。saveAccount- アカウントデータを永続ストレージに保存します。
例の使用
readAccount
__CAPGO_KEEP_0__の保存されたアカウントデータを永続ストレージから読み取ります。
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
__CAPGO_KEEP_0__のアカウントデータを永続ストレージに保存します。
import { CapacitorPersistentAccount } from '@capgo/capacitor-persistent-account';
await CapacitorPersistentAccount.saveAccount({
data: {
userId: '12345',
username: 'john.doe',
email: 'john@example.com'
}
});
フルリファレンス
- GitHub https://github.com/Cap-go/capacitor-persistent-account/
- ドキュメント: /docs/plugins/persistent-account/