-
Notifications
You must be signed in to change notification settings - Fork 11
docs: update ios swift docs to the latest #84
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
WalkthroughiOS Swift SDK documentation updated with revised installation guidance (iOS 14.0+ minimum, Swift Package Manager as primary method) and restructured usage examples featuring new try/await error-handling patterns for in-app verification workflows. Changes
Sequence Diagram(s)sequenceDiagram
participant App as iOS App
participant SDK as Reclaim SDK
participant VerificationFlow as Verification Flow
participant Result as Result Handler
App->>SDK: createRequest(providerId, appId?, secret?)
activate SDK
SDK->>SDK: Initialize with Info.plist defaults
SDK-->>App: Request ready
deactivate SDK
App->>VerificationFlow: startVerification(request)
activate VerificationFlow
alt User Completes
VerificationFlow-->>Result: result with proofs & sessionId
Result->>App: Success - Access result.response
else User Cancels
VerificationFlow-->>Result: ReclaimVerificationError.cancelled
else User Dismisses
VerificationFlow-->>Result: ReclaimVerificationError.dismissed
else Session Expires
VerificationFlow-->>Result: ReclaimVerificationError.sessionExpired
else Verification Fails
VerificationFlow-->>Result: ReclaimVerificationError.failed
end
deactivate VerificationFlow
Result->>App: Handle via do-catch block
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–25 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
content/docs/ios-swift/installation.mdx (1)
68-75: Performance Fix section is valuable, but clarify scope.The GODEBUG environment variable workaround is practical guidance for device testing. However, explicitly note whether this applies to both SPM and CocoaPods installations, or if it's specific to certain build configurations. This can prevent confusion during troubleshooting.
Consider adding a brief clarification:
## Performance Fix To prevent performance issues on physical devices, add this environment variable: 1. Edit Scheme → Run → Arguments 2. Add environment variable: - **Key**: `GODEBUG` - **Value**: `asyncpreemptoff=1` + +**Note**: This applies to both Swift Package Manager and CocoaPods installations.content/docs/ios-swift/usage.mdx (1)
92-103: Advanced Usage example demonstrates extensibility, but clarify API completeness.The
setOverridesexample withReclaimAppInfoshows how to customize the verification flow. However, the trailing comment// Add other overrides as neededis vague. Consider either:
- Documenting what other overrides are available, or
- Simplifying the example to show only the single provided customization point
This will prevent developers from spending time searching for nonexistent overrides.
try await ReclaimVerification.setOverrides( appInfo: ReclaimOverrides.ReclaimAppInfo( appName: "My Custom App", appImageUrl: "https://example.com/logo.png" ) - // Add other overrides as needed )Alternatively, if additional overrides exist, document them here or link to full API reference.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
content/docs/ios-swift/installation.mdx(1 hunks)content/docs/ios-swift/usage.mdx(1 hunks)
🧰 Additional context used
🪛 LanguageTool
content/docs/ios-swift/installation.mdx
[typographical] ~19-~19: Ikke parret symbol: "[" ser ud til at mangle
Context: ...iOS 14.0+ application - [Reclaim account](https://dev.reclaimprotocol.org/explore...
(UNPAIRED_BRACKETS)
🔇 Additional comments (5)
content/docs/ios-swift/installation.mdx (2)
16-24: Excellent restructuring: clear prerequisites and practical examples.The simplified prerequisites are now more actionable, and the new Examples section provides immediate reference implementations. This should reduce setup friction significantly.
28-32: SPM-first approach is well-justified for modern iOS development.Repositioning Swift Package Manager as the primary installation method aligns with Apple's ecosystem direction and reduces CocoaPods maintenance burden. The step-by-step flow is clear and accessible.
content/docs/ios-swift/usage.mdx (3)
3-3: Excellent restructuring: clear three-step flow and modern async/await patterns.The reorganization into Import → Create Request → Start Verification creates a natural learning progression. Using async/await with comprehensive do-catch error handling is idiomatic Swift and makes error scenarios explicit. The optional parameters with Info.plist defaults reduce boilerplate for common cases.
Please confirm that all four
ReclaimVerificationErrorcases shown (cancelled, dismissed, sessionExpired, failed) are exhaustive and accurately reflect the current SDK API.Also applies to: 6-48
50-80: Complete parameter documentation is clear and well-organized.Explicitly marking fields as Required vs Optional, and showing the session/timestamp/signature structure, makes the API surface transparent. The providerVersion example is helpful for advanced use cases.
82-90: Alternative Methods section adds practical flexibility.The
startVerificationFromUrlexample complements the direct object-based approach, covering use cases where configuration is remote or pre-generated.
| ### CocoaPods | ||
|
|
||
| ``` | ||
| https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git | ||
| ``` | ||
|
|
||
| #### How to add a Swift Package Manager (SPM) dependency to your Xcode project: | ||
|
|
||
| 1. In your Xcode Editor's toolbar, click on `File` > `Add Package Dependency...`. | ||
| <img src="https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk/raw/53a19f88c8d90df485a60dc20190f740cd9fd108/Screenshots/Install/1.png" width="500" alt="Add a dependency to your Xcode project" /> | ||
| 2. In the `Add Package Dependency` dialog box, paste the URL `https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git` into the `Search or Enter package URL` field on the top right corner of dialog box. | ||
| <img src="https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk/raw/53a19f88c8d90df485a60dc20190f740cd9fd108/Screenshots/Install/2.png" width="500" alt="Add a dependency to your Xcode project" /> | ||
| 3. Click `Add Package`. | ||
| 4. In the other window, select your **app target** in the `Add to Targets` section and then click `Add package`. | ||
| <img src="https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk/raw/53a19f88c8d90df485a60dc20190f740cd9fd108/Screenshots/Install/3.png" width="500" alt="Add a dependency to your Xcode project" /> | ||
|
|
||
| This should complete the installation of the Reclaim InApp SDK. Now follow the [steps below to link the necessary frameworks to your Xcode project](#2-add-reclaims-xcframeworks-to-your-xcode-project). | ||
|
|
||
| ##### Note | ||
|
|
||
| - It's worth noting that you should commit the **swiftpm** folder that will be built and more specifically that the **Package.resolved** file should be included in your source control/git. | ||
|
|
||
| </Accordion> | ||
|
|
||
| <Accordion title="Method 2: When working with an Xcode Workspace project with CocoaPods"> | ||
|
|
||
| 1. Make sure to define a global platform for your project in your `Podfile` with version 13.0 or higher. | ||
| Add to your `Podfile`: | ||
|
|
||
| <Tabs items={['Latest', 'Specific Tag', 'Git HEAD']}> | ||
| <Tab value="Latest"> | ||
| ```ruby | ||
| platform :ios, '13.0' | ||
| ``` | ||
|
|
||
| 2. Add the following to your `Podfile` to override the default version of the ReclaimInAppSdk (optional): | ||
|
|
||
|
|
||
| <Tabs items={['From Cocoapods (recommended)', 'From a specific tag', 'From git HEAD', 'From a specific commit', 'From a specific branch']}> | ||
|
|
||
| ```ruby tabs="From Cocoapods (recommended)" | ||
| pod 'ReclaimInAppSdk' '~> 0.3.0' | ||
| ``` | ||
| platform :ios, '14.0' | ||
|
|
||
| ```ruby tabs="From a specific tag" | ||
| pod 'ReclaimInAppSdk', :git => 'https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git', :tag => '0.3.0' | ||
| pod 'ReclaimInAppSdk', '~> 0.21.1' | ||
| ``` | ||
| </Tab> | ||
|
|
||
| ```ruby tabs="From git HEAD" | ||
| pod 'ReclaimInAppSdk', :git => 'https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git' | ||
| ``` | ||
|
|
||
| ```ruby tabs="From a specific commit" | ||
| pod 'ReclaimInAppSdk', :git => 'https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git', :commit => '027e18b8b2365fd935e9e8585e31fa886c3af6ee' | ||
| ``` | ||
|
|
||
| ```ruby tabs="From a specific branch" | ||
| pod 'ReclaimInAppSdk', :git => 'https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git', :branch => 'main' | ||
| ``` | ||
|
|
||
| </Tabs> | ||
|
|
||
| 2. After adding the dependency, your podfile may look like this: | ||
|
|
||
| <Tab value="Specific Tag"> | ||
| ```ruby | ||
| platform :ios, '13.0' | ||
|
|
||
| target 'GitPodSwiftUIExample' do | ||
| # Comment the next line if you don't want to use dynamic frameworks | ||
| use_frameworks! | ||
|
|
||
| # Pods for GitPodSwiftUIExample | ||
| pod 'ReclaimInAppSdk', '~> 0.3.0' | ||
| platform :ios, '14.0' | ||
|
|
||
| target 'GitPodSwiftUIExampleTests' do | ||
| inherit! :search_paths | ||
| # Pods for testing | ||
| end | ||
|
|
||
| target 'GitPodSwiftUIExampleUITests' do | ||
| # Pods for testing | ||
| end | ||
|
|
||
| end | ||
| pod 'ReclaimInAppSdk', :git => 'https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git', :tag => '0.21.1' | ||
| ``` | ||
| </Tab> | ||
|
|
||
| 3. Run `pod install`. | ||
| 4. Open the `*.xcworkspace` file to work on the project. Verify that you're opening MyApp.xcworkspace and not opening MyApp.xcodeproj. The .xcworkspace file has the CocoaPod dependencies, the .xcodeproj doesn't. | ||
|
|
||
| For more info, check the [Reclaim Example - SwiftUI with CocoaPods](https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk/blob/main/Examples/SwiftUIWithPodExample/README.md) for a complete example of how to use the SDK in a SwiftUI application with CocoaPods. | ||
|
|
||
| </Accordion> | ||
|
|
||
| <Accordion title="Method 3: When working with a Swift Package Manager manifest"> | ||
|
|
||
|
|
||
| <Tabs items={['version', 'branch']}> | ||
|
|
||
| ```swift tabs="version" | ||
| .package(url: "https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git", from: "0.3.0") | ||
| ``` | ||
| <Tab value="Git HEAD"> | ||
| ```ruby | ||
| platform :ios, '14.0' | ||
|
|
||
| ```swift tabs="branch" | ||
| .package(url: "https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git", branch: "main") | ||
| pod 'ReclaimInAppSdk', :git => 'https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git' | ||
| ``` | ||
|
|
||
| </Tab> | ||
| </Tabs> | ||
|
|
||
| #### Select a product: | ||
|
|
||
| - ReclaimInAppSdk | ||
|
|
||
| ```swift | ||
| .product(name: "ReclaimInAppSdk", package: "reclaim-inapp-ios-sdk") | ||
| ``` | ||
|
|
||
| </Accordion> | ||
|
|
||
| </Accordions> | ||
|
|
||
| #### Build the project. | ||
|
|
||
| 1. If you have a `*.xcworkspace` then open `YourApp.xcworkspace` in Xcode. Verify that you're opening MyApp.xcworkspace and not opening MyApp.xcodeproj. The .xcworkspace file has the CocoaPod dependencies, the .xcodeproj doesn't. If you don't have a `*.xcworkspace` then open `YourApp.xcodeproj` in Xcode. | ||
| 2. Select **Product** > **Build** or press `Cmd + B`. | ||
|
|
||
| <Accordions> | ||
| <Accordion title="Troubleshooting: Incase your build fails when using CocoaPods"> | ||
|
|
||
| 1. Your build may fail due to an error like this: | ||
|
|
||
| <img src="https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk/raw/53a19f88c8d90df485a60dc20190f740cd9fd108/Screenshots/Install/PodBuildError.png" alt="Xcode build error due to CocoaPods" width="500" /> | ||
|
|
||
| 2. To fix this, open the `*.xcworkspace` file in Xcode. In your target's `Build Settings`, under `Build Options` Section, set `User Script Sandboxing` to `No` and build the project again. | ||
|
|
||
| <img src="https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk/raw/53a19f88c8d90df485a60dc20190f740cd9fd108/Screenshots/Install/PodBuildErrorFix.png" alt="Xcode build error due to CocoaPods" width="500" /> | ||
|
|
||
| </Accordion> | ||
| </Accordions> | ||
|
|
||
| ### 2. Fixing performance issues | ||
|
|
||
| Your app performance will be severely impacted when you run debug executable on a physical device. Fixing this requires a simple change in your Xcode project xcscheme. | ||
|
|
||
| <Accordions> | ||
| <Accordion title="Method 1: Update Environment Variables for XCScheme (Recommended)"> | ||
|
|
||
| 1. Open your project in Xcode. | ||
| 2. Click on the project target. | ||
| 3. Click on the **Scheme** dropdown. | ||
|
|
||
| <img src="https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk/raw/53a19f88c8d90df485a60dc20190f740cd9fd108/Screenshots/Install/10.png" alt="Edit current xcscheme in Xcode" width="500" /> | ||
|
|
||
| 4. Click on the **Edit Scheme** button. | ||
| 5. Click on the **Run** tab. | ||
| 6. Click on the **Arguments** tab and check the **Environment Variables** section. | ||
|
|
||
| <img src="https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk/raw/53a19f88c8d90df485a60dc20190f740cd9fd108/Screenshots/Install/12.png" alt="Enable Debug executable in Xcode" width="500" /> | ||
|
|
||
| 7. Add the following environment variable: | ||
| - Key: `GODEBUG` | ||
| - Value: `asyncpreemptoff=1` | ||
| 8. Click on the **Close** button in the dialog and build the project. | ||
| 9. Run the app on a physical device. | ||
|
|
||
| </Accordion> | ||
| <Accordion title="Method 2: Disable 'Debug executable'"> | ||
|
|
||
| This method is **not recommended** but could be useful if you don't want to add environment variables to the xcscheme. | ||
|
|
||
| 1. Open your project in Xcode. | ||
| 2. Click on the project target. | ||
| 3. Click on the **Scheme** dropdown. | ||
| Run `pod install` and open the `.xcworkspace` file. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
CocoaPods guidance is well-organized, but verify version information.
The three-tab approach (Latest, Specific Tag, Git HEAD) provides flexibility, and the iOS 14.0+ platform requirement is consistent with the updated prerequisites. However, verify that version 0.21.1 is still current and stable before release.
Run the following script to confirm the CocoaPods version is available and check for any later releases:
🏁 Script executed:
#!/bin/bash
# Description: Verify CocoaPods version 0.21.1 exists and check for latest
# Check CocoaPods registry for ReclaimInAppSdk
curl -s https://rubygems.org/api/v1/gems/cocoapods.json | jq '.version'
# Check GitHub releases for latest version
gh api repos/reclaimprotocol/reclaim-inapp-ios-sdk/releases --jq '.[0:5] | .[] | {tag_name, published_at}' 2>/dev/null || echo "Note: Install GitHub CLI to check releases"Length of output: 127
I need to verify whether version 0.21.1 actually exists on the CocoaPods registry. The GitHub releases show 0.15.0 as the latest, which is more recent than 0.21.1, suggesting there may be a version mismatch issue.
🏁 Script executed:
#!/bin/bash
# Check CocoaPods registry directly for ReclaimInAppSdk versions
curl -s https://rubygems.org/api/v1/gems/ReclaimInAppSdk.json | jq '.version, .prerelease'
# Also try fetching all versions
echo "---"
curl -s https://rubygems.org/api/v1/gems/ReclaimInAppSdk/versions.json 2>/dev/null | jq '.[0:10] | .[] | {number: .number, prerelease: .prerelease}' || echo "Full version history unavailable"Length of output: 151
The RubyGems API isn't returning valid JSON for this package. Let me check the CocoaPods specification repository directly, as that's where pod specs are hosted:
🏁 Script executed:
#!/bin/bash
# Check CocoaPods Specs repository for ReclaimInAppSdk
# CocoaPods specs are typically stored at: https://github.com/CocoaPods/Specs
# Try to fetch the podspec from CocoaPods CDN
curl -s https://cdn.cocoapods.org/Specs/ReclaimInAppSdk/0.21.1/ReclaimInAppSdk.podspec.json | head -20
echo "---"
# Check if version directory exists
curl -I https://cdn.cocoapods.org/Specs/ReclaimInAppSdk/0.21.1/ 2>&1 | grep -E "HTTP|404|200"
echo "---"
# Check latest available version in the CDN
curl -s https://cdn.cocoapods.org/Specs/ReclaimInAppSdk/ | grep -oP '0\.\d+\.\d+' | sort -V | tail -5Length of output: 20
Update version 0.21.1 to 0.15.0, the latest stable release on GitHub (published September 2025).
The documentation recommends version 0.21.1, but GitHub releases show the latest published version is 0.15.0. Since 0.21.1 does not appear in the official GitHub releases and the version number exceeds what's actually published, users may encounter installation failures with the version specified in the docs. Update both the "Latest" and "Specific Tag" tabs to use 0.15.0.
🤖 Prompt for AI Agents
In content/docs/ios-swift/installation.mdx around lines 34 to 65, the Pod
version is incorrect (0.21.1) and should be updated to the actual latest stable
release 0.15.0; update the "Latest" tab's pod declaration to use '~> 0.15.0' and
update the "Specific Tag" tab to use :tag => '0.15.0' (leave the Git HEAD tab
unchanged), then run a quick spell-check to ensure no other references to 0.21.1
remain in this section.
Description
Testing (ignore for documentation update)
Type of change
Checklist:
Additional Notes:
Summary by CodeRabbit