[ktx] onNeverAskAgain not called
Author: SammyOdenhovenCreated Mar 15, 2022Updated Jun 16, 2022
Overview
onNeverAskAgain callback is not called when "Don't ask again" is selected.
Expected
onNeverAskAgain callback is called, so I can show the appropriate UI.
Actual
onNeverAskAgain callback is not called.
Environment
- Running ktx-sample on API 29 and API 30, using ktx v1.1.3
Investigation
After debugging it, I can see that onNeverAskAgain: WeakReference<Fun>? is null in PermissionRequestViewModel.invoke().
After reading through the closed issues, I came across https://github.com/permissions-dispatcher/PermissionsDispatcher/issues/735. Wondering if the weakreference could be the issue? If I downgrade the ktx library to 1.0.4, onNeverAskAgain is successfully called.
Reproducible steps
Source: permissions-dispatcher/PermissionsDispatcher