[First Pass Feedback Requested] Create a new sample app that uses SPM#952
[First Pass Feedback Requested] Create a new sample app that uses SPM#952
Conversation
Scaffold for Examples/Example_Swift-SPM: Xcode project (bundle ID net.openid.appauth.Example, no Example_Extension target), asset catalog, and placeholder ExampleApp.swift/ContentView.swift generated by Xcode. Orchestration will fill these in with AppAuth integration.
…buttons and log panel
| @@ -1,3 +1,6 @@ | |||
| # Unreleased | |||
| - Add SwiftUI + Swift Package Manager sample app under `Examples/Example_Swift-SPM`. | |||
There was a problem hiding this comment.
Can we link the PR here? Some examples are in the bullets of the previous releases.
| * [Example for iOS (Objective-C)](Example-iOS_ObjC/README.md) | ||
| * [Example for iOS w/ Carthage (Objective-C)](Example-iOS_ObjC-Carthage/README.md) | ||
| * [Example for iOS w/ Carthage (Swift)](Example-iOS_Swift-Carthage/README.md) | ||
| * [Example for iOS w/ SPM (SwiftUI)](Example_Swift-SPM/README.md) |
There was a problem hiding this comment.
For consistency, can we rename here and the folder itself to [Example for iOS w/ SPM (SwiftUI)](Example-iOS_Swift-SPM/README.md) ?
|
|
||
| ### Configure the Example | ||
|
|
||
| This sample reads them from an xcconfig file. Create your local override file by copying the committed defaults: |
There was a problem hiding this comment.
This may just be a me issue but I got confused when I read 'them' . Let's update to refer to the info above?
|
|
||
| if let clientId = kClientID { | ||
| self.doAuthWithAutoCodeExchange(configuration: config, clientID: clientId, clientSecret: nil) | ||
| } else { |
There was a problem hiding this comment.
Do we ever enter this else block? Curious because in the init() we call validateOAuthConfiguration() which asserts there is a kClientID.
|
|
||
| func validateOAuthConfiguration() { | ||
| assert(kClientID != nil, "Register your OIDC Client ID in Example.local.xcconfig (OIDC_CLIENT_ID).") | ||
| assert(kRedirectURI != "com.example.app:/oauth2redirect/example-provider", "Register your OIDC Redirect URI in Example.local.xcconfig (OIDC_REDIRECT_URI).") |
There was a problem hiding this comment.
Do we need this check? Asking since there seems to be a similar PreconditionFailure check on line 41.
This PR creates a simple new sample app that uses SwiftUI & SPM. Being unable to do a straightforward build of the various sample apps from the command line motivated me to do so.
I'm guessing there's more to do here - in particular, I'd love to hear if a fresh clone works.