obipawan / react-native-hyperlink

A <Hyperlink /> component for react-native that makes urls, fuzzy links, emails etc clickable
MIT License
801 stars 76 forks source link

Emails not working on Android devices #39

Closed brendandestefano closed 2 years ago

brendandestefano commented 5 years ago

Describe the bug Tapping on mailto links on Android device is not opening mail apps. Working fine on iOS devices.

To Reproduce Steps to reproduce the behavior:

  1. Click on mailto:someemail@email.com
  2. See blank screen

Expected behavior Open default mail app or show mail app choices

Screenshots Screenshot_20190416-110528

Smartphone (please complete the following information):

alburdette619 commented 5 years ago

I'm seeing this on iOS with linkDefault as well. It does nothing.

alburdette619 commented 5 years ago

Setting the following props worked for me on both platforms;

    onPress={url => Linking.openURL(url)}
    linkText={url =>
      url.includes('mailto:') ? url.replace('mailto:', '') : url
    }