deep-linkingtizensamsung-smart-tvtizen-web-app

How to prevent reload on Tizen Public Preview Deeplink?


I'm writing a web app for Tizen Smart TV. One of the required features is implementing the Smarthub Public Preview deeplinking. I have setup the app to open at a specific content when the Public preview tile is clicked. However, I cannot prevent the app to reload. The documentation mentions adding the appcontrol event to the window event listeners, but I don't think this event is being recognized by the app, since the code is not executed. It only works if I directly add my deeplink() method to the onload property.

According to documentation, this piece of code should prevent the app to reload, but it is not working:

<tizen:app-control>
  <tizen:src name='index.html' reload='disable'></tizen:src>
  <tizen:operation name='http://samsung.com/appcontrol/operation/eden_resume'></tizen:operation> 
</tizen:app-control>

window eventListener is not working wither:

onload="window.addEventListener('appcontrol', deepLink)"

Any help on how to implement this correctly?

Thank you in advance


Solution

  • You are probably modyfing window.location in the app (ie in router).

    reload='disable' prevents reloading index.html. When application receives app control request and page is different, application will be reloaded.

    You can find more about appcontrol in Tizen documentation (note that Tizen for TV may differ from other devices): https://docs.tizen.org/application/web/guides/app-management/app-controls/