diff --git a/CHANGELOG.md b/CHANGELOG.md index 3eec45c6..c9cb463c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,13 +49,22 @@ For Flutter you can use [flutter_vodozemac](https://pub.dev/packages/flutter_vod just needs to be initialized **once**: ```dart -import 'package:flutter_vodozemac/flutter_vodozemac' as vod; +import 'package:flutter_vodozemac/flutter_vodozemac.dart' as vod; // ... await vod.init(); -final client = Client(/*...*/); +final client = Client('Matrix Client', + // ... + // ... + nativeImplementations: NativeImplementationsIsolate( + compute, + // Also init in NativeImplemenetations if you use it there: + vodozemacInit: () => vod.init(), + ), + // ... +); ``` This should work on Android, iOS, macOS, Linux and Windows. diff --git a/doc/end-to-end-encryption.md b/doc/end-to-end-encryption.md index ac848cd3..8879535d 100644 --- a/doc/end-to-end-encryption.md +++ b/doc/end-to-end-encryption.md @@ -26,4 +26,21 @@ final client = Client(/*...*/); This should work on Android, iOS, macOS, Linux and Windows. -For web you need to compile vodozemac to wasm. [Please refer to the Vodozemac bindings documentation](https://pub.dev/packages/vodozemac#build-for-web). \ No newline at end of file +For web you need to compile vodozemac to wasm. [Please refer to the Vodozemac bindings documentation](https://pub.dev/packages/vodozemac#build-for-web). + +### Using Vodozemac with NativeImplementations + +When using NativeImplementations you have to initialize Vodozemac there as well. +Just pass the same init function to it: + +```dart +final client = Client('Matrix Client', + // ... + // ... + nativeImplementations: NativeImplementationsIsolate( + compute, + vodozemacInit: () => vod.init(), + ), + // ... +); +``` \ No newline at end of file