requestCallPermissions
Requests VoIP call permissions from the user without a callback.
This method requests the READ_PHONE_NUMBERS permission required for VoIP calls on Android 8+. A system permission dialog is shown if the permission has not been granted yet. Use requestCallPermissions overload with callback to receive the permission result.
Example:
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Request permissions on app launch
PushwooshCallSettings.requestCallPermissions()
// Check status later
val status = PushwooshCallSettings.getCallPermissionStatus()
if (status == 1) {
Log.d("App", "VoIP ready")
}
}See also
Requests VoIP call permissions from the user with a result callback.
This method requests the READ_PHONE_NUMBERS permission required for VoIP calls on Android 8+. A system permission dialog is shown if the permission has not been granted yet. The callback is invoked on the main thread after the user responds to the permission request.
Example:
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Request permissions with callback
PushwooshCallSettings.requestCallPermissions { granted, grantedPerms, deniedPerms ->
if (granted) {
Log.d("App", "VoIP enabled: $grantedPerms")
enableVoIPFeatures()
} else {
Log.w("App", "Permission denied: $deniedPerms")
showVoIPUnavailableMessage()
}
}
}
private fun enableVoIPFeatures() {
// Configure VoIP settings
PushwooshCallSettings.setCallSound("ringtone_video_call")
Toast.makeText(this, "VoIP calls enabled", Toast.LENGTH_SHORT).show()
}
}Parameters
optional callback to receive the permission request result. Called on the main thread after the user responds to the permission dialog. If null, no callback is invoked.