Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 21 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,29 @@ dependencies {
import { 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');
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);
}
}
}
catch (e) {
console.log(e);
}
}
```

## Methods
Expand Down