call_log 패키지는 Android 앱이 장치의 통화 기록에 접근하고 쿼리할 수 있도록 해주는 Flutter 플러그인입니다. 발신자 번호, 통화 유형(수신, 발신, 놓친 통화), 통화 시간과 같은 세부 정보를 검색하기 위한 간단한 API를 제공합니다. iOS는 통화 기록 API를 공개하지 않기 때문에 이 플러그인은 Android 전용입니다. 연락처 관리자나 커뮤니케이션 도구와 같이 통화 기록 통합이 필요한 애플리케이션에 유용합니다. 이 패키지는 4q.eu에서 유지보수되며 pub.dev를 통해 이용 가능합니다.
사용 사례
Android 앱에서 통화 기록에 액세스하는 방법
연락처 또는 통화 관리 도구 구축
통화 기록을 통신 앱에 통합하기
통화 분석 대시보드 만들기
다이얼러 또는 음성 메일 애플리케이션 개발
주요 기능
Android 전용 지원
통화 기록 쿼리용 간단한 API
번호 및 유형과 같은 통화 세부 정보 검색
통화 지속 시간 및 타임스탬프 지원
GitHub의 오픈소스 코드
적합한 대상
안드로이드 앱 개발자
통화 기록 관리 기능
통신 및 생산성 앱
사용자 통화 기록 데이터가 필요한 앱
고려 사항
iOS와 호환되지 않습니다
안드로이드에서 런타임 권한이 필요합니다
시스템 호출 로그 데이터에 한정
기기 제조업체에 따라 달라질 수 있습니다
개인정보 민감 데이터 접근
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
call_log
A Flutter plugin to access and query call history log.
Support for Android only as iOS does not provide API for accessing call history
This plugin is able to handle checking and requesting permission automatically.
Currently implemented query params are dateFrom, dateTo, durationFrom, durationTo, name and number.
String params are queried using LIKE and '%' wildcard on both sides.
Migration to 6.0.0+
Since 6.0.0, we also check permission android.permission.READ_PHONE_NUMBERS, which is required for the simDisplayName to work in case of multiSim setups.
You can delete specific call log entries or all call logs:
// Delete a specific call log entryint deletedCount = awaitCallLog.deleteCallLog(entry.id);
// Delete all call logsint deletedCount = awaitCallLog.deleteAllCallLogs();
The methods return the number of entries deleted (1 for single deletion, total count for bulk deletion).
Export Call Logs
You can export all call logs to a JSON file:
// Export call logs to Downloads directory with timestampMap<String, dynamic> result = awaitCallLog.exportCallLog();
The export method saves the file to the Downloads directory with a filename in the format call_log_YYYYMMDD_HHMMSS.json. The method returns a map containing the number of entries exported and the absolute path to the exported file.
Background execution
This plugin may be used in flutter background engine, via plugins like WorkManager. But please note that it is impossible for plugin to request permission while it is executed in background. You have to manually request permissions READ_CALL_LOG and READ_PHONE_STATE
Note on iOS support
Unfortuynately iOS doesn't support queries of call log. More information here: https://stackoverflow.com/questions/33753644/is-there-an-ios-api-for-accessing-call-logs
Example
// IMPORT PACKAGEimport'package:call_log/call_log.dart';
// GET WHOLE CALL LOGIterable<CallLogEntry> entries = awaitCallLog.get();
// QUERY CALL LOG (ALL PARAMS ARE OPTIONAL)var now = DateTime.now();
int from = now.subtract(Duration(days: 60)).millisecondsSinceEpoch;
int to = now.subtract(Duration(days: 30)).millisecondsSinceEpoch;
Iterable<CallLogEntry> entries = awaitCallLog.query(
dateFrom: from,
dateTo: to,
durationFrom: 0,
durationTo: 60,
name: 'John Doe',
number: '901700000',
type: CallType.incoming,
);
Todo
[x] query call log using most common fields, using AND as a logical gate
[ ] query call log with full power of native API
Contribution and Support
Contributions are welcome!
If you want to contribute code please create a PR
If you find a bug or want a feature, please fill an issue