0

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 !

Mallou
  • 1
  • 2
  • To my knowledge Android has no system for call spam. Some dialer apps may include a feature like this so if you want to provide something similar you have to develop a full dialer app. – Robert Feb 14 '23 at 21:52

1 Answers1

0

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

Paulo Taylor
  • 716
  • 8
  • 18
  • Thank you for your answer, i wasn't really clear in my question. I need to ask the user the permission to be be the default spam handler. I have this activity that i'm trying to start but the permission dialog doesnt pop : `if (this.hasDialerCapability()) return val intent = Intent(TelecomManager.ACTION_CHANGE_DEFAULT_DIALER) .putExtra(TelecomManager.EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME, packageName) startActivityForResult(intent, requestId)`` I do also have not the possibility to assign my app into the parameters. – Mallou Feb 21 '23 at 15:58
  • You should use the RoleManager for that. Some more details available here: https://stackoverflow.com/a/64138600/680455 – Paulo Taylor Feb 21 '23 at 22:17