Forum Discussion

slingxshot's avatar
slingxshot
Streaming Star
8 years ago

Restart Application

I have a logout button, and I want to restart application, possibly go back all the way to main.brs... anyway to reload the app or reload the scene?

Thanks!

5 Replies

  •   appId = createObject("roAppInfo").getID()
      url = substitute("http://localhost:8060/launch/{0}?restart=true", appId)
      launchRequest = createObject("roUrlTransfer")
      launchRequest.setUrl(url)
      launchRequest.postFromString("")

    It's probably not everybody's cup of tea, but in the most literal sense this will actually restart your application as opposed to other approaches where you try to clean up state and reload your SceneGraph components.
    • ramoneariel's avatar
      ramoneariel
      Channel Surfer

      This option works perfectly fine until Roku 11.50, but not from version 12.0.0. Return status 403,

      ECP is not allowed from loopback address

       

      • EnTerr's avatar
        EnTerr
        Roku Guru

        everyone facing such need, pls open ticket with partner success at roku.com, as to draw attention to the issue 

  • slingxshot's avatar
    slingxshot
    Streaming Star
    Doesn't seem to be a good way to restart application. The scenes just go on top, and trying closing the scene, exits the app or causes errors. There is probably a way so not worth. Instead I just exit the app and let the user go back in.

    https://github.com/rymawby/roku-app-exit
  • slingxshot's avatar
    slingxshot
    Streaming Star
    Oh man I wish i saw this earlier. This helps me a lot, solves 2 problems at once. I wanted to have authentication completed separate from the main app and this allows me after authentication restart the app and reset all settings with the registry, etc. Thank You!