1# Quick Setup Guide 2 3## Step 1: Create Xcode Project 4 51. Open Xcode 62. Select "Create a new Xcode project" 73. Choose "iOS" → "App" 84. Configure: 9 - Product Name: **ATProtoOAuthDemo** 10 - Team: Your team 11 - Organization Identifier: **me.ngerakines** (or your own) 12 - Interface: **SwiftUI** 13 - Language: **Swift** 14 - Deployment Target: **iOS 14.0+** 15 16## Step 2: Add Source Files to Xcode 17 18### Method A: Drag and Drop (Recommended) 19 201. In Finder, navigate to the `oauth-ios/ATProtoOAuthDemo` folder 212. Drag these folders into your Xcode project: 22 - Authentication/ 23 - Models/ 24 - Networking/ 25 - Utilities/ 26 - Views/ 273. Drag these individual files: 28 - ATProtoOAuthDemoApp.swift 29 - Info.plist 30 314. When prompted, check: 32 - ✅ Copy items if needed 33 - ✅ Create groups 34 - ✅ Add to target: ATProtoOAuthDemo 35 36### Method B: Manual Import 37 38For each Swift file: 391. Right-click project in Xcode 402. Select "Add Files to [Project]..." 413. Navigate to the file 424. Click "Add" 43 44## Step 3: Configure Info.plist 45 46### Option A: Replace Xcode's Info.plist 471. Delete the default Info.plist in Xcode 482. Add the provided Info.plist file 49 50### Option B: Merge manually 511. Open your project's Info.plist 522. Add the URL Scheme configuration: 53 54```xml 55<key>CFBundleURLTypes</key> 56<array> 57 <dict> 58 <key>CFBundleTypeRole</key> 59 <string>Editor</string> 60 <key>CFBundleURLName</key> 61 <string>me.ngerakines.atprotodemo.oauth</string> 62 <key>CFBundleURLSchemes</key> 63 <array> 64 <string>me.ngerakines.atprotodemo</string> 65 </array> 66 </dict> 67</array> 68``` 69 70## Step 4: Update Constants (If Needed) 71 72If you used a different bundle identifier: 73 741. Open `Utilities/Constants.swift` 752. Update: 76 ```swift 77 static let urlScheme = "YOUR-BUNDLE-ID" 78 ``` 793. Ensure this matches the URL scheme in Info.plist 80 81## Step 5: Build and Run 82 831. Select a simulator (e.g., iPhone 15 Pro) 842. Press **⌘R** or click the Run button 853. Wait for build to complete 86 87## Step 6: Test Authentication 88 891. Enter a Bluesky handle: `yourname.bsky.social` 902. Tap "Sign In with OAuth" 913. Authorize in the web view 924. You'll be redirected back to the app 93 94## Verification Checklist 95 96- [ ] All Swift files imported and compile successfully 97- [ ] Info.plist contains URL scheme configuration 98- [ ] Constants.swift URL scheme matches Info.plist 99- [ ] App builds without errors 100- [ ] App launches and shows login screen 101- [ ] OAuth redirect works (after authentication) 102 103## Common Build Issues 104 105### "No such module 'CryptoKit'" 106- **Solution**: Ensure deployment target is iOS 14.0+ 107 108### "Cannot find 'AppConstants' in scope" 109- **Solution**: Ensure Constants.swift is added to target 110 111### URL Scheme Not Working 112- **Solution**: Check Info.plist URL scheme matches Constants.swift exactly 113 114### Missing Files in Target 1151. Select the file in Xcode 1162. Open File Inspector (⌘⌥1) 1173. Under "Target Membership", check your app target 118 119## Testing with a Real Account 120 1211. Create a Bluesky account at https://bsky.app (free) 1222. Use your handle in the app (e.g., `alice.bsky.social`) 1233. After authentication, test creating a post 1244. Verify the post appears on Bluesky 125 126## Next Steps 127 128After successful setup: 129- Review the architecture in README.md 130- Explore the OAuth flow in `OAuthClient.swift` 131- Customize the UI in the Views folder 132- Add more XRPC methods to `XRPCClient.swift` 133 134## Getting Help 135 136If you encounter issues: 1371. Check the Xcode console for error messages 1382. Review the README.md troubleshooting section 1393. Verify all files are properly added to the target 1404. Ensure deployment target is iOS 14.0+ 141 142## File Count Verification 143 144Your project should contain: 145- **17 files** total (16 Swift files + 1 plist) 146- **6 directories** (Authentication, Models, Networking, Utilities, Views, root) 147 148Run this to verify: 149```bash 150find ATProtoOAuthDemo -type f | wc -l 151``` 152Should return: 17