I'm trying to create a React App that runs on a Tizen OS-based device. And I need to use the B2B APIs and Web APIs for Printing and getting device information.
All the guides provided have used Web App mode in Tizen Studio but no mention of how to use the libraries in React.
index.html
<script type='text/javascript' src='$B2BAPIS/b2bapis/b2bapis.js'></script>
<script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script>
config.xml:
<tizen:privilege name="http://developer.samsung.com/privilege/serialport"/>
<tizen:privilege name="http://developer.samsung.com/privilege/productinfo"/>
Guides have mentioned adding the above in the index.html and config.xml files. But I don't think we can use the library in the React app with the above approach.
How do I get access to these two API Javascript Libraries for React?
Tizen web applications require specific structure including config.xml file including privileges and other settings. I think you need to create Tizen wrapper application around your React application to make it work on Tizen.
I'm not familiar with React, but if you have already React application, I would do it this way:
I think that application should be runnable on Tizen at this point.
Then you should be able to easily apply config.xml and index.html you've mentioned in question and use Tizen APIs in your application.