Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: initialization
  • Loading branch information
NathanWalker committed Jan 31, 2023
commit d44f8b0f99172413124a21c2199b1b5557b314c4
1 change: 1 addition & 0 deletions packages/mmkv/index.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ declare function double(value: number);
export class NSCMMKV implements INSCMMKV {
#native: com.tencent.mmkv.MMKV;
constructor(options?: { id?: string; path?: string; encryptionKey?: string; mode?: 'SINGLE' | 'MULTI' }) {
com.tencent.mmkv.MMKV.initialize(Utils.android.getApplicationContext());
if (!options) {
this.#native = com.tencent.mmkv.MMKV.defaultMMKV();
} else {
Expand Down
1 change: 1 addition & 0 deletions packages/mmkv/index.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ function intoString(value: NSData) {
export class NSCMMKV implements INSCMMKV {
#native: MMKV;
constructor(options?: { id?: string; path?: string; encryptionKey?: string; mode?: 'SINGLE' | 'MULTI' }) {
MMKV.initializeMMKV(null);
if (!options) {
this.#native = MMKV.defaultMMKV();
} else {
Expand Down