vk_bridge 1.2.6+1 copy "vk_bridge: ^1.2.6+1" to clipboard
vk_bridge: ^1.2.6+1 copied to clipboard

outdated

A dart package for working with VK Mini Apps via VK Bridge. Works web, mobile-web

VK Bridge #

A package for integrating Flutter VK Mini Apps with official VK clients for iOS, Android and Web.

This package is a wrapper around official VK-Bridge JS package.

Usage #

On app start call VKBridge.instance.init() method before runApp to ensure correct VK Bridge initialization.

import 'package:vk_bridge/vk_bridge.dart';

Future<void> main() async {
  await VKBridge.instance.init();

  runApp(MyApp());
}

Add this part of code in your index.html before Flutter part.


<script src="https://unpkg.com/@vkontakte/vk-bridge/dist/browser.min.js"></script>

<script>
    vkBridge.subscribe((event) => {
        if (window.vkBridgeDartListener != null) {
            window.vkBridgeDartListener(event.detail);
        }
    });
</script>

<script src="main.dart.js" type="application/javascript"></script>

To add logger use VKBridge.instance.setLogger().

Original VK Bridge documentation: https://vk.com/dev/vk_bridge_events #

Original VK Bridge JS package: https://github.com/VKCOM/vk-bridge #

23
likes
0
pub points
46%
popularity

Publisher

verified publisheroptimist.dev

A dart package for working with VK Mini Apps via VK Bridge. Works web, mobile-web

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

built_collection, built_value, js, meta, rxdart

More

Packages that depend on vk_bridge