Home > other >  React Native Linking simultaneously for mail AND sms
React Native Linking simultaneously for mail AND sms

Time:02-16

Is it possible to Linking.openUrl() for both mail and sms ? I'd like my user to choose between those app and prefill information in the body.

Linking.openURL('mailto:[email protected]?subject=SendMail&body=Description') does suggest mail apps

Linking.openURL('sms:number?body=Description') does suggest sms apps

Is there a way to have both app proposed to the user while being prefilled with Description ?

CodePudding user response:

Sounds like you are looking for "Share" functionality.

See the official React Native Share Docs, or this popular third party library.

CodePudding user response:

FOR mail

Linking.openURL('mailto:[email protected]?subject=SendMail&body=Description')

FOR sms

Linking.openURL('sms:number?body=yourMessage?subject=SendMail&body=Description')

If this information not enough; you should be 3.part package like;

https://github.com/flexible-agency/react-native-email-link

or

React Native Share.

  • Related