iOS

System requirements:

  • iOS 11 or higher
  • Xcode 13 or higher
  • supported architectures: arm64 / x86_64 / Apple Silicon 

Integration Guide

  1. Add 'DashcamSDK.xcframework' to your project:

    • Manual integration:
      • drag and drop DashcamSDK.xcframework to your project
      • add nested frameworks opnecv2.xcframework and SignsFramework.xcframework
      • make them 'Embed & Sign'

  2. Add 'Navmii SDK' Swift Package via SPM:

  3. Import DashcamSDK to your project:

    • Swift:
      'import NMDDashcamSDK'

    • Objective-C:
      '#import <NMDDashcamSDK/NMDDashcamSDK.h>'

  4. Add provided API key to your 'Info.plist':

    <key>NavmiiAPIKey</key>

    <string>YOUR_API_KEY</string>

  5. Setup App permissions:

    The SDK uses device's camera, microphone, Library access, Location and Motion services. You're required to have the following keys in your application's 'Info.plist' file:

    <key>NSAppleMusicUsageDescription</key>

    <string>Navmii Dashcam saves recorded videos to your photo library</string>

    <key>NSCameraUsageDescription</key>

    <string>Navmii Dashcam uses the camera to record the road ahead</string>

    <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>

    <string>Navmii Dashcam uses GPS to ascertain your speed and warn you if you are speeding</string>

    <key>NSLocationAlwaysUsageDescription</key>

    <string>Navmii Dashcam uses GPS to ascertain your speed and warn you if you are speeding</string>

    <key>NSLocationUsageDescription</key>

    <string>Navmii Dashcam uses GPS to ascertain your speed and warn you if you are speeding</string>

    <key>NSLocationWhenInUseUsageDescription</key>

    <string>Navmii Dashcam uses GPS to ascertain your speed and warn you if you are speeding</string>

    <key>NSMicrophoneUsageDescription</key>

    <string>Navmii Dashcam uses the microphone to record in car audio with your Dashcam footage</string>

    <key>NSMotionUsageDescription</key>

    <string>Navmii Dashcam uses motion information to automatically protect your current video if a sudden stop is detected</string>

    <key>NSPhotoLibraryAddUsageDescription</key>

    <string>Navmii Dashcam saves recorded videos to your photo library</string>



  6. Setup controllers:

    Swift:

            AVCaptureDevice.requestAccess(for: .video) { result in

                DispatchQueue.main.async {

                    let adasController = NMDDashcamSDK.sharedInstance().adasController()

                    adasController.setRecognitionFeatureEnabled(.speedSigns, isEnabled: true)

                    adasController.signRecognitionDelegate = self

                    

                    let cameraController = NMDDashcamSDK.sharedInstance().cameraController()

                    cameraController.videoOutputSettingsPreset = .preset3840x2160

                    cameraController.prefersWideAngleCamera = true

                    cameraController.startPreview(in: self.view)

                }

            }

    Objective-C:

        [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {

            dispatch_async(dispatch_get_main_queue(), ^{

                NMDADASController *adasController = [NMDDashcamSDK sharedInstance].adasController;

                [adasController setRecognitionFeatureEnabled:NMDRecognitionFeatureSpeedSigns isEnabled:YES];

                adasController.signRecognitionDelegate = self;

                NMDCameraController *cameraController = [NMDDashcamSDK sharedInstance].cameraController;

                cameraController.videoOutputSettingsPreset = AVOutputSettingsPreset3840x2160;

                cameraController.prefersWideAngleCamera = YES;

                [cameraController startPreviewInView:self.view];

            });

        }];

  7. Build and run.

API reference: