
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-native-call-log
Advanced tools
A React Native package to access and query call history log on Android.
Note: iOS does not provide API for accessing call history. This package only supports Android.
yarn add react-native-call-log
# or
npm install react-native-call-log
Auto-linking will handle the setup automatically.
react-native link react-native-call-log
This package supports both the old and new React Native architectures. When building with the New Architecture enabled, it automatically uses TurboModules for improved performance.
To enable New Architecture in your app:
android/gradle.properties:newArchEnabled=true
The package will automatically detect the architecture and use the appropriate implementation.
Add the following permissions to your android/app/src/main/AndroidManifest.xml:
<uses-permission android:name="android.permission.READ_CALL_LOG" />
<uses-permission android:name="android.permission.WRITE_CALL_LOG" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_NUMBERS" />
Permission Requirements:
READ_CALL_LOG - Required to read call historyWRITE_CALL_LOG - Required for delete operationsREAD_PHONE_STATE - Required for SIM informationREAD_PHONE_NUMBERS - Required for multi-SIM display name (Android 8.0+)import { PermissionsAndroid } from "react-native";
import CallLogs from "react-native-call-log";
// Request permissions
const requestPermissions = async () => {
try {
const granted = await PermissionsAndroid.requestMultiple([
PermissionsAndroid.PERMISSIONS.READ_CALL_LOG,
PermissionsAndroid.PERMISSIONS.WRITE_CALL_LOG,
PermissionsAndroid.PERMISSIONS.READ_PHONE_STATE,
]);
return Object.values(granted).every(
(status) => status === PermissionsAndroid.RESULTS.GRANTED,
);
} catch (err) {
console.warn(err);
return false;
}
};
// Get all call logs
const getAllCallLogs = async () => {
const hasPermission = await requestPermissions();
if (hasPermission) {
const logs = await CallLogs.loadAll();
console.log(logs);
}
};
| Method | Description |
|---|---|
load(limit) | Load up to limit call logs |
load(limit, filter) | Load call logs with filter (use -1 for no limit) |
loadAll() | Load all call logs |
get() | Alias for loadAll() |
query(options) | Query call logs with options |
deleteCallLog(id) | Delete a specific call log entry |
deleteAllCallLogs() | Delete all call logs |
exportCallLogs(filename?) | Export call logs to JSON file |
const filter = {
minTimestamp: 1571835032000, // Minimum timestamp in milliseconds
maxTimestamp: 1583318721264, // Maximum timestamp in milliseconds
phoneNumbers: "+11234567890", // String or Array of strings
types: "MISSED", // String or Array: INCOMING, OUTGOING, MISSED, etc.
minDuration: 30, // Minimum call duration in seconds
maxDuration: 300, // Maximum call duration in seconds
name: "John", // Filter by contact name (partial match)
};
const logs = await CallLogs.load(-1, filter);
const now = new Date();
const sixtyDaysAgo = new Date(now.getTime() - 60 * 24 * 60 * 60 * 1000);
const logs = await CallLogs.query({
dateTimeFrom: sixtyDaysAgo,
dateTimeTo: now,
durationFrom: 0,
durationTo: 60,
name: "John Doe",
number: "901700000",
type: "INCOMING",
});
| Type | Description |
|---|---|
INCOMING | Incoming call |
OUTGOING | Outgoing call |
MISSED | Missed call |
VOICEMAIL | Voicemail |
REJECTED | Rejected call |
BLOCKED | Blocked call |
ANSWERED_EXTERNALLY | Answered on another device |
WIFI_INCOMING | WiFi incoming call |
WIFI_OUTGOING | WiFi outgoing call |
UNKNOWN | Unknown type |
Each call log entry contains:
interface CallLog {
id: string; // Unique identifier
phoneNumber: string; // Phone number
formattedNumber: string; // Formatted phone number
duration: number; // Duration in seconds
name: string | null; // Contact name
timestamp: string; // Unix timestamp in milliseconds
dateTime: string; // Formatted date/time
type: string; // Call type
rawType: number; // Raw Android call type code
cachedNumberType: number; // Cached number type
cachedNumberLabel: string; // Cached number label
cachedMatchedNumber: string; // Cached matched number
phoneAccountId: string; // Phone account ID (for multi-SIM)
simDisplayName: string; // SIM display name (Android 15+)
}
// Delete a specific call log
const deletedCount = await CallLogs.deleteCallLog(callLog.id);
// Delete all call logs
const deletedCount = await CallLogs.deleteAllCallLogs();
// Export with auto-generated filename
const result = await CallLogs.exportCallLogs();
console.log(`Exported ${result.count} entries to ${result.path}`);
// Export with custom filename
const result = await CallLogs.exportCallLogs("my_call_logs.json");
id, formattedNumber, cachedMatchedNumber, phoneAccountId, simDisplayNameminDuration, maxDuration, nameget(), query(), deleteCallLog(), deleteAllCallLogs(), exportCallLogs()WIFI_INCOMING, WIFI_OUTGOING typesSee the Example folder for a complete working example.
cd Example
npm install
npx react-native run-android
MIT License - see LICENSE for details.
FAQs
Access and query call history log for Android in React Native
The npm package react-native-call-log receives a total of 632 weekly downloads. As such, react-native-call-log popularity was classified as not popular.
We found that react-native-call-log demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.