| PixLab  & FACEIO | Knowledge Sharing & Public Forums


Urgent Help Needed: Integrating FaceIO with React Mobile App for Hackathon

Asked
Modified
Viewed 20732 times
3

I am working on a hackathon project implementing FaceIO into our React mobile app. I only have a few days to work on the project and I've gotten stuck on the constructor "const faceio = new faceIO('app-public-id')". The only other change to the page is the import "import faceIO from '@faceio/fiojs';" which works fine until I add the previous line mentioned above. (These changes based on example here: https://github.com/symisc/faceio-npm). Any thoughts? Thanks!


Accepted Solution

16

Hello,

  • First and foremost React != React Native This should help you to dig around and will of course help to why the document is not available.
  • The fio.js library is intended for web or mobile applications that run in the browser. When running in the context of a browser, the document element is available by default.
  • Now, the fix is to install the React Webview component and instantiate fio.js inside the Webview.
  • Refer to the forum question at: How Do I Implement FACEIO (fio.js) on My React Native App? for additional information.