{"id":22646374,"url":"https://github.com/fireblocks/ncw-ios-demo","last_synced_at":"2026-02-22T20:31:50.332Z","repository":{"id":197030649,"uuid":"684569623","full_name":"fireblocks/ncw-ios-demo","owner":"fireblocks","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-10T10:32:10.000Z","size":35853,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T11:43:24.298Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fireblocks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-29T12:09:12.000Z","updated_at":"2025-04-01T11:08:08.000Z","dependencies_parsed_at":"2023-09-28T18:48:49.272Z","dependency_job_id":"39aa7746-c504-4c71-a251-897d51b5c083","html_url":"https://github.com/fireblocks/ncw-ios-demo","commit_stats":null,"previous_names":["fireblocks/ncw-ios-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fireblocks%2Fncw-ios-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fireblocks%2Fncw-ios-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fireblocks%2Fncw-ios-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fireblocks%2Fncw-ios-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fireblocks","download_url":"https://codeload.github.com/fireblocks/ncw-ios-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248501734,"owners_count":21114677,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-09T06:10:10.337Z","updated_at":"2025-10-27T13:47:18.730Z","avatar_url":"https://github.com/fireblocks.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fireblocks iOS NCW Demo\n\nThis demo application showcases both **Embedded Wallet (EW)** and **Non-Custodial Wallet (NCW)** SDKs from Fireblocks, demonstrating wallet creation, key management, transaction handling, NFT support, and Web3 capabilities for iOS applications.\n\n## SDK Overview\n\n### Embedded Wallet (EW) SDK\nThe **Embedded Wallet SDK** is Fireblocks' latest offering that simplifies wallet integration by handling all wallet management logic internally. It uses the NCW SDK as its core library for cryptographic operations while eliminating the need for a custom backend infrastructure.\n\n### Non-Custodial Wallet (NCW) SDK  \nThe **NCW SDK** provides the core cryptographic functionality for key generation and transaction signing. It serves as the foundation that powers the Embedded Wallet SDK.\n\n### How They Work Together\n- **EW SDK** is the primary SDK that uses **NCW SDK** as its core library\n- **NCW SDK** handles key generation and transaction signing operations\n- **EW SDK** manages all wallet operations, user flows, and backend communication\n- This architecture eliminates the need for developers to build custom backend services\n\n## Getting Started\n\n### Recommended Setup (Default Configuration)\nFor the best developer experience and to understand the demo code examples, use the **`EW-sandbox`** target:\n\n1. Open the `Fireblocks.xcodeproj` project with Xcode\n2. Select the **`EW-sandbox`** scheme from the scheme selector\n3. Build and run on your device or simulator\n\n### Firebase Setup (Required)\n1. **Create a Firebase Project**:\n   - Go to the [Firebase Console](https://console.firebase.google.com/)\n   - Create a new project or use an existing one\n\n2. **Add iOS App**:\n   - Add an iOS app to your Firebase project\n   - Use bundle identifier: `com.fireblocks.embeddedwallet` (recommended for Embedded Wallet)\n\n3. **Configure Authentication**:\n   - Enable Google and Apple sign-in providers in Firebase Authentication\n   - Configure OAuth settings for both providers\n\n4. **Download Configuration**:\n   - Download the `GoogleService-Info.plist` file\n   - Replace the existing `GoogleService-Info.plist` files in the respective target folders:\n     - `Targets/EW-sandbox/GoogleService-Info.plist` (recommended)\n     - `Targets/EW-production/GoogleService-Info.plist`\n     - `Targets/EW-dev/GoogleService-Info.plist`\n     - `Targets/NCW-sandbox/GoogleService-Info.plist`\n     - `Targets/NCW-production/GoogleService-Info.plist`\n     - `Targets/NCW-dev/GoogleService-Info.plist`\n\n5. **Configure URL Scheme**:\n   - Add the reversed Google Client ID to the target's `Info.plist` file:\n   ```xml\n   \u003ckey\u003eCFBundleURLTypes\u003c/key\u003e\n   \u003carray\u003e\n       \u003cdict\u003e\n           \u003ckey\u003eCFBundleTypeRole\u003c/key\u003e\n           \u003cstring\u003eEditor\u003c/string\u003e\n           \u003ckey\u003eCFBundleURLSchemes\u003c/key\u003e\n           \u003carray\u003e\n               \u003cstring\u003e***REVERSED GOOGLE CLIENT ID KEY***\u003c/string\u003e\n           \u003c/array\u003e\n       \u003c/dict\u003e\n   \u003c/array\u003e\n   ```\n\n### Transaction Updates Configuration (Embedded Wallet)\n\nThe Embedded Wallet implementation supports two methods for receiving transaction status updates:\n\n#### Push Notifications (Default - Recommended)\n- **Configuration**: `useTransactionPolling = false` in the FireblocksManager (default)\n- **Requirements**: \n  - Set up the Fireblocks minimal backend server (use our [EW Backend Demo](https://github.com/fireblocks/ew-backend-demo))\n  - Create a webhook in the Fireblocks Console\n  - Configure Firebase Cloud Messaging (FCM) for push notifications\n  - Configure APNs certificates (see detailed instructions in AppDelegate.swift)\n- **Benefits**: Real-time updates, reduced battery usage, better user experience\n\n**Important**: The EW targets use a dedicated `AppDelegate.swift` file with complete push notification implementation. This file contains:\n- Detailed APNs certificate setup instructions in the header comments\n- Firebase configuration and FCM token handling\n- Silent notification processing for transaction updates\n- Required Info.plist configuration (`FirebaseAppDelegateProxyEnabled = false`)\n\n#### Polling Mechanism (Fallback Option)\n- **Configuration**: Set `useTransactionPolling = true` in the FireblocksManager\n- **Requirements**: No additional backend setup needed\n- **Benefits**: Simpler setup, no external dependencies, works out of the box\n\n**Note**: The demo uses push notifications (`useTransactionPolling = false`) by default for optimal performance. You can switch to polling (`useTransactionPolling = true`) if you prefer a simpler setup without backend requirements.\n\n### Build Targets\n\nThe project uses different targets for various SDK and environment configurations:\n\n#### Embedded Wallet Targets (Recommended):\n- **`EW-sandbox`** - EW SDK with Sandbox environment (recommended for development)\n- **`EW-production`** - EW SDK with Production environment\n- **`EW-dev`** - EW SDK with Development environment (Fireblocks internal)\n\n#### NCW Targets:\n- **`NCW-sandbox`** - NCW SDK with Sandbox environment\n- **`NCW-production`** - NCW SDK with Production environment  \n- **`NCW-dev`** - NCW SDK with Development environment (Fireblocks internal)\n\n### Build and Run\n\n1. **Clone the repository**:\n   ```bash\n   git clone git@github.com:fireblocks/ncw-ios-demo.git\n   ```\n2. **Set up Firebase** (see Firebase Setup section above)\n3. **Open the project**:\n   - Open `Fireblocks.xcodeproj` with Xcode\n4. **Select your target** (EW-sandbox recommended)\n5. **Build and run** on your device or simulator\n\n### Project Structure\n\n```\nFireblocks/\n├── Managers/\n│   ├── EW/                     # Embedded Wallet managers\n│   │   ├── EWManager.swift\n│   │   └── FireblocksManager.swift\n│   └── NCW/                    # NCW managers\n│       ├── FireblocksManager.swift\n│       └── Models/\n├── UI/\n│   ├── SwiftUIViews/          # Modern SwiftUI screens\n│   └── Auth/                  # Authentication flows\n├── Targets/                   # Target-specific configurations\n│   ├── EW-sandbox/           # EW Sandbox config\n│   ├── EW-production/        # EW Production config\n│   ├── NCW-sandbox/          # NCW Sandbox config\n│   └── NCW-production/       # NCW Production config\n└── Assets/                   # Shared resources\n```\n\n## Documentation\n\nFor comprehensive documentation, setup guides, and API references:\n\n📖 **[Fireblocks NCW Developer Guide](https://ncw-developers.fireblocks.com/docs/getting-started)**\n\nThe developer guide includes:\n- Detailed setup instructions\n- API documentation (Swift documentation available)\n- Integration examples\n- Best practices\n- Troubleshooting guides\n\n## Key Features Demonstrated\n\n- 🔐 **Wallet Creation \u0026 Recovery** - Generate new wallets or recover existing ones\n- 🔑 **Key Management** - Secure key generation, backup, and recovery\n- 💸 **Transactions** - Send, receive, and track cryptocurrency transactions with real-time updates\n- 🖼️ **NFT Support** - View, manage, and transfer NFTs across supported networks\n- 🌐 **Web3 Integration** - Connect to dApps and sign Web3 transactions\n- 📱 **Multi-Device** - Add and manage multiple devices per wallet\n- 🔒 **Biometric Security** - Face ID and Touch ID integration\n- 🔔 **Push Notifications** - Real-time transaction status updates (EW implementation)\n- ☁️ **Cloud Backup** - Google Drive and iCloud backup integration\n- 🎨 **Modern iOS UI** - Built with SwiftUI and UIKit\n\n## Architecture Highlights\n\n### Managers Layer\n- **EWManager**: Handles Embedded Wallet operations and backend communication\n- **FireblocksManager**: Core wallet operations for both EW and NCW implementations\n- **RecoverManager**: Manages wallet recovery flows\n- **BackupRepository**: Handles cloud backup operations\n\n### UI Layer\n- **SwiftUI Views**: Modern declarative UI for new features\n- **UIKit Controllers**: Legacy screens with Xib files\n- **Responsive Design**: Adapts to different iOS device sizes\n\n### Target-Specific Code\n- Environment constants per target\n- Firebase configurations per environment\n- App icons and branding per SDK type\n\n## Requirements\n\n- iOS 14.0+\n- Xcode 13.0+\n- Swift 5.5+\n- Firebase project with authentication configured\n- Valid Fireblocks workspace configuration\n\n## Dependencies\n\nThe demo includes:\n- **FireblocksSDK.xcframework** - Core NCW/EW functionality\n- **Firebase** - Authentication and messaging\n- **Google Sign-In** - OAuth authentication\n- **Apple Sign-In** - Native iOS authentication\n\n## Development Notes\n\n### Environment Configuration\nEach target has its own environment constants file:\n- `EnvironmentConstantsEWSandbox.swift` (EW Sandbox)\n- `EnvironmentConstantsEWProduction.swift` (EW Production)\n- `EnvironmentConstants.swift` (NCW Sandbox)\n- `EnvironmentConstantsProd.swift` (NCW Production)\n\n### Push Notifications Implementation (EW Targets)\nThe EW targets include a complete push notification implementation in `AppDelegate.swift`. **This file contains critical setup instructions and code that will save you significant development time.**\n\n**Key Implementation Details:**\n- **APNs Certificate Setup**: Complete step-by-step instructions in the file header comments, including how to generate, convert, and upload certificates to Firebase\n- **Firebase Configuration**: Automatic FCM token registration and handling\n- **Silent Notifications**: Handles background transaction updates via `didReceiveRemoteNotification`\n- **Notification Delegates**: Implements both `UNUserNotificationCenterDelegate` and `MessagingDelegate`\n- **Token Management**: Automatic registration of both APNs and FCM tokens with Fireblocks backend\n\n**Required Info.plist Configuration:**\n```xml\n\u003ckey\u003eFirebaseAppDelegateProxyEnabled\u003c/key\u003e\n\u003cfalse/\u003e\n```\nThis disables Firebase's automatic method swizzling, allowing manual notification handling.\n\n**Note**: The AppDelegate implementation is ready-to-use and handles all the complexity of iOS push notifications for you. Simply follow the certificate setup instructions in the comments.\n\n### Backup Integration\nThe demo supports multiple backup providers:\n- Google Drive (configured via Firebase)\n- iCloud (iOS native)\n- Manual passphrase backup\n\n## Support\n\nFor technical support and questions:\n- Review the [Developer Documentation](https://ncw-developers.fireblocks.com/docs/getting-started)\n- Check the code examples in this demo app\n- Contact Fireblocks support for additional assistance\n\n## License\n\nMIT License\n\nCopyright (c) Fireblocks Ltd.\n\nThis demo application is provided for educational and development purposes to showcase Fireblocks SDK integration patterns.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffireblocks%2Fncw-ios-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffireblocks%2Fncw-ios-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffireblocks%2Fncw-ios-demo/lists"}