Reputation: 318
Mailto appears to not be working. All that happens is that the icon appears to be pressed, but no action occurs. Shoots out this warning:
<TouchableHighlight onPress={() => Linking.openURL('mailto:[email protected]?subject=abcdefg&body=body')}>
<Icon style={styles.icons} size={SIZE} name='envelope'/>
</TouchableHighlight>
Upvotes: 17
Views: 39140
Reputation: 171
Use this code :-
Linking.openURL(`mailto:${props.ArticleData.email}`)
Upvotes: 15
Reputation: 10232
This solution wast tested on an android emulator with a GoogleApi system image:
After you have the emulator configured you can use something like you are using:
<TouchableHighlight onPress={() => Linking.openURL('mailto:[email protected]?subject=abcdefg&body=body')}>
<Text>email1</Text>
</TouchableHighlight>
or
You can use a package like https://www.npmjs.com/package/react-native-autolink
<AutoLink
text="email2 (mailto:[email protected])"
/>
Upvotes: 3
Reputation: 738
Link not work on Simulator.
React native linking mail api support subject, body?
Upvotes: 19