Ask to be the app for spam detection on a android device with Flutter

288 views Asked by At

I need to publish my flutter application on the playstore but I received several rejections. My application is used to identify the caller using my database.

I think my problem is that I don't know how to ask permission to become the default application for spam detection. Does anyone have the answer to this?

I've tried to change the permissions i asked in the android manifest, my last version is this :

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

Thank you very much for your help !

1

There are 1 answers

2
Paulo Taylor On

In order to screen calls correctly should extend the CallScreeningService class:

class MyCallScreeningService : CallScreeningService() {

    override fun onScreenCall(details: Call.Details) {
        val callResponse = when {
            // Perform checks to determine if the call should be blocked or allowed.
            // Return a new CallResponse object with the appropriate response action.
            // e.g. CallResponse.reject() to block the call, CallResponse.allow() to allow the call.
            else -> null // Return null if the call should be allowed.
        }
        
        respondToCall(details, callResponse) // Send the call response to the system.
    }
}

You'll still need to register your CallScreeningService implementation in your AndroidManifest.xml file for it to be used by the system. Also, you will need to request the necessary permissions to access call details and control call responses.

Here's a more detailed article about this subject