W
W
webvlassov2015-03-03 23:44:18
JavaScript
webvlassov, 2015-03-03 23:44:18

It is necessary to make a button, by clicking which the user will join the VK group, how to implement it?

Tried doing this.

$(".buttonVK").click(function(event){
    event.preventDefault();
    VK.init({
          apiId: 0000
    }); 
    function authInfo(response) {
    if (response.session) {
      console.log('user: '+response.session.mid);
    } else {
      console.log('not auth');
    }
  }
    VK.Auth.login(authInfo);
    VK.Auth.getLoginStatus(authInfo);
    VK.Api.call('groups.join', {group_id: 0000}, function(){});
});

I hang a click event on the button, initialize the application, and using the groups.join method, the user must join the group.
Please help me to sort out this issue, thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Evgrafovich, 2015-03-04
@Tantacula

This method is for apps only, not for websites. Place the public widget on the site, it has an entry button, whoever needs it will click. There is a second way, black and both the site itself and the public are banned for it - you make the aforementioned block invisible and put it under the cursor with a button, or above the button you need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question