Giter Site home page Giter Site logo

Comments (22)

tbruyelle avatar tbruyelle commented on May 6, 2024

No of course it's not by design ^^, it's a bug, probably duplicate with #42.

from rxpermissions.

ashalmawia avatar ashalmawia commented on May 6, 2024

@jaydeep17 Sounds interesting. Could you please provide more detailed steps which you can reproduce it with? (Does not happen for me when using both request() and ensure()).

from rxpermissions.

tbruyelle avatar tbruyelle commented on May 6, 2024

Deployed a new version 0.7.0 that should fix that. Please check.

from rxpermissions.

jaydp17 avatar jaydp17 commented on May 6, 2024

I tried the new version, but it's still the same, it doesn't show up the second time

from rxpermissions.

tbruyelle avatar tbruyelle commented on May 6, 2024

Can you post more code ? I need to understand where and when the library is invoked.

from rxpermissions.

jaydp17 avatar jaydp17 commented on May 6, 2024

Here's a very simplified form of the calls to RxPermissions I have

RxPermissions.getInstance(this)
        .request(Manifest.permission.ACCESS_FINE_LOCATION)
        .flatMap(granted -> RxPermissions.getInstance(this)
            .request(Manifest.permission.ACCESS_FINE_LOCATION))
        .subscribe(...);

I don't have it exactly the same way as shown here, the second call to request is deep down in a sub function.

from rxpermissions.

tbruyelle avatar tbruyelle commented on May 6, 2024

Why do you need a second call for the same permission ?

from rxpermissions.

jaydp17 avatar jaydp17 commented on May 6, 2024

We have this utility class called RxGoogleMaps that carries out specific operations on Google Maps and every method inside that class that requires location permission asks for the permission before carrying out the operation. For example, showMyLocationButton(), moveToLastKnownLocation(), etc.
Unfortunately, once the permission is asked, then 2 levels deep we have a .flatMap(), that calls another of these RxGoogleMaps method, and thus permission is requested again.

from rxpermissions.

tbruyelle avatar tbruyelle commented on May 6, 2024

I think you should request the permission only one time.

from rxpermissions.

jaydp17 avatar jaydp17 commented on May 6, 2024

True that's a problem on my side, but don't you think RxPermissions should work, even if I request it twice.

from rxpermissions.

tbruyelle avatar tbruyelle commented on May 6, 2024

Yes but it may be not possible since RxPermission had to deal first with configuration changes.

from rxpermissions.

BruceeWang avatar BruceeWang commented on May 6, 2024

I have the same the question for that. If I want to deny this permission again. How can I get to change this permission?

from rxpermissions.

tbruyelle avatar tbruyelle commented on May 6, 2024

If I want to deny this permission again

Its up to the user to grant or deny, you have no control on that.

from rxpermissions.

BruceeWang avatar BruceeWang commented on May 6, 2024

I mean that when I request the permission again. If the user have granted the permission. the dialog(Permission) is not appear .How can I get the dialog appear again?
(English is not very well,please excuse me)

from rxpermissions.

tarasantoshchuk avatar tarasantoshchuk commented on May 6, 2024

@BruceeWang

If the user have granted the permission. the dialog(Permission) is not appear .How can I get the dialog appear again?

After the user have granted the permission, the only way for user to revoke permission is via App Settings. Otherwise dialog won't appear again.

from rxpermissions.

ngoctranfire avatar ngoctranfire commented on May 6, 2024

Yea, I actually think this is by design. After the dialog has appeared once, if the user granted or denied the permission, the permission, in theory should not appear again.


Edit:
I take that back. Unless they check never ask again, it should keep asking if they ever access whatever needs the permissions again.

from rxpermissions.

vekexasia avatar vekexasia commented on May 6, 2024

Just to know if there is a way to trigger the dialog ot show again.

from rxpermissions.

ngoctranfire avatar ngoctranfire commented on May 6, 2024

Yes, you can clear your data and that should allow you to receive the dialog again.

from rxpermissions.

vekexasia avatar vekexasia commented on May 6, 2024

Any chance for that to be done programmatically? So that i cant ask
permission till that gets granted?

Il 09 set 2016 6:35 PM, "Ngoc Buu Tran" [email protected] ha
scritto:

Yes, you can clear your data and that should allow you to receive the
dialog again.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#44 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAMPS4DLhlYJ5li7VfLa9ekCPuSs4xBRks5qoYregaJpZM4H7EEm
.

from rxpermissions.

toidv avatar toidv commented on May 6, 2024

Any update on this issue, I have the same issue here. Firstly, I request CAMERA permission (Manifest.permission.CAMERA). If a user grants the permissionI then request WRITE_EXTERNAL_STORAGE permission (Manifest.permission.WRITE_EXTERNAL_STORAGE). Depending on User grant/decline WRITE_EXTERNAL_STORAGE permission the captured Image will be located at ExternalStorageDirectory/ExternalFilesDir but the request for WRITE_EXTERNAL_STORAGE never get callback (onNext, onError, onComplete)

from rxpermissions.

tarasantoshchuk avatar tarasantoshchuk commented on May 6, 2024

@toidv
can you post some code?

from rxpermissions.

toidv avatar toidv commented on May 6, 2024

This is demonstration code @tarasantoshchuk
Firstly, request camera permission

private void requestCameraPermission() {
        mSubscription = rxPermissions.request(Manifest.permission.CAMERA)
                    .subscribe(new Subscriber<Boolean>() {
                        @Override
                        public void onCompleted() {
                        }

                        @Override
                        public void onError(Throwable e) {
                            e.printStackTrace();
                        }

                        @Override
                        public void onNext(Boolean aBoolean) {
                            if (aBoolean) {
                                 requestWriteExternalStoragePermission(MEDIA_TYPE_IMAGE.getMediaType());
                            } else {
                                InploiUtils.showSnackbar(view, R.string.permissions_not_granted);
                            }
                        }
                    });
    }

Then request write external storage permission

private void requestWriteExternalStoragePermission(final String mediaTpe) {
        if(mSubscription != null) {
            mSubscription.unsubscribe();
        }
        mSubscription = rxPermissions.request(Manifest.permission.WRITE_EXTERNAL_STORAGE)
                .subscribe(new Subscriber<Boolean>() {
                    @Override
                    public void onCompleted() {
                        Timber.e("onCompleted");
                    }

                    @Override
                    public void onError(Throwable e) {
                        Timber.e("onCompleted");
                        e.printStackTrace();
                    }

                    @Override
                    public void onNext(Boolean aBoolean) {
                        if (!aBoolean) {
                            showSnackbarWarning(aBoolean, mediaTpe);
                        } else {
                            showMediaType(aBoolean, mediaTpe);
                        }
                    }
                });
    }

from rxpermissions.

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.