How to use the react-native-send-intent.sendSms function in react-native-send-intent

To help you get started, we’ve selected a few react-native-send-intent examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github celo-org / celo-monorepo / packages / mobile / src / escrow / EscrowedPaymentListItem.tsx View on Github external
onRemind = () => {
    const { payment, t } = this.props
    const recipientPhoneNumber = payment.recipientPhone
    CeloAnalytics.track(CustomEventNames.clicked_escrowed_payment_send_message)
    // TODO: open up whatsapp/text message slider with pre populated message
    try {
      if (Platform.OS === 'android') {
        SendIntentAndroid.sendSms(recipientPhoneNumber, t('walletFlow5:escrowedPaymentReminderSms'))
      } else {
        // TODO look into using MFMessageComposeViewController to prefill the body for iOS
        navigateToURI(`sms:${recipientPhoneNumber}`)
      }
    } catch (error) {
      // TODO: use the showError saga instead of the Logger.showError, which is a hacky temp thing we used for a while that doesn't actually work on iOS
      Logger.showError(ErrorMessages.SMS_ERROR)
      Logger.error(TAG, `Error sending SMS to ${recipientPhoneNumber}`, error)
    }
  }
  onReclaimPayment = () => {
github celo-org / celo-monorepo / packages / mobile / src / invite / saga.ts View on Github external
return new Promise((resolve, reject) => {
    try {
      if (Platform.OS === 'android') {
        SendIntentAndroid.sendSms(toPhone, msg)
        resolve()
      } else {
        // react-native-sms types are incorrect
        // tslint:disable-next-line: no-floating-promises
        SendSMS.send(
          {
            body: msg,
            recipients: [toPhone],
          },
          (completed, cancelled, error) => {
            if (!completed) {
              reject(new Error(`Couldn't send sms: isCancelled: ${cancelled} isError: ${error}`))
            } else {
              resolve()
            }
          }

react-native-send-intent

React Native Android module to use Android's Intent actions for send sms, text to shareable apps, open custom apps, make phone calls and etc

MIT
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis