I want to make my contact and dialer app default in flutter

Viewed 666

Hey I am quite new to flutter and wanted to get some help. I have successfully created a contact manager app along with dialpad in flutter. Everything works fine but I want it to be default app when calling and showing contact in the mobile device. I don't know how to achieve it.

I want it only on android.

1 Answers

You need to declare these permissions and services inside the AndroidManifest:

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

<!-- Needed only if your calling app reads numbers from the `PHONE_STATE` intent action. -->
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>

<service android:name="com.example.MyConnectionService"
    android:permission="android.permission.BIND_TELECOM_CONNECTION_SERVICE">
    <intent-filter>
        <action android:name="android.telecom.ConnectionService" />
    </intent-filter>
</service>

Then you can set it to default dialing via Settings.

Related