M
M
MitnikF2020-09-06 07:55:59
Mobile development
MitnikF, 2020-09-06 07:55:59

How to connect VK Bridge and send a VKWebAppInit event for a site?

Hello!

Can you please tell me how to connect VK Bridge correctly and send the VKWebAppInit event for the site?

Problem:
An application created in VK does not open on mobile devices.

This is what the TP replied:
You need to connect VK Bridge and send a VKWebAppInit event: https://vk.com/dev/vk_bridge_events?f=Initializing VK Bridge .
Without it, the application in mobile clients may not work / open the second time.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Golubev, 2020-09-06
@Static555

import bridge from '@vkontakte/vk-bridge';

bridge.send('VKWebAppInit', {});

// чтобы ловить события в консоль:
bridge.subscribe((e) => {
  console.log('bridge event', e);
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question