iOS SDK
iOS SDK allows you to add an Urbi map to your iOS application. Using the SDK, you can display a map on the screen, get information about map objects, use the navigator, build routes, and so on.
See SDK usage examples in the Examples section. For a detailed description of all classes and methods, see API Reference.
Geodata complies with OGC standards.
Getting API keys
To work with SDK, you need to get the key file dgissdk.key
with the obligatory indication of the appId
of the application for which this key is created. This key will be used to connect to Urbi servers and retrieve the geographical data, as well as to use offline data and the navigator. This key is unique to the SDK and cannot be used with other Urbi SDKs.
To obtain this key file, fill in the form at urbi.ae.
When the key is activated, you can sign in to the Platform Manager and check the statistics of request distribution.
System requirements
- Xcode 14
- iOS 13 and later / iPadOS 13 and later (this SDK uses SwiftUI)
SDK versions
iOS SDK packages are available in two versions:
- Full is a full version that allows you to:
- Add a map to the application and manage it: add markers and geometric shapes, control the camera movement, display layers (for example, traffic), work with map styles, etc.
- Search for objects in the directory: organizations, buildings, places, and others.
- Work with the navigator in the application in one of the three modes: free-drive, turn-by-turn, or simulated navigation.
- Build optimal routes on the map, including routes inside buildings.
- Use offline data.
- Map is a lightweight version that allows you to:
Important
You cannot use Full and Map simultaneously. It causes an assembly error.
Installation
Swift Package Manager
To install iOS SDK via Swift Package Manager, add a package dependency to your project. See Apple documentation for instructions on installing Swift packages.
To connect SDK, specify the URL depending on the version:
https://github.com/2gis/mobile-sdk-full-swift-package
for the Full SDK version.https://github.com/2gis/mobile-sdk-map-swift-package
for the Map SDK version.
CocoaPods
To install iOS SDK via CocoaPods, add the DGisMobileSDK
dependency.
Use Swift Package Manager versioning, adding the -full
or -map
postfix, depending on the required SDK version.
You can view the pod specification at one of the following URLs:
https://github.com/2gis/mobile-sdk-full-swift-package/blob/master/DGisMobileSDK.podspec
for the Full SDK version.https://github.com/2gis/mobile-sdk-map-swift-package/blob/master/DGisMobileSDK.podspec
for the Map SDK version.
Binary artifact
You can download frameworks directly without using package managers. To do this, refer to the repository that contains the package specification for CocoaPods or Swift Package Manager:
https://github.com/2gis/mobile-sdk-full-swift-package
for the Full SDK version.https://github.com/2gis/mobile-sdk-map-swift-package
for the Map SDK version.
The Package.swift
file will contain a URL leading to downloading the SDK archive via a direct link. To navigate through versions, use git tags.
Demo project
You can find a demo app with the source code in our GitHub repository.