Vk games friends

I am having trouble in integrating my vk game with invitation to friends on vk . Dev docs for reference - Friends | Developers | VK . Also , is this page relevant for what I am trying to do. Help .

Invites seem to be here: Invitations | Developers | VK
Good luck :sweat_smile:

I am using it for html5 game so showInviteBox method should be used , this is written there


I should use vk.callmethod . I imported their script src in index.html.
I created a button , used this function through onClick - function friends() { VK.callMethod(“showInviteBox”); } - it’s not working. What is that I am doing wrong ?

No idea :slight_smile:
You can try to open the facebook extension, maybe it’s similar…
Otherwise, maybe a javascript forum like stackoverflow.

After reading 30 seconds it seems you need to initialize the vk sdk. This seems to be the correct code:

if(typeof gdjs.vkInitied !== "undefined") {
    VK.callMethod(“showInviteBox”);
} else {
    VK.init(function() {
        VK.callMethod(“showInviteBox”);
        gdjs.vkInitied = 1;
    });
}

I use gdjs to store the global as it is what is considered good practice in GDevelop.

1 Like

I tried your method in function friends
Is there is something i am doing wrong ?