flexn-io / renative

🚀🚀🚀 Unified Development Platform for iOS, tvOS, Android, Android TV, Android Wear, Web, Tizen TV, Tizen Watch, Tizen Mobile, LG webOS, macOS/OSX, Windows, KaiOS, FirefoxOS Firefox TV platforms
https://renative.org
MIT License
1.82k stars 180 forks source link

Tizen webapis access #713

Open MomoDeLuxe opened 3 years ago

MomoDeLuxe commented 3 years ago

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

mihaiblaga89 commented 3 years ago

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.

MomoDeLuxe commented 3 years ago

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 commented 3 years ago

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

mihaiblaga89 commented 3 years ago

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.

MomoDeLuxe commented 3 years ago

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

mihaiblaga89 commented 3 years ago

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?

MomoDeLuxe commented 3 years ago

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 commented 3 years ago

Well, ReNative v 0.32.1 webapis API ARE PRESENTED :)

SimoneCarnio commented 2 years ago

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 commented 2 years ago

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)