How to handle sponsor buttons in preloader?

The preloader obviously appears faster then the API becomes available.
How do you set up the Y8 button in preloader screen then? (I need _protection.isSprosor() to know if it should be active)
Should I not show the preloader before api loads? Or just hide the buttons? Or should I check domain manually?

1 Like

Hi, Do you mean the id.net ad preloader? Because that will appear as the API becomes available. If you mean a personal preloader, there will be a short period where the sponsor buttons are clickable.

Basically, setup is like this:

  1. have default variables isSponsor is false
  2. Once you get the protection event in handleIDNET, update your isSponsor variable
  3. Anytime a button is clicked, check your isSponsor variable

Load the id.net API in your preloader / first frame and it should be available in under 1 second in most cases.

2 Likes

Thanks, that answers my question. Iā€™m using a personal preloader and I wanted to know what to do those first 1-3 second while the api loads.

1 Like
Y8 Games