M
M
mletov2018-02-07 20:05:53
JavaScript
mletov, 2018-02-07 20:05:53

How to determine to receive a vk user who has visited the site?

Please tell me. I'm trying to get the vk profile of an authorized user who has logged into the site.
For some reason, only my profile is determined, for which vk id is registered, if I am authorized. Other profiles cannot be determined.
Here is the code

<html>
<head>
    <script src="//vk.com/js/api/openapi.js" type="text/javascript"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
    <script>
        window.onload = (function () {
            var appId = 1234567;
            VK.init({
                apiId: appId 
            });
            function authInfo(response) {
                if (response.session) {
                    var vkId = response.session.mid;
                    VK.api("users.get", { uids: vkId, fields: "contacts" }, function (data) {
                        console.log(data.response[0]);
                    });
                }
            }
            VK.Auth.getLoginStatus(authInfo);
        });
    </script>
</body>
</html>

If you can’t just get an authorized user account, then the question arises: There are
quite a few services that offer “Put our pixel on the site, get access to your personal account and see information about VK accounts and visitors’ phones in it.” And then on the toaster I came across questions like "I went to the online store, put the goods in the basket, but did not pay. After a while, I received a message in VK about an incomplete order and a payment reminder." In the answers, everyone referred to the vk api. How then does it work?
https://habrahabr.ru/post/234067/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Kotosin, 2018-02-09
@av_kotosin

If you were more careful, you would notice that the site uses the application initialization:

<script src="https://vk.com/js/api/openapi.js?152" type="text/javascript"></script>
<script type="text/javascript">
  VK.init({
    apiId: НОМЕР ПРЕЛОЖЕНИЯ СОЦФИШИНГА
  });
</script>

And then it's up to the small, everything is properly tied, set up. And no "clickjacking", etc. is needed here. you just need to understand the principles and capabilities of JavaScript. Or you can just pay money to developers with hands and they will realize this opportunity for you without any problems.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question