R
R
redd_i2021-05-29 19:33:35
In contact with
redd_i, 2021-05-29 19:33:35

How to get user_id from VK widget?

Hello. Customers place orders on the site. There was an idea that when changing the status of an order, a message was sent to the client on behalf of the group.
To do this, you need to:
1. Get permission to send messages to the client from the group.
2. Bind the client's id to the order.

Widget "Allow to write to the community" is suitable.
https://vk.com/dev/AllowMessagesFromCommunity

Installed the widget on the site. When a client subscribes or unsubscribes, we get the user_id using VK.Observer.subscribe and bind it to the order.
That's just the problem. When placing a new order, the client is already subscribed to the newsletter, but his ID is not linked to the order.
Is it possible to somehow pull out the ID on the page? After all, the button is loaded with the desired parameter. And in its iframe-window there is such a parameter.

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