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

iOS: iosCustomBrowser fails to open Chrome or any browser on iOS 18+ #1034

Closed
djopet00 opened this issue Nov 6, 2024 · 9 comments
Closed

Comments

@djopet00
Copy link

djopet00 commented Nov 6, 2024

Issue

On iOS 18+, Chrome and other browsers can no longer be opened using the iosCustomBrowser property from within the React Native application.

Previously, setting iosCustomBrowser to any browser (e.g., 'chrome', 'safari', 'opera', 'firefox') worked without issues on iOS 17 and earlier versions.

Is there a workaround or fix for this issue?
Lots of users are facing the same problem.


Environment

  • Identity Provider: Duende Identity Server (OpenID Connect and OAuth 2.0)
  • Platform: iOS
  • React Native Version: 0.76.1
  • react-native-app-auth Version: 8.0.0
  • Using Expo: No

Additional Details

  • macOS: 14.5
  • Xcode: 16.0
  • Node: v18.18.2
  • Yarn: v1.22.21
  • NOTE: Works on iOS 17 and earlier but not on iOS 18+

Xcode Console Message:

BUG IN CLIENT OF UIKIT: The caller of UIApplication.openURL(:) needs to migrate to the non-deprecated UIApplication.open(:options:completionHandler:). Force returning false (NO).


Steps to Reproduce

  1. Set iosCustomBrowser: 'chrome' (or any other supported browser, such as 'safari', 'opera', 'firefox') using react-native-app-auth package.
  2. Run the app on a device or simulator with iOS 18 or later.
  3. Attempt to initiate an authentication flow that opens the specified browser.
  4. Browser does not open, and the Xcode console logs the message mentioned above.

@VariabileAleatoria
Copy link

VariabileAleatoria commented Nov 11, 2024

We are facing the same error. We had to downgrade xcode to version 15.4 in order to overcome the issue, but an update of the library (I guess the ios sdk that this project wraps) is needed.

@djopet00
Copy link
Author

Yes, you’re absolutely right. Thank you for the response!
Based on your feedback, I was also able to use Xcode v15.4 instead of v16 and resolve the issue, for now.

This library should be updated with the latest iOS SDK, as Apple has set a deadline: "Starting from April 2025, all iOS/iPadOS apps uploaded to the App Store must be built with the iOS 18 SDK." For more details, see Apple's documentation.

@carbonrobot
Copy link
Contributor

We are waiting on the upstream AppAuth-IOS for a new release, but will release a patch as soon as we have it.

@VariabileAleatoria
Copy link

We are waiting on the upstream AppAuth-IOS for a new release, but will release a patch as soon as we have it.

Is there an issue opened on the upstream repo?

@carbonrobot
Copy link
Contributor

carbonrobot commented Nov 18, 2024

Here is the upstream issue. It is currently merged, but not yet released.

@VariabileAleatoria
Copy link

The new release of AppAuth-IOS has been released

@carbonrobot
Copy link
Contributor

We have now released 8.0.1 which includes an upstream API fix. Please retest.

@VariabileAleatoria
Copy link

Looks like it's working again, thanks.

@djopet00
Copy link
Author

djopet00 commented Nov 28, 2024

For iOS Setup details:

  • XCode: Version 16.1
  • CocoaPods version: 1.16.2
  • Update auth package to new release 8.0.1
  • Clean react-native project

For those who encountered the same issue after upgrade to the new release package, please check:

Error during pod install:

[!] CocoaPods could not find compatible versions for pod "AppAuth":
  In Podfile:
    react-native-app-auth (from `../node_modules/react-native-app-auth`) was resolved to 8.0.1, which depends on
      AppAuth (>= 1.7.6)

None of your spec sources contain a spec satisfying the dependency: `AppAuth (>= 1.7.6)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

Tried a clean install using 'gem', but the same issue persisted.
After multiple retries, for me the issue was resolved by removing CocoaPods installed via 'gem' and switching to installing via 'Homebrew'.

Run following for cocoapods:

sudo gem uninstall cocoapods
arch -arm64 brew install cocoapods

In react-native project > in iOS directory run following:

pod repo update
pod install

Status:

Once I resolved the issue with CocoaPods, we moved forward with the auth flow using the custom browser, and everything worked seamlessly with the new release 8.0.1, thanks.

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

No branches or pull requests

3 participants