Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lingol authored May 26, 2021
1 parent b7d0e5a commit 217970f
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions flutter/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![license](https://img.shields.io/badge/license-BSD_3-brightgreen.svg?style=flat)](https://github.com/Tencent/MMKV/blob/master/LICENSE.TXT)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/MMKV/pulls)
[![Release Version](https://img.shields.io/badge/release-1.2.8-brightgreen.svg)](https://github.com/Tencent/MMKV/releases)
[![Release Version](https://img.shields.io/badge/release-1.2.10-brightgreen.svg)](https://github.com/Tencent/MMKV/releases)
[![Platform](https://img.shields.io/badge/Platform-%20Android%20%7C%20iOS-brightgreen.svg)](https://github.com/Tencent/MMKV/wiki/home)

MMKV is an **efficient**, **small**, **easy-to-use** mobile key-value storage framework used in the WeChat application. It's currently available on **Android** and **iOS**.
Expand Down Expand Up @@ -35,9 +35,9 @@ If you already include MMKV native lib in your App, you need to upgrade to versi
#### iOS
To avoid conflict of the native lib name 'libMMKV.so' on iOS, we need to **change the plugin name 'mmkv' to 'mmkvflutter'**.

##### For a purely flutter App:
* Add this function `fix_mmkv_plugin_name()` to `ios/Podfile`, invoke it **before** calling any `flutter_xxx()` functions. Run `pod install` and we are all set.
* **Note**: you need to run `pod install` each time you have called `flutter pub get`, or has just returned to Xcode from Android Studio.
##### For a purely flutter App:
* Add this function `fix_mmkv_plugin_name()` to `ios/Podfile`, invoke it **before** calling any `flutter_xxx()` functions. Run `pod install` and we are all set.
* **Note**: you need to run `pod install` each time you have called `flutter pub get`, or has just returned to Xcode from Android Studio.
* We recommend **using Xcode** to debug iOS App.

```ruby
Expand All @@ -63,9 +63,9 @@ end
fix_mmkv_plugin_name(File.dirname(File.realpath(__FILE__)))
```

##### For using flutter as a module:
##### For using flutter as a module:
* For **[embding flutter](https://flutter.dev/docs/development/add-to-app/ios/project-setup#embed-the-flutter-module-in-your-existing-application)** to your existing iOS App, add the function `fix_mmkv_plugin_name()` above to your iOS App's `Podfile`, invoke it **before** calling any `flutter_xxx()` functions. Run `pod install` and we are all set.
* **Note**: you need to run `pod install` each time you have called `flutter pub get`, or has just returned to Xcode from Android Studio.
* **Note**: you need to run `pod install` each time you have called `flutter pub get`, or has just returned to Xcode from Android Studio.
* We recommend **using Xcode** to debug iOS App.

```ruby
Expand Down Expand Up @@ -146,12 +146,12 @@ Note that you have to **wait for MMKV to finish initialization** before accessin
bytes.destroy();
```

As you can see, MMKV is quite easy to use.

**Note**: If you come across to failing to load `defaultMMKV()` **on Android** after **upgrading** Flutter from 1.20+ to 2.0+, you can try passing this encryption key `'\u{2}U'` instead.

```dart
var mmkv = MMKV.defaultMMKV(cryptKey: '\u{2}U');
As you can see, MMKV is quite easy to use.

**Note**: If you come across to failing to load `defaultMMKV()` **on Android** after **upgrading** Flutter from 1.20+ to 2.0+, you can try passing this encryption key `'\u{2}U'` instead.

```dart
var mmkv = MMKV.defaultMMKV(cryptKey: '\u{2}U');
```

* **Deleting & Querying**:
Expand Down

0 comments on commit 217970f

Please sign in to comment.