Answers for "react native not open mail app"

0

react native not open mail app

The code works perfectly the problem was the iOS simulator,
it needs to be tested on a  real device.
  
import {Linking} from 'react-native'
url = 'mailto:message:0';
handlePress(url);
  handlePress(url) {
    console.log('Trying to access url')
    console.log(url)
    Linking.canOpenURL(url).then(supported => {
      if (!supported) {
        console.tron.log('Can\'t handle url: ' + url)
      } else {
        return Linking.openURL(url)

      }
    }).catch(err => console.error('An error occurred', err))
  }
Posted by: Guest on May-19-2021

Code answers related to "react native not open mail app"

Code answers related to "Javascript"

Browse Popular Code Answers by Language