* [FIX] Single message thread inserting thread without rid (#1999) * [FIX] ThreadMessagesView crashing on load (#1997) * [FIX] Saml (#1996) * [FIX] SAML incorrect close * [FIX] Pathname Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] Change user own status (#1995) * [FIX] Change user own status * [IMPROVEMENT] Set activeUsers Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] Loading all updated rooms after app resume (#1998) * [FIX] Loading all updated rooms after app resume * Fix room date on RoomItem Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] Change notifications preferences (#2000) * [FIX] Change notifications preferences * [IMPROVEMENT] Picker View * [I18N] Translations * [FIX] Picker Selection * [FIX] List border * [FIX] Prevent crash * [FIX] Not-Pref tablet * [FIX] Use same style of LanguageView * [IMPROVEMENT] Send listItem title Co-authored-by: Diego Mello <diegolmello@gmail.com> * Bump version to 4.6.1 (#2001) * [FIX] DM header blink (#2011) * [FIX] Split get settings into two requests (#2017) * [FIX] Split get settings into two requests * [FIX] Clear settings only when change server * [IMPROVEMENT] Move the way to clear settings * [REVERT] Revert some changes * [FIX] Server Icon Co-authored-by: Diego Mello <diegolmello@gmail.com> * [REGRESSION] Invite Links (#2007) Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] Read only channel/broadcast (#1951) * [FIX] Read only channel/broadcast * [FIX] Roles missing * [FIX] Check roles to readOnly * [FIX] Can post * [FIX] Respect post-readonly permission * [FIX] Search a room readOnly Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] Cas auth (#2024) Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] Login TOTP Compatibility to older servers (#2018) * [FIX] Login TOTP Compatibility to older servers * [FIX] Android crashes if use double negation Co-authored-by: Diego Mello <diegolmello@gmail.com> * Bump version to 4.6.4 (#2029) Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] Lint (#2030) * [FIX] UIKit with only one block (#2022) * [FIX] Message with only one block * [FIX] Update headers Co-authored-by: Diego Mello <diegolmello@gmail.com> * Bump version to 4.7.0 (#2035) * [FIX] Action Tint Color on Black theme (#2081) * [FIX] Prevent crash when thread is not found (#2080) Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] Prevent double click (#2079) Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] Show slash commands when disconnected (#2078) Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] Backhandler onboarding (#2077) Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] Respect UI_Allow_room_names_with_special_chars setting (#2076) Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] RoomsList update sometimes isn't fired (#2071) Co-authored-by: Diego Mello <diegolmello@gmail.com> * [IMPROVEMENT] Stop inserting last message as message object from rooms stream if room is focused (#2069) * [IMPROVEMENT] No insert last message if the room is focused * fix discussion/threads Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] Hide system messages (#2067) Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] Pending update (#2066) Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] Prevent crash when room.uids was not inserted yet (#2055) Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FEATURE] Save video (#2063) * added-feature-save-video * fix sha256 Co-authored-by: Djorkaeff Alexandre <djorkaeff.unb@gmail.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] Send totp-code to meteor call (#2050) * fixed-issue * removed-variable-name-errors * reverted-last-commit Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] MessageBox mention shouldn't show group DMs (#2049) * fixed-issue * [FIX] Filter users only if it's not a group chat Co-authored-by: Djorkaeff Alexandre <djorkaeff.unb@gmail.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] AttachmentView (Android)(Tablet) (#2047) * [fix]Tablet attachment View and Room Navigation * fix weird navigation and margin bottom Co-authored-by: Djorkaeff Alexandre <djorkaeff.unb@gmail.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] Allow special chars in Filename (#2020) * fixed-filename-issue * improve Co-authored-by: Djorkaeff Alexandre <djorkaeff.unb@gmail.com> Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] Recorded audio on Android doesn't play on iOS (#2073) * react-native-video -> expo-av * remove react-native-video * Add audio mode * update mocks * [FIX] Loading bigger than play/pause Co-authored-by: Diego Mello <diegolmello@gmail.com> * [IMPROVEMENT] Message Touchable (#2082) * [FIX] Avatar touchable * [IMPROVEMENT] onLongPress on all Message Touchables * [IMPROVEMENT] User & baseUrl on MessageContext * [FIX] Context Access * [FIX] BaseURL * Fix User Co-authored-by: Diego Mello <diegolmello@gmail.com> * [FIX] ReactionsModal (#2085) * [NEW] Delete Server (#1975) * [NEW] Delete server Co-authored-by: Bruno Dantas <oliveiradantas96@gmail.com> Co-authored-by: Calebe Rios <calebersmendes@gmail.com> * [FIX] Revert removed function Co-authored-by: Bruno Dantas <oliveiradantas96@gmail.com> Co-authored-by: Calebe Rios <calebersmendes@gmail.com> * pods * i18n * Revert "pods" This reverts commit |
||
---|---|---|
.. | ||
Core | ||
LICENSE.TXT | ||
README.md |
README.md
中文版本请参看这里
MMKV is an efficient, small, easy-to-use mobile key-value storage framework used in the WeChat application. It's currently available on Android, iOS/macOS, Win32 and POSIX.
MMKV for Android
Features
-
Efficient. MMKV uses mmap to keep memory synced with file, and protobuf to encode/decode values, making the most of Android to achieve best performance.
- Multi-Process concurrency: MMKV supports concurrent read-read and read-write access between processes.
-
Easy-to-use. You can use MMKV as you go. All changes are saved immediately, no
sync
, noapply
calls needed. -
Small.
- A handful of files: MMKV contains process locks, encode/decode helpers and mmap logics and nothing more. It's really tidy.
- About 50K in binary size: MMKV adds about 50K per architecture on App size, and much less when zipped (apk).
Getting Started
Installation Via Maven
Add the following lines to build.gradle
on your app module:
dependencies {
implementation 'com.tencent:mmkv-static:1.2.1'
// replace "1.2.1" with any available version
}
For other installation options, see Android Setup.
Quick Tutorial
You can use MMKV as you go. All changes are saved immediately, no sync
, no apply
calls needed.
Setup MMKV on App startup, say your Application
class, add these lines:
public void onCreate() {
super.onCreate();
String rootDir = MMKV.initialize(this);
System.out.println("mmkv root: " + rootDir);
//……
}
MMKV has a global instance, that can be used directly:
import com.tencent.mmkv.MMKV;
MMKV kv = MMKV.defaultMMKV();
kv.encode("bool", true);
boolean bValue = kv.decodeBool("bool");
kv.encode("int", Integer.MIN_VALUE);
int iValue = kv.decodeInt("int");
kv.encode("string", "Hello from mmkv");
String str = kv.decodeString("string");
MMKV also supports Multi-Process Access. Full tutorials can be found here Android Tutorial.
Performance
Writing random int
for 1000 times, we get this chart:
For more benchmark data, please refer to our benchmark.
MMKV for iOS/macOS
Features
-
Efficient. MMKV uses mmap to keep memory synced with file, and protobuf to encode/decode values, making the most of iOS/macOS to achieve best performance.
-
Easy-to-use. You can use MMKV as you go, no configurations needed. All changes are saved immediately, no
synchronize
calls needed. -
Small.
- A handful of files: MMKV contains encode/decode helpers and mmap logics and nothing more. It's really tidy.
- Less than 30K in binary size: MMKV adds less than 30K per architecture on App size, and much less when zipped (ipa).
Getting Started
Installation Via CocoaPods:
- Install CocoaPods;
- Open terminal,
cd
to your project directory, runpod repo update
to make CocoaPods aware of the latest available MMKV versions; - Edit your Podfile, add
pod 'MMKV'
to your app target; - Run
pod install
; - Open the
.xcworkspace
file generated by CocoaPods; - Add
#import <MMKV/MMKV.h>
to your source file and we are done.
For other installation options, see iOS/macOS Setup.
Quick Tutorial
You can use MMKV as you go, no configurations needed. All changes are saved immediately, no synchronize
calls needed.
Setup MMKV on App startup, in your -[MyApp application: didFinishLaunchingWithOptions:]
, add these lines:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// init MMKV in the main thread
[MMKV initializeMMKV:nil];
//...
return YES;
}
MMKV has a global instance, that can be used directly:
MMKV *mmkv = [MMKV defaultMMKV];
[mmkv setBool:YES forKey:@"bool"];
BOOL bValue = [mmkv getBoolForKey:@"bool"];
[mmkv setInt32:-1024 forKey:@"int32"];
int32_t iValue = [mmkv getInt32ForKey:@"int32"];
[mmkv setString:@"hello, mmkv" forKey:@"string"];
NSString *str = [mmkv getStringForKey:@"string"];
MMKV also supports Multi-Process Access. Full tutorials can be found here.
Performance
Writing random int
for 10000 times, we get this chart:
For more benchmark data, please refer to our benchmark.
MMKV for Win32
Features
-
Efficient. MMKV uses mmap to keep memory synced with file, and protobuf to encode/decode values, making the most of Windows to achieve best performance.
- Multi-Process concurrency: MMKV supports concurrent read-read and read-write access between processes.
-
Easy-to-use. You can use MMKV as you go. All changes are saved immediately, no
save
, nosync
calls needed. -
Small.
- A handful of files: MMKV contains process locks, encode/decode helpers and mmap logics and nothing more. It's really tidy.
- About 10K in binary size: MMKV adds about 10K on application size, and much less when zipped.
Getting Started
Installation Via Source
-
Getting source code from git repository:
git clone https://github.com/Tencent/MMKV.git
-
Add
Win32/MMKV/MMKV.vcxproj
to your solution; -
Add
MMKV
project to your project's dependencies; -
Add
$(OutDir)include
to your project'sC/C++
->General
->Additional Include Directories
; -
Add
$(OutDir)
to your project'sLinker
->General
->Additional Library Directories
; -
Add
MMKV.lib
to your project'sLinker
->Input
->Additional Dependencies
; -
Add
#include <MMKV/MMKV.h>
to your source file and we are done.
note:
- MMKV is compiled with
MT/MTd
runtime by default. If your project usesMD/MDd
, you should change MMKV's setting to match your project's (C/C++
->Code Generation
->Runtime Library
), or vise versa. - MMKV is developed with Visual Studio 2017, change the
Platform Toolset
if you use a different version of Visual Studio.
For other installation options, see Win32 Setup.
Quick Tutorial
You can use MMKV as you go. All changes are saved immediately, no sync
, no save
calls needed.
Setup MMKV on App startup, say in your main()
, add these lines:
#include <MMKV/MMKV.h>
int main() {
std::wstring rootDir = getYourAppDocumentDir();
MMKV::initializeMMKV(rootDir);
//...
}
MMKV has a global instance, that can be used directly:
auto mmkv = MMKV::defaultMMKV();
mmkv->set(true, "bool");
std::cout << "bool = " << mmkv->getBool("bool") << std::endl;
mmkv->set(1024, "int32");
std::cout << "int32 = " << mmkv->getInt32("int32") << std::endl;
mmkv->set("Hello, MMKV for Win32", "string");
std::string result;
mmkv->getString("string", result);
std::cout << "string = " << result << std::endl;
MMKV also supports Multi-Process Access. Full tutorials can be found here Win32 Tutorial.
MMKV for POSIX
Features
-
Efficient. MMKV uses mmap to keep memory synced with file, and protobuf to encode/decode values, making the most of POSIX to achieve best performance.
- Multi-Process concurrency: MMKV supports concurrent read-read and read-write access between processes.
-
Easy-to-use. You can use MMKV as you go. All changes are saved immediately, no
save
, nosync
calls needed. -
Small.
- A handful of files: MMKV contains process locks, encode/decode helpers and mmap logics and nothing more. It's really tidy.
- About 7K in binary size: MMKV adds about 7K on application size, and much less when zipped.
Getting Started
Installation Via CMake
-
Getting source code from git repository:
git clone https://github.com/Tencent/MMKV.git
-
Edit your
CMakeLists.txt
, add those lines:add_subdirectory(mmkv/POSIX/src mmkv) target_link_libraries(MyApp mmkv)
-
Add
#include "MMKV.h"
to your source file and we are done.
For other installation options, see POSIX Setup.
Quick Tutorial
You can use MMKV as you go. All changes are saved immediately, no sync
, no save
calls needed.
Setup MMKV on App startup, say in your main()
, add these lines:
#include "MMKV.h"
int main() {
std::string rootDir = getYourAppDocumentDir();
MMKV::initializeMMKV(rootDir);
//...
}
MMKV has a global instance, that can be used directly:
auto mmkv = MMKV::defaultMMKV();
mmkv->set(true, "bool");
std::cout << "bool = " << mmkv->getBool("bool") << std::endl;
mmkv->set(1024, "int32");
std::cout << "int32 = " << mmkv->getInt32("int32") << std::endl;
mmkv->set("Hello, MMKV for Win32", "string");
std::string result;
mmkv->getString("string", result);
std::cout << "string = " << result << std::endl;
MMKV also supports Multi-Process Access. Full tutorials can be found here POSIX Tutorial.
License
MMKV is published under the BSD 3-Clause license. For details check out the LICENSE.TXT.
Change Log
Check out the CHANGELOG.md for details of change history.
Contributing
If you are interested in contributing, check out the CONTRIBUTING.md, also join our Tencent OpenSource Plan.
To give clarity of what is expected of our members, MMKV has adopted the code of conduct defined by the Contributor Covenant, which is widely used. And we think it articulates our values well. For more, check out the Code of Conduct.
FAQ & Feedback
Check out the FAQ first. Should there be any questions, don't hesitate to create issues.