0

How can I make calls or send SMS and Email messages with React Native Expo framework?

I am contemplating between using Expo or not and one of the concerns - support of some third-party libs. Typically with react native you would use well written Communications library. Can I use it with Expo project or I should use something else?

Andrei
  • 42,814
  • 35
  • 154
  • 218

1 Answers1

3

The react-native-communications library would work just fine with Expo -- it is just JavaScript and depends on the "Linking" API. If you're curious about why this works, you can see some more information on how Linking works in Expo in the Linking guide. But go ahead and use react-native-communications if that covers your use case!

brentvatne
  • 7,603
  • 4
  • 38
  • 55
  • Just found it! Thanks! – Andrei Jul 05 '17 at 18:14
  • @brentvatne I am trying to use react-native-communications for sending SMS with Expo, but the application crashes (android Genymotion emulator on Windows), with the following error: "Attempt to invoke virtual method 'boolean java.lang.String.endsWith(java.lang.String)' on a null object reference". The code is: "import Comm from 'react-native-communications';" and "Comm.text('123456789', 'msg');" I also tried "Comm.text('sms:+123456789', 'msg');", same error. Did you do anything else? – Yossi May 15 '18 at 07:11
  • Apparently you might have needed to use the non-standard `tel://...` (at least with certain versions of React Native?): https://stackoverflow.com/a/50628917/495319 – Wodin May 31 '20 at 03:18
  • Have just tried the following on an Android phone and it works for me: https://stackoverflow.com/a/60347445/495319 – Wodin May 31 '20 at 03:24