Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Load new scene when coming back to app from the browser.

Discussion in 'Editor & General Support' started by slow_izzm, Feb 9, 2018.

  1. slow_izzm

    slow_izzm

    Joined:
    Feb 9, 2018
    Posts:
    9
    I am directing the user out to a website via Application.OpenURL ...

    my question is, how do I load a specific scene when user goes comes back to the app from the browser, instead of coming back to the same scene they left when they were sent out?

    I’m currently developing ios side of app, but want to know for android as well.
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
  3. slow_izzm

    slow_izzm

    Joined:
    Feb 9, 2018
    Posts:
    9
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    So that method gets called on all gameobjects whenever your application gains or loses focus. There's some additional notes there regarding some android keyboard behavior. What I would think would be the way to go would be to set something when you launch the browser page, and on some object in OnApplicationFocus you would switch scenes only if you had recently launched the browser and focus was true.
     
  5. slow_izzm

    slow_izzm

    Joined:
    Feb 9, 2018
    Posts:
    9
    Ahh, yes that makes sense. Thank you.