1

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

RafaelTSCS
  • 1,234
  • 2
  • 15
  • 36
  • We are using the exact same and it is working, You can try removing other properties in config.xml and have only those required for deep link and give it a try. – Kiran Sep 26 '20 at 13:18
  • Hi, @Kiran. Thanks for answering. Are you running on a TV? Does it work in the emulator as well? The deeplink itself works, but the app is reloaded every time. I've read in the docs that this "reload" property is for mobile and wearable only. Do you confirm your app opens the link without a reload? – RafaelTSCS Sep 27 '20 at 15:14
  • I have checked on a 2018 TV and it works fine. This documentation is for Smart TV specifically and reload property is mentioned: https://developer.samsung.com/smarttv/develop/guides/smart-hub-preview/implementing-personal-preview.html. My app does not reload. – Kiran Oct 30 '20 at 17:23
  • Hi Kiran. Thanks for your answer. It happens that the app always reload in the emulator. It is working fine when running on a real device. – RafaelTSCS Nov 02 '20 at 12:48

2 Answers2

1

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/

winGuETA
  • 46
  • 3
  • Hi, @winGuETA, thanks for your response. I am modifying location.hash. But even if I'm not, the appcontrol event is never triggered. – RafaelTSCS Oct 01 '20 at 12:24
  • 1
    You can check the official sample: https://github.com/SamsungDForum/SampleWebApps-PublicPreview/blob/master/js/main.js Accoring to your description implementation seems correct; App must be added to home, the event should be triggered when you choose another tile from preview when app is already started. – winGuETA Oct 02 '20 at 14:34
  • So, it happens that this 'appcontrol' event is only available in the actual TV. It does not work in the emulator. I did not have access to a real TV at that moment, but I could just try it on one now and it worked. Thanks @winGuETA – RafaelTSCS Oct 16 '20 at 19:22
0

I've got some information regarding your question.

To do application resume without Page reload, Set extra data in app-control like below

  • key: SkipReload
  • value: Yes
Lunch Basketball
  • 432
  • 6
  • 10
  • Hi, thanks for your answer, but that data is not recognized by TizenStudio at all. It can't compile if I add it. Anyways, the issue only happens in the emulator, so I guess it will always reload the app there. – RafaelTSCS Oct 16 '20 at 19:36