iOS
System requirements:
- iOS 11 or higher
- Xcode 13 or higher
- supported architectures: arm64 / x86_64 / Apple Silicon
Integration Guide
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'
- Manual integration:
Add 'Navmii SDK' Swift Package via SPM:
- Open your Project → Package Dependencies Tab and add package's url 'https://gitlab.navmii.com/public_ios/navmii-sdk-online.git'
- Open your Project → Package Dependencies Tab and add package's url 'https://gitlab.navmii.com/public_ios/navmii-sdk-online.git'
Import DashcamSDK to your project:
- Swift:
'import NMDDashcamSDK' - Objective-C:
'#import <NMDDashcamSDK/NMDDashcamSDK.h>'
- Swift:
Add provided API key to your 'Info.plist':
<key>NavmiiAPIKey</key>
<string>YOUR_API_KEY</string>
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>
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];
});
}];
Build and run.