expo-sms
provides access to the system's UI/app for sending SMS messages.Android Device | Android Emulator | iOS Device | iOS Simulator | Web |
---|---|---|---|---|
expo install expo-sms
If you're installing this in a bare React Native app, you should also follow these additional installation instructions.
import * as SMS from 'expo-sms';
Boolean
, indicating whether SMS is available on this device.const isAvailable = await SMS.isAvailableAsync(); if (isAvailable) { // do your SMS stuff here } else { // misfortune... there's no SMS available on this device }
Promise
that resolves when the SMS action is invoked by the user, with corresponding result:{ result: 'cancelled' }
.{ result: 'sent' }
.{ result: 'unknown' }
.Promise
will always resolve with { result: 'unknown' }
.const { result } = await SMS.sendSMSAsync( ['0123456789', '9876543210'], 'My sample HelloWorld message' );