AppAuth-iOS icon indicating copy to clipboard operation
AppAuth-iOS copied to clipboard

iOS 13 View Controller present style options

Open dingtianran opened this issue 6 years ago • 8 comments

Since iOS 13, the default presentation style of presenting a View Controller, a.k.a. modalPresentationStyle is UIModalPresentationAutomatic, in which will result in a non-fullscreen modal.

https://developer.apple.com/documentation/uikit/uimodalpresentationstyle/automatic

But in current procedure, developer can't get access to the SFSAFARIViewcontroller instance which is used to let user sign-in. It is better to give developer access to the modalPresentationStyle, to decide how the sign-inpop-up looks like.

dingtianran avatar Sep 09 '19 02:09 dingtianran

This would be great to set. Especially since it would appear that events like viewWillAppear will fire if the style is .fullscreen but not for the default

paulthorsteinson avatar Oct 16 '19 19:10 paulthorsteinson

Any update/movement on this? Kind of a dealbreaker for us as we need this view in .fullscreen. Would really appreciate any workarounds or updates on supporting this ask.

mikeberlin avatar Nov 25 '19 20:11 mikeberlin

Same here, we can't let the user cancel login for a product that requires it, and it's a janky user experience to simply re-present the login view controller after they cancel/dismiss it.

rwalbergpd avatar Nov 27 '19 14:11 rwalbergpd

On iOS 13, the default user agent (OIDExternalUserAgentIOS) of AppAuth uses ASWebAuthenticationSession to present the authorization to the user. ASWebAuthenticationSession is the one who creates and present the view controller, so AppAuth doesn't have access to this view controller.

Knowing that, I don't think changing the modal presentation style of this view controller is something in our control.

julienbodet avatar Nov 27 '19 23:11 julienbodet

Same here, we can't let the user cancel login for a product that requires it, and it's a janky user experience to simply re-present the login view controller after they cancel/dismiss it.

@rwalbergpd I don't get it. Why presenting the view controller with .fullscreen would prevent the user from cancelling/dismissing the authorization VC? The cancel button remains in the navigation bar.

julienbodet avatar Nov 27 '19 23:11 julienbodet

@rwalbergpd I don't get it. Why presenting the view controller with .fullscreen would prevent the user from cancelling/dismissing the authorization VC? The cancel button remains in the navigation bar.

It would prevent the user from swiping down to dismiss it. The cancel button would still be there, which we can find and remove.

rwalbergpd avatar Nov 29 '19 17:11 rwalbergpd

@mikeberlin the only way is to use the SFSafariViewController. If you do a fork you can comment the code for iOS 11 and 12 so the SFSafariVC available since iOS 9 will be used which allows to change the presentation style.

asam139 avatar Mar 23 '21 09:03 asam139

I have followed below post and able to show full screen login screen on iOS 13+, https://msolarana.netlify.app/2021/01/06/fixing-aswebauthenticationsession-presentation/

vijayradke avatar May 25 '21 07:05 vijayradke