Skip to content
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

Support for iOS 13 Web Authentication #234

Merged
merged 2 commits into from
Sep 18, 2019
Merged

Conversation

cocojoe
Copy link
Member

@cocojoe cocojoe commented Sep 4, 2019

Changes

Added support for iOS 13 behaviour changes in Web Authentication

References

#233

Testing

N/A

Checklist

@cocojoe cocojoe added this to the v1-Next milestone Sep 4, 2019
@cocojoe cocojoe changed the title Added support fo iOS 13 presentationContextProvider property Added support for iOS 13 Web Authentication changes Sep 4, 2019
Copy link

@robwalkerco robwalkerco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @cocojoe,

I've tested this on the iOS 13 simulator in xCode 11 beta 6 and, and with the suggested changes, it works fine.

@@ -98,6 +106,10 @@ - (void)presentAuthenticationSession:(NSURL *)url {
}
self.authenticationSession = nil;
}];
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to
if (@available(iOS 13.0, *)) {
To prevent warning

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I just tried this on iOS 12.4, and is fails with this suggested change.
Looks like it may need to stay how you originally had it and live with the warning.

Copy link
Member Author

@cocojoe cocojoe Sep 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you try and compile in Xcode 10.x only with @available it will error as the compiler still sees the code. is a bit of a pain at times

ios/A0Auth0.m Outdated
@@ -98,6 +106,10 @@ - (void)presentAuthenticationSession:(NSURL *)url {
}
self.authenticationSession = nil;
}];
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
authenticationSession.presentationContextProvider = self

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires a ;

@@ -98,6 +106,10 @@ - (void)presentAuthenticationSession:(NSURL *)url {
}
self.authenticationSession = nil;
}];
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
authenticationSession.presentationContextProvider = self
#endif

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switch to } to close the suggested @available check.

ios/A0Auth0.m Outdated
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
authenticationSession.presentationContextProvider = self
#endif
self.authenticationSession = authenticationSession

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires a ;

@robwalkerco
Copy link

robwalkerco commented Sep 4, 2019

It looks a little different on iOS 13 (in terms of the stacked layout) than it did on iOS 12, but I guess thats expected.
Artboard

@cocojoe
Copy link
Member Author

cocojoe commented Sep 5, 2019

Appreciate the checks, I just added it quick with mental compiler to help unblock, let me fix up 😆

@cocojoe
Copy link
Member Author

cocojoe commented Sep 5, 2019

@robwalkerco please re-test

@benkraus
Copy link

I was experiencing the same issue, and this resolved it for me! 👏

@DMMN1992
Copy link

DMMN1992 commented Sep 12, 2019

keyWindow has been deprecated.

Could this possibly be implemented using the new UIWindowScene?

UIApplication.shared.connectedScenes and find the activationState property with value UISceneActivationStateForegroundActive (UIScene.ActivationState.foregroundActive in Swift), cast to UIWindowScene and retrieve the window from there maybe?

@cocojoe cocojoe marked this pull request as ready for review September 16, 2019 09:54
@cocojoe cocojoe requested a review from a team September 16, 2019 09:54
@cocojoe
Copy link
Member Author

cocojoe commented Sep 18, 2019

@DMMN1992 I agree with you, although this should be tackled in a different PR.

@cocojoe cocojoe merged commit e8da8e0 into master Sep 18, 2019
@lbalmaceda lbalmaceda deleted the added-ios13-webauth-support branch September 23, 2019 15:41
@nyoung697
Copy link

Is it possible to push this into a new release? Or how do I update my package to make use of this latest commit?

@lbalmaceda
Copy link
Contributor

@nyoung697 working on that as we speak

@lbalmaceda lbalmaceda modified the milestones: v1-Next, v1.6.0 Sep 23, 2019
@lbalmaceda lbalmaceda changed the title Added support for iOS 13 Web Authentication changes Support for iOS 13 Web Authentication Sep 23, 2019
lbalmaceda pushed a commit that referenced this pull request Sep 30, 2019
* Added support fo iOS 13 presentationContextProvider property

* Tweaks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants