Documentation Index
Fetch the complete documentation index at: https://mintlify.com/frol/near-connect-ios/llms.txt
Use this file to discover all available pages before exploring further.
Swift Package Manager
NEAR Connect iOS is distributed via Swift Package Manager. There are two ways to add it to your project:Method 1: Xcode UI (Recommended)
The easiest way to add NEAR Connect iOS is through Xcode’s package manager interface:Enter Repository URL
Paste the repository URL into the search field:Press Enter to search for the package.
Select Version
Choose your preferred version rule:
- Up to Next Major Version:
1.0.0(recommended) - Up to Next Minor Version:
1.0.0 - Exact Version: Lock to a specific release
- Branch: Use
mainfor the latest changes
Add to Target
Select the
NEARConnect library and add it to your app target.Click Add Package to complete the installation.Method 2: Package.swift
If you’re building a Swift package or prefer editingPackage.swift directly:
Add Package Dependency
Open your
Package.swift file and add NEAR Connect iOS to the dependencies array:Package.swift
The package name in the URL is
near-connect-ios, but the product name you import is NEARConnect.Resolve Dependencies
Run the following command in your terminal:Or in Xcode: File > Packages > Resolve Package Versions
Verifying Installation
To verify NEAR Connect iOS is installed correctly, create a simple test:ContentView.swift
Platform Requirements
NEAR Connect iOS requires:| Requirement | Version |
|---|---|
| iOS | 16.0 or later |
| Swift | 5.9 or later |
| Xcode | 16.0 or later |
The iOS 16 requirement is due to the use of modern Swift concurrency features and SwiftUI APIs. If you need to support earlier iOS versions, consider using callbacks or older async patterns.
Info.plist Configuration (Optional)
Some NEAR wallets use deep links to return to your app after authentication. To support these flows:1. Register a Custom URL Scheme
Add a URL scheme to your app’sInfo.plist:
Info.plist
yourapp with your app’s unique identifier.
2. Handle Incoming URLs
In your app’s main view or scene:For most wallets, deep link handling is automatic. You only need custom handling if you’re implementing wallet-specific callback logic.
Troubleshooting
Package Resolution Fails
If Xcode can’t resolve the package:- Check your internet connection
- Verify the repository URL is correct
- Try File > Packages > Reset Package Caches
- Check that your Xcode version meets the minimum requirements
Build Errors
If you see compiler errors after adding the package:- Ensure your project’s iOS deployment target is set to iOS 16.0 or later
- Clean the build folder: Product > Clean Build Folder (⇧⌘K)
- Delete derived data:
~/Library/Developer/Xcode/DerivedData
WebView Not Loading
If the wallet UI doesn’t appear:- Check the Xcode console for JavaScript errors
- Enable WebView inspection in Safari: Settings > Safari > Advanced > Web Inspector
- Verify your device/simulator has an internet connection (the bridge loads from CDN)
Next Steps
Quick Start Guide
Build your first wallet connection in under 5 minutes
API Reference
Explore the complete NEARWalletManager API