简体   繁体   English

获取 flutter 中的用户通话记录

[英]Get user call logs in flutter

I am new to flutter currently i am creating a flutter application where user need to get call history, i have done this in in java(native app) but i have no idea how to do this in flutter.我是 flutter 的新手,目前我正在创建一个 flutter 应用程序,用户需要在该应用程序中获取通话记录,我已经在 java(本机应用程序)中完成了此操作,但我不知道如何在 flutter 中执行此操作。 and one more thing how to get run-time permissions for this I have checked documentation of flutter but got nothing related to this.还有一件事是如何获得运行时权限,我已经检查了 flutter 的文档,但没有得到与此相关的任何信息。

thank you.谢谢你。

use call_log plugin available in pub.dev here is the link: https://pub.dev/packages/call_log the only problem here is that this plugin is only supported in Android.使用 pub.dev 中提供的 call_log 插件,这里是链接: https://pub.dev/packages/call_log这里唯一的问题是这个插件仅在 Android 中支持。 you can use it like this你可以像这样使用它

Iterable<CallLogEntry> _callLogEntries = <CallLogEntry>[];
_callLogEntries = CallLog.get();

do not forget to add call log permission in menifest file不要忘记在清单文件中添加通话记录权限

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM