Ensure Swift 5 compilation for SDK pods to improve Swift 6 compatibility #1203
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses build failures on iOS when the consuming application project is configured to use Swift 6, as discussed in issue #1185. While
react-native-auth0
and its dependencies do not yet officially support Swift 6 features, this change ensures the SDK itself is explicitly compiled using Swift 5. It also updates documentation to guide users on how to enforce Swift 5 for all relevant SDK dependencies if they encounter issues.Changes Made
A0Auth0.podspec
:s.swift_version = '5.0'
to explicitly declare that theA0Auth0
pod (which isreact-native-auth0
itself) should be compiled with Swift 5.0. This instructs Cocoapods to use the Swift 5 compiler for this pod, even if the main application project defaults to Swift 6.README.md
:post_install
hook example in theREADME.md
now includesJWTDecode
andSimpleKeychain
in addition toAuth0
andA0Auth0
. This ensures that users can enforce Swift 5.0 compilation for all key Swift-based dependencies of thereact-native-auth0
SDK, providing a more robust solution against potential build system overrides.JWTDecode
andSimpleKeychain
.Context
react-native-auth0
areAuth0.swift
,JWTDecode
, andSimpleKeychain
. These libraries generally specify Swift 5 in their own podspecs.react-native-auth0
pod itself.README.md
update provides a stronger fallback for users by allowing them to explicitly set the Swift version for all these dependencies in their own project'sPodfile
.Expected Outcome
Users with application projects set to Swift 6 should be able to build their iOS apps without encountering Swift version compatibility errors originating from
react-native-auth0
or its direct Swift dependencies, as these will be compiled using Swift 5.Related Issue
Closes #1185