Skip to content

Requesting ACCESS_BACKGROUND_LOCATION never completes #28

@yozhiqueAtMTS

Description

@yozhiqueAtMTS

Hello there! Trying to gain background access. I learned that Peko, while requesting ACCESS_BACKGROUND_LOCATION, transitions user to the app permission settings only if ACCESS_FINE_LOCATION was previously gained, otherwise the flow does not emit anything. Is it intended behavior?

Steps to reproduce:

AndroidManifest:

  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
  <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />

Activity's onCreate():

PermissionRequester.apply {
    initialize(applicationContext)
    lifecycleScope.launch {
        repeatOnLifecycle(STARTED) {
            try {
                instance().request(
                    permission.ACCESS_BACKGROUND_LOCATION,
                )
                    .catch {
                        Log.d("DEBUG_PERMISSIONS", "catch: $it")
                    }
                    .collect {
                        Log.d("DEBUG_PERMISSIONS", "$it")
                    }
            } catch (e: Throwable) {
                Log.d("DEBUG_PERMISSIONS", "error: $e")
            }
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions