iFrame integrations
Last updated
Last updated
iFrame's do not have access to Telegram's data. Therefore, TgTaps app sends it to you via events.
You can get Telegram account data via window.parent
listener.
To do that, you need:
Register listener for TELEGRAM_DATA
event.
Send message REQUEST_TELEGRAM_DATA
to ask TgTaps
send data to your listener.
Here is example code in React:
You will get this data into your variable:
To increase user points in app's UI, you need to send message to window.parent
:
This will change balance in the game. To decrease points - send negative value (like -100).
Keep in mind: this will not change real user's balance in our API. This code is used only to sync your calls to the API and TgTaps UI (which doesn't receive real-time updates).
As you know, you can change user balance . However, when you change balance via API, the application UI does not know about updates. So you have to sync UI balance manually with changes you make to API.