패키지, 저장소 및 앱 카테고리 검색

패키지 상세v6.0.1

call_log

통화 기록 로그에 액세스하고 쿼리할 수 있는 플러터 플러그인입니다. iOS는 통화 기록에 액세스하는 API를 제공하지 않기 때문에 Android 전용입니다.

Android
30일 다운로드
6.3천
좋아요
117
Pub 점수
160

패키지 설치

flutter pub add call_log

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

call_log 패키지는 Android 앱이 장치의 통화 기록에 접근하고 쿼리할 수 있도록 해주는 Flutter 플러그인입니다. 발신자 번호, 통화 유형(수신, 발신, 놓친 통화), 통화 시간과 같은 세부 정보를 검색하기 위한 간단한 API를 제공합니다. iOS는 통화 기록 API를 공개하지 않기 때문에 이 플러그인은 Android 전용입니다. 연락처 관리자나 커뮤니케이션 도구와 같이 통화 기록 통합이 필요한 애플리케이션에 유용합니다. 이 패키지는 4q.eu에서 유지보수되며 pub.dev를 통해 이용 가능합니다.

사용 사례

  • Android 앱에서 통화 기록에 액세스하는 방법
  • 연락처 또는 통화 관리 도구 구축
  • 통화 기록을 통신 앱에 통합하기
  • 통화 분석 대시보드 만들기
  • 다이얼러 또는 음성 메일 애플리케이션 개발

주요 기능

  • Android 전용 지원
  • 통화 기록 쿼리용 간단한 API
  • 번호 및 유형과 같은 통화 세부 정보 검색
  • 통화 지속 시간 및 타임스탬프 지원
  • GitHub의 오픈소스 코드

적합한 대상

  • 안드로이드 앱 개발자
  • 통화 기록 관리 기능
  • 통신 및 생산성 앱
  • 사용자 통화 기록 데이터가 필요한 앱

고려 사항

  • iOS와 호환되지 않습니다
  • 안드로이드에서 런타임 권한이 필요합니다
  • 시스템 호출 로그 데이터에 한정
  • 기기 제조업체에 따라 달라질 수 있습니다
  • 개인정보 민감 데이터 접근

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

call_log

pub package

A Flutter plugin to access and query call history log.
Support for Android only as iOS does not provide API for accessing call history

Usage

To use this plugin, add call_log as a dependency in your pubspec.yaml file.

You may add the following permission to your Android Manifest:

<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_NUMBERS" />

Ensure that following options are present in your build.gradle:

compileOptions {
......//
coreLibraryDesugaringEnabled true
}

dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
}

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.

Add new permission to your manifest:

<uses-permission android:name="android.permission.READ_PHONE_NUMBERS" />

Delete Call Logs

You can delete specific call log entries or all call logs:

// Delete a specific call log entry
int deletedCount = await CallLog.deleteCallLog(entry.id);

// Delete all call logs
int deletedCount = await CallLog.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 timestamp
Map<String, dynamic> result = await CallLog.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 PACKAGE
import 'package:call_log/call_log.dart';

// GET WHOLE CALL LOG
Iterable<CallLogEntry> entries = await CallLog.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 = await CallLog.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

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트