sparkFinder sparkFinder - 1 year ago 221
iOS Question

Twilio on cross platform mobile tools (Ionic, React-Native)

I'm looking to build with Twilio's IP Messaging APIs using a cross mobile framework like React Native or Ionic. My question is - is this a sane request? I see that Twilio has a Javascript library that I plan to use. Examples of successes/failures would also help.

My overall goal is to build in simple chat rooms cross platform.

Answer Source

The current solution is to implement a native module for Twilio Messaging. Check Twilio's IPM docs for their iOS quickstart. There are too many libraries that the Twilio Node SDK uses that conflict with Apple's JavaScriptCore runtime.

Your native module would communicate with the React Native app through the RN bridge. At a high level you'd have to implement sendMessage/joinChannel from RN -> iOS and receivedMessage/Channel from iOS -> RN.

One example (that I've communicated to the Twilio team) is that their JS SDKs break when npm-V8 centric deps like crypto can't be ported. I'm guessing there are several other basic libraries that are commonplace in Node that don't get ported over by React Native's build system.

You can track related React Native issues here: (Symptom - node modules are missing):