Skip to main content

iOS - MRDC Camera Module

The MRDCCameraModule interface provides capability to a module to present custom Mobile Remote Deposit Capture (MRDC) Camera functionality. Implementing module can provide their own camera view UI for capturing check images as part of Deposit check functionality within online banking.

This module provides control over the camera presentation and image capture process for Mobile Remote Deposit Capture functionality which user can access via Menu > Transactions > Deposit Check from side menu.

Implementation

Implementing an MRDCCameraModule requires creating a custom camera controller and handling the capture delegate methods. The module should provide a camera view controller and manages the presentation lifecycle.

note

If you are inheriting from Q2ModuleBase, it provides a default implementation of MRDCCameraModule. You need to override the methods specified in the MRDCCameraModule protocol to provide your custom functionality.

Sample MRDCCameraModule Implementation
import UIKit

class CustomMRDCCameraModule: MRDCCameraModule {

func remoteDepositCameraController(withDelegate delegate: MRDCCaptureImageControllerDelegate) -> UIViewController? {
let cameraController = CustomCameraViewController()
cameraController.captureDelegate = delegate
return cameraController
}

func didFinishPresentingRemoteDepositCamera() {
// Handle cleanup after camera dismissal
print("MRDC camera presentation finished")
}
}

class CustomCameraViewController: UIViewController {
weak var captureDelegate: MRDCCaptureImageControllerDelegate?

override func viewDidLoad() {
super.viewDidLoad()
setupCameraInterface()
}

private func captureImage() {
// Implement image capture logic
let capturedImage = UIImage() // Your captured image
let dataPackage = NSData() // Additional image data

captureDelegate?.didCaptureImage(image: capturedImage, dataPackage: dataPackage)
}
}

MRDCCaptureImageControllerDelegate

The delegate provides methods to control the capture process and handle captured images:

Required Methods

  • shouldCaptureSide() -> MRDCCheckSide - Determines which side of the check to capture
  • shouldCloseCapture() -> Bool - Controls whether the camera should close
  • didCaptureImage(image: UIImage?, dataPackage: NSData?) - Handles successful image capture
  • didCompleteImageCapture() - Notifies completion of the capture process
  • didCancelImageCapture() - Handles user cancellation
  • didFailImageCapture(error: NSError) - Handles capture failures

Implementation Example

Handling Delegate Methods
extension CustomCameraViewController: MRDCCaptureImageControllerDelegate {

func shouldCaptureSide() -> MRDCCheckSide {
// Return the appropriate check side to capture
return .front
}

func shouldCloseCapture() -> Bool {
// Determine if capture should close
return true
}

func didCaptureImage(image: UIImage?, dataPackage: NSData?) {
// Process the captured image and data
guard let image = image else { return }
// Handle the captured image
}

func didCompleteImageCapture() {
// Handle completion
dismiss(animated: true)
}

func didCancelImageCapture() {
// Handle cancellation
dismiss(animated: true)
}

func didFailImageCapture(error: NSError) {
// Handle capture failure
print("Image capture failed: \(error.localizedDescription)")
}
}

How to Test

Prerequisites

Your settings.json file should include a NativeMRDCModule entry with identifier rdc which will be responsible for presenting UI to initiate mobile deposit check flow.

settings.json Configuration
{
"targetURLBase": "",
"targetPageName": "uux.aspx",
"enableDevMode": true,
"nativeMenu": true,
"modules": [
{
"name": "MyMRDCCameraModule",
"packageName": "module-package-name",
"productName": "ModuleProductName",
"className": "ModuleClassModule",
"identifier": "com.q2.mobile.module.{MyMRDCCameraModule}", // your identifier
"data": "",
"enabled": true
},
{
"name": "NativeMRDC",
"packageName": "Q2MobileCore",
"className": "NativeMRDCModule",
"identifier": "rdc", // important
"data": "",
"enabled": true
}
]
}

Steps

  1. Login
  2. Tap on Menu
  3. Transactions > Deposit Check

Following UI would be presented.

Mobile Deposit Check UI

  1. Select account under Ovserseas Deposit Account
  2. Enter value in Amount field.
  3. Tap on Front of check or Back of check

Q2MobileCore will now request UI from your module and present it to the user.

Platform Availability

note

This module is not available on watchOS.