get call log in react native android

Solutions on MaxInterview for get call log in react native android by the best coders in the world

showing results for - "get call log in react native android"
Luigi
05 Jul 2017
1import { PermissionsAndroid } from 'react-native';import CallLogs from 'react-native-call-log'  componentDidMount =  async() => {    try {      const granted = await PermissionsAndroid.request(        PermissionsAndroid.PERMISSIONS.READ_CALL_LOG,        {          title'Call Log Example',          message:            'Access your call logs',          buttonNeutral'Ask Me Later',          buttonNegative'Cancel',          buttonPositive'OK',        }      )      if (granted === PermissionsAndroid.RESULTS.GRANTED) {        console.log(CallLogs);        CallLogs.load(5).then(c => console.log(c));      } else {        console.log('Call Log permission denied');      }    }    catch (e) {      console.log(e);    }   }