A complete sample iOS application demonstrating the integration of Nimbbl payment services using both the Core API SDK and WebView SDK.
This sample app showcases how to integrate Nimbbl payment services into your iOS application. It demonstrates:
- Complete payment checkout flow
- Integration with both Core API SDK and WebView SDK
- Modern UI with payment customization options
- Error handling and user feedback
- Settings and configuration management
- β Complete checkout flow implementation
- β Order creation and management
- β Payment processing with WebView interface
- β Success and error handling
- β Transaction status tracking
- β Modern, intuitive interface
- β Payment amount customization
- β Currency selection (INR, USD, etc.)
- β Payment method customization
- β Header customization options
- β User details collection
- β Settings management
- β Integration with Core API SDK
- β Integration with WebView SDK
- β Delegate-based callbacks
- β Error handling and logging
- β Build scripts for development
- β Production-ready configuration
- iOS: 13.0+
- Xcode: 12.0+
- Swift: 5.0+
- CocoaPods: Latest version
git clone https://github.com/nimbbl-tech/nimbbl_ios_sample_app.git
cd nimbbl_ios_sample_appThe sample app uses local SDK dependencies. Make sure you have the following repositories cloned in the same directory:
# Clone Core API SDK
git clone https://bitbucket.org/nimbbl-tech/nimbbl_mobile_kit_ios_core_api_sdk.git
# Clone WebView SDK
git clone https://bitbucket.org/nimbbl-tech/nimbbl_mobile_kit_ios_webview_sdk.gitpod installopen NimbblSampleApp.xcworkspace- Open the workspace in Xcode
- Select your target device (iPhone Simulator or physical device)
- Build and run the project (β+R)
- Amount: Set payment amount (default: βΉ100)
- Currency: Select currency (INR, USD, etc.)
- Payment Options: Customize payment methods
- Header Options: Customize checkout header
- Name: Customer name
- Phone: Contact number
- Email: Email address
- Toggle: Enable/disable user details collection
- Configure payment settings
- Tap "Pay Now" to start checkout
- Complete payment in the WebView interface
- View results (success/error)
- Environment URL: Configure API endpoints
- QA Environment: Switch between environments
NimbblSampleApp/
βββ App/
β βββ AppDelegate.swift
β βββ LaunchScreen.storyboard
β βββ NimbblCheckout-Bridging-Header.h
βββ Extensions/
β βββ UIColor+Hex.swift
β βββ UIComponents.swift
β βββ ViewController+UITextFieldDelegate.swift
βββ Models/
β βββ IconWithName.swift
β βββ ImageWithName.swift
βββ Resources/
β βββ Assets.xcassets/
βββ Supporting/
β βββ AppConstants.swift
β βββ CODE_ORGANIZATION.md
β βββ Config.swift
βββ ViewModels/
β βββ Payment/
β β βββ PaymentManager.swift
β βββ User/
β βββ UserDetailsManager.swift
βββ Views/
β βββ Payment/
β β βββ HeaderOptionsBottomSheetViewController.swift
β β βββ PaymentOptionsBottomSheetViewController.swift
β β βββ SubPaymentOptionsBottomSheetViewController.swift
β βββ Settings/
β β βββ SettingsViewController.swift
β βββ ThankYou/
β β βββ ThankYouVC.swift
β βββ ViewController.swift
βββ Podfile
βββ Podfile.production
βββ build_without_sandbox.sh
βββ clean_project.rb
The sample app supports multiple environments:
// Development Environment
let devUrl = "https://api-qa1.nimbbl.tech"
// Production Environment
let prodUrl = "https://api.nimbbl.tech"The sample app demonstrates integration with both SDKs:
// Core API SDK Integration
import nimbbl_mobile_kit_ios_core_api_sdk
let sdk = NimbblCoreApiSDK.shared
sdk.updateOrderDetails(token: orderToken, orderId: orderId) { result in
// Handle response
}
// WebView SDK Integration
import nimbbl_mobile_kit_ios_webview_sdk
NimbblCheckoutSDK.shared.delegate = self
let options = NimbblCheckoutOptions()
options.orderToken = "your_order_token"
NimbblCheckoutSDK.shared.checkout(from: self, options: options)The sample app includes various customization options:
- Header Options: Customize checkout header appearance
- Payment Options: Configure available payment methods
- Amount & Currency: Set payment amount and currency
- User Details: Collect customer information
// Customize checkout options
let options = NimbblCheckoutOptions()
options.orderToken = orderToken
options.amount = amount
options.currency = currency
options.customerName = customerName
options.customerEmail = customerEmail
options.customerPhone = customerPhone
// Start checkout
NimbblCheckoutSDK.shared.checkout(from: self, options: options)The project includes helpful build scripts:
# Build without code signing (for development)
./build_without_sandbox.sh
# Clean project
ruby clean_project.rbThe sample app includes comprehensive logging:
// Enable debug logging
LogUtil.debugLog(tag: "SampleApp", message: "Debug message")
// Error logging
LogUtil.errorLog(tag: "SampleApp", message: "Error occurred")-
Build Errors
- Ensure all SDK repositories are cloned
- Run
pod installto install dependencies - Clean build folder (β+Shift+K)
-
Runtime Errors
- Check network connectivity
- Verify API endpoints in settings
- Check console logs for error messages
-
Payment Issues
- Verify order token is valid
- Check payment amount and currency
- Ensure proper delegate implementation
- Documentation: Check the SDK documentation
- Issues: Report issues on GitHub
- Support: Contact support@nimbbl.com
- Update API endpoints to production URLs
- Configure code signing for App Store distribution
- Test thoroughly on physical devices
- Review security settings and configurations
# Production build
xcodebuild -workspace NimbblSampleApp.xcworkspace \
-scheme NimbblSampleApp \
-configuration Release \
-destination 'generic/platform=iOS' \
archiveThis sample app is provided as-is for demonstration purposes. See the LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
For support and questions:
- Email: support@nimbbl.com
- Website: https://nimbbl.com
- Documentation: Nimbbl Developer Docs
Happy Coding! π