-
-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
During Development Tizen object isn't available on Tv #1719
Comments
@youssefali424 thanks for reporting, this is planned to be looked at in the next 2 weeks |
Hello @youssefali424, |
@Marius456 yes that is the issue here, i was trying to figure a way to use a single html file in development using iframe instead of redirecting to new html, as Tizen API is only available in index.html for security reasons |
Hello @youssefali424, <html>
<head>
<!-- <meta http-equiv="refresh" content="0;url={{DEV_SERVER}}" /> -->
</head>
<body>
<iframe
id="frameTizen"
src="{{DEV_SERVER}}?somedata=tizenMemory"
></iframe>
<script>
var zxc = document.getElementById('frameTizen');
zxc.src = '{{DEV_SERVER}}?somedata=' + tizen.systeminfo.getTotalMemory();
</script>
</body>
</html> And use it const [tizenMemory, setTizenMemoryState] = useState('');
const params = location.href.split('?')[1].split('&');
const data = {};
let tizenTotalMemory = '';
for (const x in params) {
data[params[x].split('=')[0]] = params[x].split('=')[1];
tizenTotalMemory = params[x].split('=')[0];
}
setTizenMemoryState(data[tizenTotalMemory]); |
I do understand that, but this will affect production code, i mean you cant do that with the production code as it wont be in iframe |
Describe the bug
The tizen object was always undefined during development, After researching why this happens it appear that the tizen object is only provided to index.html in the tizen project, during development public/index.html is used to allow refreshing when files are updated, but this leads to tizen object being undefined in public/index.html and only available in index.html
To Reproduce
Steps to reproduce the behavior:
npx rnv run -p tizen
Expected behavior
Through development we can access tizen object
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: