Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V/TedPermission: permissionResult(): null #92

Open
tigran-ita opened this issue Jun 22, 2018 · 3 comments
Open

V/TedPermission: permissionResult(): null #92

tigran-ita opened this issue Jun 22, 2018 · 3 comments

Comments

@tigran-ita
Copy link

After providing permission library logs V/TedPermission: permissionResult(): null
It makes app freeze a bit, also when app goes in the background it pushes app back on screen in 2-3s. Looks like some problems with bus events.
Implementing lib according to described documentation.

@ParkSangGwon
Copy link
Owner

@TigranSarkisyan
Can you show me your code?

@kkotkkio
Copy link

kkotkkio commented Oct 19, 2018

안녕하세요!
저도 permissionResult(): null 나오네요ㅠ
이게 모든 버전이 안되면 다행인데 다른 사람들은 잘되더라구요.

일단 코드는 아래와 같고, 제 안드로이드 버전은 7.0 이며 LG V20 기기 쓰고 있습니다!

if (SmartLocation.with(MainApplication.mContext).location().state().locationServicesEnabled()) {
                //권한 설정이후 작업
                DisposableManager.add(TedRx2Permission.with(mContext)
                        .setRationaleTitle("위치 정보 추가")
                        .setRationaleMessage("위치 정보를 동의하시면 현재 내 거리로부터 가까운 곳을 보실 수 있습니다 :)")
                        .setDeniedTitle("위치 정보를 배제한 정보가 표시됩니다.")
                        .setPermissions(Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION)
                        .setGotoSettingButton(true)
                        .request()
                        // 옵저버블
                        // 온넥스트를 실행
                        // 중간에 에러 발생 -> 온에러
                        // 잘 끝남 -> 온컴플릿
                        .subscribe(tedPermissionResult -> {
                            if (tedPermissionResult.isGranted()) {
                                // 허용 받음
                                // 위치 정보 가져오기
                                SmartLocation.with(MainApplication.mContext).location().oneFix().start(location -> {
                                    MainApplication.lat = location.getLatitude();
                                    MainApplication.lng = location.getLongitude();

                                    getAddress(MainApplication.lat, MainApplication.lng, address -> {
                                        if (address != null) {
                                            // 성공
                                            setLocation(MainApplication.lat + "", MainApplication.lng + "", address, LOCATION_CURRENT);
                                        } else {
                                            // 실패
                                            cancelLocationChange(LOCATION_CURRENT);
                                        }
                                    });
                                });
                            } else {
                                // 거절 받음
                                Toast.makeText(mContext, "동의후 이용가능합니다.", Toast.LENGTH_SHORT).show();
                                cancelLocationChange(LOCATION_CURRENT);
                            }
                        }, throwable -> {
                            Toast.makeText(mContext, "동의후 이용가능합니다.", Toast.LENGTH_SHORT).show();
                            cancelLocationChange(LOCATION_CURRENT);
                        }, () -> {
                        }));
            }

@ParkSangGwon
Copy link
Owner

@kkotkkio
Rx에서는 tedPermissionResult가 null이 emit 될 수 없습니다.
문제가 발생하는 코드의 샘플 프로젝트 예제를 올려주시면 확인해보겠습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants