call_log_new 1.0.5 copy "call_log_new: ^1.0.5" to clipboard
call_log_new: ^1.0.5 copied to clipboard

A Flutter plugin for accessing call logs on Android and iOS platforms.

call_log_new #

A Flutter Plugin for Accessing Call Logs

The call_log_new plugin provides access to the call logs on Android devices, allowing you to fetch details such as phone numbers, call types, call dates, and durations.

Features #

Fetch call logs from the device Retrieve details like phone numbers, call types, dates, and durations

Getting Started #

Installation To use the call_log_new plugin in your Flutter project, add it as a dependency in your pubspec.yaml:

dependencies:
  call_log_new: ^1.0.4  # Replace with the latest version

Run flutter pub get to install the plugin.

Usage Fetching Call Logs

import 'package:_call_log_new/call_log_new.dart';

Iterable<CallLogResponse> callLogs = [];

void fetchCallLogs() async {
  try {
    final logs = await CallLog.fetchCallLogs();
    
    print(logs);
  } catch (e) {
    print("Error fetching call logs: $e");
  }
}

Handling Permissions #

The plugin requires permissions to access call logs. Ensure you handle the necessary permissions in your app:

import 'package:permission_handler/permission_handler.dart';

void requestPermissions() async {
  if (await Permission.phone.request().isGranted &&
      await Permission.contacts.request().isGranted) {
    fetchCallLogs();
  } else {
    print("Permissions denied");
  }
}

Android Setup #

Ensure that your AndroidManifest.xml includes the necessary permissions:

Contribution #

Contributions are welcome! Feel free to open issues or submit pull requests.

2
likes
130
points
56
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin for accessing call logs on Android and iOS platforms.

Homepage

Documentation

API reference

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on call_log_new