5 ms·
I've ran through most of the intro doc, but I'm still not sure if Exponent supports invoking platform/system APIs? E.g. if I want to access clipboard contents,
by fredliu 10y ago
I've ran through most of the intro doc, but I'm still not sure if Exponent supports invoking platform/system APIs? E.g. if I want to access clipboard contents, or wifi network configuration, etc, how can it be done with Exponent? With React Native, I can write corresponding functionalities using Java or Swift/ObjC, and then integrate it with the RN main app, but how can this be done with Exponent?
- ccheever 10y agoHi- Exponent exposes all of the React Native built-in APIs which encompass a lot of what you're asking about. For example, here is the Clipboard API: https://facebook.github.io/react-native/docs/clipboard.html https://facebook.github.io/react-native/docs/clipboard.html Wifi network configuration is more complicated, but there are some things exposed like "NetInfo" which lets you know the current state of connectivity. https://facebook.github.io/react-native/docs/netinfo.html https://facebook.github.io/react-native/docs/netinfo.html The complete React Native docs are here: https://facebook.github.io/react-native/ https://facebook.github.io/react-native/ and Exponent specific docs are here: http://docs.getexponent.com/ http://docs.getexponent.com/ For now, Exponent just lets you write things that only use JS, and we make that easy and reliable and straightforward. We actually think this is the best way to write most apps that can be built this way since the code is easier to maintain and works cross platform, and you can do things like instant updates much more reliably when all your code is JS. We're looking at a way you can write Java/Swift/Obj-C extensions for Exponent, but that will take us some time.
- fredliu 10y agoThanks a lot for the explanation. I'll try out exponent and see how far I can go without resolving to native :)
- jameside 10y agoHi Fred, I work on Exponent. With Exponent you write just JavaScript. In addition to most of the APIs that come with React Native, Exponent provides several APIs (https://docs.getexponent.com/versions/latest/sdk/index.html https://docs.getexponent.com/versions/latest/sdk/index.html) and we're steadily adding more. If there's a native API we don't have yet that developers need, they tell us about it and we add it to our roadmap. Exponent is open-source, too, so if you needed to you could fork it and write your own native code or make a raw React Native app. We recommend writing pure JS apps if you can, though. At Exponent we write native code so other people don't have to.
- fredliu 10y agoThis is great, good to know the options are there, can't wait to try it out!