permissions-dispatcher / PermissionsDispatcher

A declarative API to handle Android runtime permissions.
https://github.com/permissions-dispatcher/PermissionsDispatcher
Apache License 2.0
11.21k stars 1.44k forks source link

"withPermissionsCheck()" doesn't work omitted callback parameters #668

Closed tshion closed 3 years ago

tshion commented 4 years ago

Overview

Thank you develop permissions-dispatcher-ktx. I tried using 1.0.0-alpha2, it seems not to work "withPermissionsCheck()". If add default action for these parameters, I'm very happy!

WebViewBuilder()
    .geolocationEnabled(true)
    .javaScriptEnabled(true)
    .onGeolocationPermissionsShowPrompt { origin, callback ->
        withPermissionsCheck(Manifest.permission.ACCESS_FINE_LOCATION) {
            callback?.invoke(origin, true, false)
        }
    }
    .into(findViewById<WebView>(R.id.webview_target))
    .loadUrl("https://www.google.co.jp/maps")

Expected

I hope behavior like a "PermissionsDispatcher 4.3.0".

Actual

If omit these parameters, it seems not to work permission dialog.

Environment

Development

Library

Reproducible steps

It can reproduce using ktx-sample too. Please try omitting callback parameters.

hotchemi commented 4 years ago

Thank you so much! I was packed today gonna take a look tomorrow!

hotchemi commented 3 years ago

Sorry for the late, the issue has been addressed in https://github.com/permissions-dispatcher/PermissionsDispatcher/pull/678 and beta1 is available now! Thank you for the feedback~