PermissionScope icon indicating copy to clipboard operation
PermissionScope copied to clipboard

Avoid calling getResultsForConfig twice

Open bre7 opened this issue 10 years ago • 6 comments

getResultsForConfig was being called before and in allAuthorized

bre7 avatar Nov 10 '15 00:11 bre7

Is there a particular case where this is called twice? It doesn't look like it happens always...

Also, I just merged this locally with #115 and it won't show the UI using the example app, just returns returned results [LocationInUse Unknown, Notifications Unknown, Contacts Unknown] for a fresh simulator.

nickoneill avatar Nov 28 '15 18:11 nickoneill

Flow: detectAndCallback --> getResultsForConfig ----> allAuthorized ------> getResultsForConfig

bre7 avatar Nov 28 '15 18:11 bre7

Also, I just merged this locally with #115 and it won't show the UI using the example app, just returns returned results [LocationInUse Unknown, Notifications Unknown, Contacts Unknown] for a fresh simulator.

Yeah, that's the problem with the fix: https://github.com/nickoneill/PermissionScope/issues/125#issuecomment-155255670

bre7 avatar Nov 28 '15 18:11 bre7

OK, I'll deal with that one first, then I'll come back to figure out what's going on here.

nickoneill avatar Nov 28 '15 18:11 nickoneill

I don't think that's the same issue as #125 - this was just me using the standard example project, not the special no UI case that we're dealing with there.

nickoneill avatar Nov 28 '15 19:11 nickoneill

The problem in #125 was that results would say one thing, while statusNotifications would report another (the correct one).

singlePscope.onAuthChange = { (finished, results) in
    print("got results \(results)")
    print("statusNotifications \(self.singlePscope.statusNotifications())")
}

And also, show isn't working in this branch

bre7 avatar Nov 28 '15 19:11 bre7