sparrowcode / PermissionsKit

Universal API for request permission and get its statuses.
https://x.com/sparrowcode_ios
MIT License
5.64k stars 462 forks source link

Localisation permission BUG? #185

Closed ghost closed 4 years ago

ghost commented 4 years ago

Sir the app get crashed everytime when im using trying to use the location permission showing you some screenshot tell me what do you think Capture d’écran 2020-05-03 à 17 15 36 and in viewdidLoad adding the above funcs Capture d’écran 2020-05-03 à 17 16 00

ghost commented 4 years ago

Okay i understand the locationWheninUse.isAuthorized is the only one working the other when in use and always doesnt work.. can you check sir ? trying to debug i can see when i dont have permission it show dialogue but when clicking allow its enter the denied function..

ivanvorobei commented 4 years ago

I can check, but please, clear write steps for reproduce and that result you wait

ghost commented 4 years ago

okay sorry for my bad english sir ^^

  1. implemented the pod and the info.plist permission alwaysAndWhenInUse

  2. import SPPPermission

  3. implement the delegate and dataSource to my ViewController.

  4. override the didDenied , didAllow , didHide.

  5. in didDenied and didHide to check if there is permission i'm using : let state = SPPermission.locationAlwaysAndWhenInUse.isAuthorized

  6. in the didAllow just doing the code i want ( get the user's location and show it on map)

  7. in the view did load i check again with let state=SPPermission.locationAlwaysAndWhenInUse.isAuthorized if there is permission, if not show dialogue.

    The problem is that when i click the ''allow' button to allow it with  dialogue it enter the Denied function i think tis question is related to the problem : do i need to call the override functions didAllow,didHide,didDenied in viewDidLoad ? or outside of it .

functions outside of viewdidLoad Capture d’écran 2020-05-03 à 18 41 29


inside viewDidLoad Capture d’écran 2020-05-03 à 18 42 11

ivanvorobei commented 4 years ago

I tested now example app, delegate work correct. Please, check example or pass more details.