-
Notifications
You must be signed in to change notification settings - Fork 502
Crash on Contacts Authorization #127
Comments
Thanks @winkelsdorf, I'll take a look at this. Possibly related to the new iOS 9 Contacts framework that was pulled in recently. |
@nickoneill You're welcome! Sorry that I didn't had the time to fix/create a PR before leaving the office today. Yes, the new Contacts framework is likely the reason for the crash. Did you also notice the detached view controller warning at the very beginning of the console output? I know why but wondering if there is a better way to present the Dialog View.. Having a look at it later this week.. Cheers |
Yep, if you set the |
Excellent idea, I would say just issue a warning and point to the best practice / correct way. Thanks for the great implementation, I first read about this approach at NatashaTheRobot's Blog some month ago (iirc) and had this implementation on my list too :) |
@winkelsdorf I'm just getting around to finding a repro for this now. Is this the case where it crashes when you toggle the settings switch? If so, that's just how iOS works with the contacts permissions (with both iOS 8 and 9) - you get killed when your contacts permission changes. |
I just tested Just for reference: we manually insert the pscope view into the top of the window view hierarchy which is why presenting on the app view controller shows behind the pscope view. Presenting from the pscope view controller gives the correct behavior but is 'discouraged' because the pscope controller isn't actually on the view controller stack. Potential fix: convert showing pscope to a modal view controller that's shown with Thoughts @bre7 / @winzig (as the original |
I can repo the same crash issue with both toggling the Contacts and the Bluetooth switches in the Settings. Changing the Notifications and Locations settings did not crash it - only the toggle switches seem to crash or terminate the app. But before it crashes I see this error when the transition to the Settings app starts: Not sure if this is useful to help debug this. |
Hey @denismars, that crash isn't something we can control. Any app will crash when toggling the Contacts permissions. |
At this point I don't believe |
Sorry, I just saw this thread now. I've not had any problems using viewControllerForAlerts, I'm reading through this discussion now and am not clear on how it pertains to the crash related to Contacts authorization? If you remove viewControllerForAlerts, how will we be able to call the request* methods directly, since if PS needs to show a view, it won't be able to put it into the hierarchy correctly, right? |
Hey @winzig, It's not related to the Contacts crash, you can safely ignore. Here's what I was seeing when I set Normally these native alerts are presented on top of the pscope view which works, despite giving a "don't present view controllers on deteached view controllers" warning (because I added the pscope view manually to the current view controller, not through the proper presentation). I think the correct thing to do here is modify pscope so that it's a view controller presented modally with that setting (the name is on the tip of my tongue...) that allows us to see to the view controller underneath, so it looks like the current implementation. We can customize the presentation with the animated transitioning API if necessary. |
Strange! I hadn't seen that behavior in our app (iOS 8/9) and we're doing mostly the direct request* calls. I have always felt the way I had proposed (setting that vc directly) felt a bit hacky, but seemed like a different solution would require more of a re-architecting of how this project works than I would have been comfortable suggesting. ;-) |
For clarity, I'm going to resolve this and create a new issue. I am fascinated that you haven't seen the same thing @winzig, but I'm sure I reviewed it when you made the original PR and I didn't see any weirdness then either. Still, avoiding this in the first place is the way to go! |
@nickoneill Sorry for the late reply. I'll implement this into a test project asap and have a look into it too. But from my point of view #148 is the safest thing to do. |
Checked out accc3c4 and tested the Demo. It crashes when Authorizing the Contacts (first I denied them, then opening the Settings via the Link).
Xcode 7.1, iOS 9.1 Simulator used.
The text was updated successfully, but these errors were encountered: