Skip to content

refusing motion perm on iOS causes error #17

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

Open
jeremykanso opened this issue Mar 21, 2023 · 4 comments
Open

refusing motion perm on iOS causes error #17

jeremykanso opened this issue Mar 21, 2023 · 4 comments

Comments

@jeremykanso
Copy link

jeremykanso commented Mar 21, 2023

Hello @farfromrefug

If you refuse a motion permission on iOS, you'll get an error from iOS: "Domain=CMErrorDomain Code=105"

Plus, you never return the status for requested motion perm on rejected.

Related code in the repo:

                    activityManager.queryActivityStartingFromDateToDateToQueueWithHandler(NSDate.distantPast, new Date(), motionActivityQueue, (activities, error) => {
                        if (error) {
                            reject(error);
                        }
                        ...
                        return getStatus();

                        ```
                        
@farfromrefug
Copy link
Member

@jeremykanso thanks a lot for this! Will fix this as soon as I can

@farfromrefug
Copy link
Member

@jeremykanso actually the whole code is correct. There was just an issue with a else missing. But it is correct to not return the status on error. We reject with the error, not with the status. It works the same with all permissions

@jeremykanso
Copy link
Author

But you agree that we shouldn't get an error on refusing, right?

@farfromrefug
Copy link
Member

@jeremykanso it depends on what the native behavior is. If you get that error it means the native side threw that error. Also depends on the flow

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

2 participants