Giter VIP home page Giter VIP logo

Comments (5)

svenoaks avatar svenoaks commented on June 13, 2024 4

I had to do something ugly to get this to work, you can't have the Api 33 and Api < 33 permission in the same annotation or else it won't work:

fun startAddToQueueApiCheck() {
        if (sdk33OrHigher) {
            startAddToQueue33WithPermissionCheck()
        } else {
            startAddToQueue32WithPermissionCheck()
        }
    }

    @NeedsPermission(WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE)
    fun startAddToQueue32() {
        startAddToQueue()
    }

    @NeedsPermission(READ_MEDIA_AUDIO, READ_MEDIA_VIDEO)
    fun startAddToQueue33() {
        startAddToQueue()
    }

    fun startAddToQueue() {
       //actually do the thing here
    }

and then call the startAddToQueueApiCheck() for using it

You have to also separate out the @OnShowRationale and @OnPermissionDenied and @OnNeverAskAgain. For example:

 @OnPermissionDenied(READ_MEDIA_AUDIO, READ_MEDIA_VIDEO)
    fun showDeniedForMedia() {
        ..
    }

    @OnPermissionDenied(WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE)
  ..
}

I don't think the library is well equipped to handle this in an elegant manner.

from permissionsdispatcher.

roshanrai06 avatar roshanrai06 commented on June 13, 2024

any update on this issue, how did you resolve it?

from permissionsdispatcher.

jarhot1992 avatar jarhot1992 commented on June 13, 2024

https://developer.android.com/training/permissions/requesting

from permissionsdispatcher.

marvil6 avatar marvil6 commented on June 13, 2024

How did you resolve the issue?

from permissionsdispatcher.

jschleppy avatar jschleppy commented on June 13, 2024

I don't think the library is well equipped to handle this in an elegant manner.

That's what happens when requirements change and affected libraries aren't updated. No new update for over 2.5yrs means this project is effectively dead on the latest Android APIs imo.

from permissionsdispatcher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.