react native not open mail app

Solutions on MaxInterview for react native not open mail app by the best coders in the world

showing results for - "react native not open mail app"
Oscar
17 May 2017
1The code works perfectly the problem was the iOS simulator,
2it needs to be tested on a  real device.
3  
4import {Linking} from 'react-native'
5url = 'mailto:message:0';
6handlePress(url);
7  handlePress(url) {
8    console.log('Trying to access url')
9    console.log(url)
10    Linking.canOpenURL(url).then(supported => {
11      if (!supported) {
12        console.tron.log('Can\'t handle url: ' + url)
13      } else {
14        return Linking.openURL(url)
15
16      }
17    }).catch(err => console.error('An error occurred', err))
18  }