M
M
Maxim Kruchinin2021-06-19 14:07:32
PHP
Maxim Kruchinin, 2021-06-19 14:07:32

How to check that the user has logged into mini apps from VK?

I have code:

<script src="https://unpkg.com/@vkontakte/vk-bridge/dist/browser.min.js"></script>
<script>
async function yy() {
  vkBridge.send("VKWebAppGetUserInfo").then(data => {
    return document.write('3');
  });
  document.write('2');
}
yy();
</script>

For some reason, I always have true ie. it seems that return worked, but for some reason it didn't display '3', and if '3' didn't output, then why didn't it display '2'?
Please, help!
thanks in advance!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question