Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter based call recording app with native UI integration

I am trying to get call-recording to work with native UI integration using flutter, CallKit (iOS) and ConnectionService (Android).

Since there is no guide for integrating flutter with CallKit and ConnectionService or any other service to enable system-like call recording without root access or jailbreak, this question has come to existence. There are a lot of apps available for jailbroken devices and android does natively support call recording, but there is no concrete guide for implementing the same using flutter.

Using flutter 1.7 with AndroidX support for back-compatibility of marshmallow+ ConnectionService.

The expected result is to automatically record calls or prompt user to do so whenever there is an incoming call.

Currently unable to do it at all, maybe I am missing something essential in the documentation or I don't have the sufficient know-how for the successful execution of creating a system-supported call-recording app using flutter.

like image 379
Junaid Shaikh Avatar asked Jul 14 '19 12:07

Junaid Shaikh


1 Answers

Since there is no guide for integrating flutter with CallKit and ConnectionService ...

In short, mentioned via comments, you’ll have to refer to https://flutter.dev/docs/development/platform-integration/platform-channels to do it yourself by implementing platform-specific code such as CallKit/ConnectionService.

First, because there’s currently likely no Flutter library that has already conveniently packaged this up for you, at least not at https://pub.dev/flutter, so this is why you need to do it yourself.

Now, assuming all the restrictions, permissions, rooting, jailbreaking, etc. poses no issue to you, then you would need to implement these APIs natively in iOS/Android first, for example, Android:

@Override
public void onMethodCall(MethodCall call, Result result) {
    if (call.method.equals("recordCall")) {
        result.success(recordCall());
    }
}

Which will then allow you to call them from Flutter:

_recordCall() {
  var recording = await platform.invokeMethod('recordCall');
}

So don’t think of how to do this in Flutter, the above was the easy part.

Your perspective should be: how to do this on iOS/Android, because the magic is in recordCall()

like image 103
TWL Avatar answered Sep 19 '22 07:09

TWL