0

My app defines a url scheme (shown below) and it works fine under iOS 10, but I get the error message shown in the subject under iOS 11.

geocontrol:/oauth2Callback

The app does oauth which requires the user to enter his credentials in Safari and then Safari redirects to my app.

Does this type of redirect still work under iOS 11?

RawMean
  • 8,374
  • 6
  • 55
  • 82
  • Did you configure the URL schemes correctly using `CFBundleURLSchemes` ? – nathan Aug 26 '17 at 17:52
  • Yes, I did. The redirection works perfectly under iOS 10. – RawMean Aug 26 '17 at 18:56
  • Then you need to use [SFAuthenticationSession](https://developer.apple.com/documentation/safariservices/SFAuthenticationSession) instead. Here's an OAuth example: https://github.com/dvdhpkns/SFAuthenticationSession-Instagram-Oauth – nathan Aug 26 '17 at 18:57
  • `SFAuthenticationSession` is supported only on iOS 11. My app must work on older iOS versions as well. – RawMean Aug 26 '17 at 20:00
  • You said your solution was working on iOS 10 so use if #available to provide a solution for iOS <=10 / 11+ – nathan Aug 26 '17 at 20:02
  • You are right, but that requires major modification to the app to get the oAuth token in two different ways based on iOS version. I'm currently using oAuthSwift which takes care of token refresh automatically with each access. This problem is also more than just oAuth. If URL schemes don't work in iOS 11 they way they did in the previous versions, then that's a big problem. – RawMean Aug 26 '17 at 20:06
  • Possible duplicate of [SafariViewController: How to grab OAuth token from URL?](https://stackoverflow.com/questions/38818786/safariviewcontroller-how-to-grab-oauth-token-from-url) – nathan Aug 26 '17 at 21:23
  • You should probably take your issue to the library's repo and request iOS 11+ compatibility. – nathan Aug 26 '17 at 21:26

1 Answers1

0

Just updated to iOS 11 beta 7 and I can confirm that beta 7 resolves this issue.

RawMean
  • 8,374
  • 6
  • 55
  • 82
  • But cookie sharing is disabled. If you use that approach, the user will need to enter his credentials on each login. – nathan Aug 27 '17 at 04:27
  • oAuthSwift is not based on cookie sharing. My app definitely does not require entering credentials every time. – RawMean Aug 27 '17 at 04:33