React Native не может получить недавний вызов с устройства Android - PullRequest
0 голосов
/ 09 марта 2020

Я пытаюсь получить последние звонки на эмуляторе Android, но он дает мне некоторую ошибку. понятия не имею, почему я получаю ошибки. Я пробовал много решений, но я не уверен, почему это не работает. Я добавляю код ниже, надеюсь, кто-нибудь поможет мне найти решение

import React from 'react';
import CallLogs from 'react-native-call-log';
import { View, Text, PermissionsAndroid, StyleSheet, AsyncStorage } from 'react-native';
import Customswitch from './Customswitch';
import firebase from "firebase/app";
import database from 'firebase/database';

class Recentcalls extends React.Component{
    constructor(){
        super();
        this.getCallLogs = this.getCallLogs.bind(this);
        this.activateCallLog = this.activateCallLog.bind(this);
        this.state = {
            uid: '',
            cstatus: ''
        }
    }
    getCallLogs = async () => {
        // console.log(CallLogs);
        console.log(CallLogs.log());         }
      componentDidMount(){
        this.getCallLogs();
      }
      render(){
          return(
              <View style={styles.sectionPadding}>
                    <Customswitch style={styles.sectionPaddingData} contentText='Recent Call Logs' activateCallLog={this.activateCallLog} />
              </View>
          )
      }
}


const styles = StyleSheet.create({
    sectionPadding:{
        padding: 5
    },
    sectionPaddingData: {
        padding: 0
    }
});

export default Recentcalls;
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...