Error with "previous page" button with PlayCanvas

Does anyone know if there is an event that can be subscribed to for when someone goes back to the previous page and refocuses on a PlayCanvas app? I have done this on mobile after redirecting the player to another page on a button press (just swiping back on iOS). Whenever I do refocus using this method, the game sometimes slows to a crawl. In my use case people will not be hitting the previous page button very often so in the event that they do I’d like to just force a reload. Is there anyway to set something like this up? Does anyone have any thoughts on this?

Thanks,
Jake

Hi @Jake_Johnson ,

I think you can use the native browser Page Visibility API to check when your page is getting or losing focus:

3 Likes

Thanks so much this was super helpful

1 Like