renative icon indicating copy to clipboard operation
renative copied to clipboard

Tizen webapis access

Open MomoDeLuxe opened this issue 4 years ago • 10 comments

It doesn't work with me to access Tizen webapis API. Any solution for that?1

MomoDeLuxe avatar Sep 13 '21 00:09 MomoDeLuxe

Can you please provide more details about where/how you expect the tizen apis to be available? They should work, code, you should have global.tizen and global.webapis available.

mihaiblaga89 avatar Nov 13 '21 12:11 mihaiblaga89

Well in debug mode webapis is not available, thought it is common. Had to you use static DEV params and it works. But, is there is any way to access webapis in DEV mode?!

MomoDeLuxe avatar Nov 13 '21 12:11 MomoDeLuxe

Mind that app shell doesn't include $WEBAPIS script tag in header.

MomoDeLuxe avatar Nov 13 '21 12:11 MomoDeLuxe

The code that I referenced, the appShell thing which waits for 5s and then loads the webpack-dev-server URL that's running on your machine, only runs on DEV mode. So I'm guessing they should be available. Do a console.log(typeof webapis, typeof global.webapis, typeof document.webapis) and see what it says. Or the same console with .tizen instead of webapis. That code is basically injecting those variables into the iframe, so if the TV provides them they will be present.

mihaiblaga89 avatar Nov 13 '21 12:11 mihaiblaga89

I did, but always webapis undefined in debug mode, while .tizen is there as will well as .avplay

MomoDeLuxe avatar Nov 13 '21 13:11 MomoDeLuxe

then I'm guessing it's a limitation by the tv? If it exists it should be injected. But I think you can debug prod applications with weinre. Can you try to run your prod version with --debug weinre and see what happens?

mihaiblaga89 avatar Nov 13 '21 16:11 mihaiblaga89

Got the same behavior. I did find the way around by implementing debug static params also had to build on screen debug module.

Screenshot 2021-11-13 at 22-03-08 Hello MOOV

MomoDeLuxe avatar Nov 13 '21 20:11 MomoDeLuxe

Well, ReNative v 0.32.1 webapis API ARE PRESENTED :)

MomoDeLuxe avatar Nov 19 '21 21:11 MomoDeLuxe

It's not very clear to me how to access tizen object, for example, how to access this?

tizen.application.getCurrentApplication().exit();

when I try to access the "application" property (also in chrome devtools) the tv app instantly crashes without any error message

SimoneCarnio avatar Dec 27 '21 21:12 SimoneCarnio

It's not very clear to me how to access tizen object, for example, how to access this?

tizen.application.getCurrentApplication().exit();

when I try to access the "application" property (also in chrome devtools) the tv app instantly crashes without any error message

just realised that with "bundleAssets": true in the debug scheme it works, when using appShell it crash (renative 0.33)

SimoneCarnio avatar Dec 28 '21 01:12 SimoneCarnio