this repo has no description
Quick Setup Guide#
Step 1: Create Xcode Project#
- Open Xcode
- Select "Create a new Xcode project"
- Choose "iOS" → "App"
- Configure:
- Product Name: ATProtoOAuthDemo
- Team: Your team
- Organization Identifier: me.ngerakines (or your own)
- Interface: SwiftUI
- Language: Swift
- Deployment Target: iOS 14.0+
Step 2: Add Source Files to Xcode#
Method A: Drag and Drop (Recommended)#
-
In Finder, navigate to the
oauth-ios/ATProtoOAuthDemofolder -
Drag these folders into your Xcode project:
- Authentication/
- Models/
- Networking/
- Utilities/
- Views/
-
Drag these individual files:
- ATProtoOAuthDemoApp.swift
- Info.plist
-
When prompted, check:
- ✅ Copy items if needed
- ✅ Create groups
- ✅ Add to target: ATProtoOAuthDemo
Method B: Manual Import#
For each Swift file:
- Right-click project in Xcode
- Select "Add Files to [Project]..."
- Navigate to the file
- Click "Add"
Step 3: Configure Info.plist#
Option A: Replace Xcode's Info.plist#
- Delete the default Info.plist in Xcode
- Add the provided Info.plist file
Option B: Merge manually#
- Open your project's Info.plist
- Add the URL Scheme configuration:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>me.ngerakines.atprotodemo.oauth</string>
<key>CFBundleURLSchemes</key>
<array>
<string>me.ngerakines.atprotodemo</string>
</array>
</dict>
</array>
Step 4: Update Constants (If Needed)#
If you used a different bundle identifier:
- Open
Utilities/Constants.swift - Update:
static let urlScheme = "YOUR-BUNDLE-ID" - Ensure this matches the URL scheme in Info.plist
Step 5: Build and Run#
- Select a simulator (e.g., iPhone 15 Pro)
- Press ⌘R or click the Run button
- Wait for build to complete
Step 6: Test Authentication#
- Enter a Bluesky handle:
yourname.bsky.social - Tap "Sign In with OAuth"
- Authorize in the web view
- You'll be redirected back to the app
Verification Checklist#
- All Swift files imported and compile successfully
- Info.plist contains URL scheme configuration
- Constants.swift URL scheme matches Info.plist
- App builds without errors
- App launches and shows login screen
- OAuth redirect works (after authentication)
Common Build Issues#
"No such module 'CryptoKit'"#
- Solution: Ensure deployment target is iOS 14.0+
"Cannot find 'AppConstants' in scope"#
- Solution: Ensure Constants.swift is added to target
URL Scheme Not Working#
- Solution: Check Info.plist URL scheme matches Constants.swift exactly
Missing Files in Target#
- Select the file in Xcode
- Open File Inspector (⌘⌥1)
- Under "Target Membership", check your app target
Testing with a Real Account#
- Create a Bluesky account at https://bsky.app (free)
- Use your handle in the app (e.g.,
alice.bsky.social) - After authentication, test creating a post
- Verify the post appears on Bluesky
Next Steps#
After successful setup:
- Review the architecture in README.md
- Explore the OAuth flow in
OAuthClient.swift - Customize the UI in the Views folder
- Add more XRPC methods to
XRPCClient.swift
Getting Help#
If you encounter issues:
- Check the Xcode console for error messages
- Review the README.md troubleshooting section
- Verify all files are properly added to the target
- Ensure deployment target is iOS 14.0+
File Count Verification#
Your project should contain:
- 17 files total (16 Swift files + 1 plist)
- 6 directories (Authentication, Models, Networking, Utilities, Views, root)
Run this to verify:
find ATProtoOAuthDemo -type f | wc -l
Should return: 17