Getting Started with Wemap SDKs

The Wemap SDKs provide comprehensive location tracking, routing, and navigation capabilities for mobile applications. This guide will help you get started with the SDKs, focusing on the positioning package.

Overview

The Wemap SDKs are organized into several frameworks:

Requirements

Different Wemap SDKs have different requirements, but these are the common requirements applied to all of them.

  • iOS 13 or newer
  • Xcode 26.0 or newer
  • Swift 5.9 or newer

Installation

Before you start developing your application with WemapSDKs, you need to add the SDK as a dependency.

Adding the Dependency

To add WemapSDKs to your app:

Swift Package Manager

  1. In your Xcode project or workspace, click on File > Add Packages Dependencies...
  2. Paste the following GitHub URL into the search bar in the top right corner: https://github.com/wemap/wemap-sdk-ios-distribution
  3. Select the Dependency Rule you want to apply to the Wemap SDKs
    • We recommend selecting Up to Next Minor Version for the Dependency Rule, specifying the latest version (ex.: 0.28.0) as the minimum version. This allows you to select the most recently released stable patch version of the SDKs.
  4. Click on Add Package.
  5. In the new window, click on the dropdown Add to Target and select your project target. spm-add-package
  6. Click Add Package.
  7. Verify that you can import WemapMapSDK (or any other WemapSDK) in your app.

CocoaPods

  1. Add dependencies in the Podfile

    Add the required WemapSDK pods to your app:

    use_frameworks!
    
    target 'TargetNameOfYourApp' do
        # to use Wemap custom interactive maps
        pod 'WemapMapSDK', '<version>'
    
        # to use Wemap GeoAR for navigation
        pod 'WemapGeoARSDK', '<version>'
    
        # to use Wemap positioning system 
        pod 'WemapPositioningSDK/VPSARKit', '<version>' # Wemap VPS ARKit Location Source (best for indoor)
        pod 'WemapPositioningSDK/GPS', '<version>' # GPS Location Source (best for outdoor)
    end
    
  2. Ensure minimum iOS version

    Your project must target iOS 13.0 or later:

    platform :ios, '13.0'
    
  3. Install dependencies and open the project

    Run the following command to install the pods:

    bundle exec pod install --repo-update
    

    Then, open your project in Xcode:

    open your-project.xcworkspace
    

Fetching MapData

MapData is a configuration object crucial for any WemapSDK initialization.

You must have a mapID and token to request this object. For more details, please contact the Wemap team.

Below there are examples of how to fetch MapData object using different SDKs.

WemapPositioningSDK or WemapCoreSDK

ServiceFactory
    .getMapService()
    .map(byID: 19158, token: "GUHTU6TYAWWQHUSR5Z5JZNMXX") // Specify your mapID and token here
    .receive(on: DispatchQueue.main)
    .sink(receiveCompletion: {
        if case let .failure(error) = $0 {
            debugPrint("Failed to get map data with error - \(error)")
        }
    }, receiveValue: { mapData in
         // now you have MapData and can use it to continue with any WemapSDK
    })
    .store(in: &cancellables)

WemapMapSDK

WemapMap.shared
    .getMapData(mapID: 19158, token: "GUHTU6TYAWWQHUSR5Z5JZNMXX") // Specify your mapID and token here
    .sink(receiveCompletion: {
        if case let .failure(error) = $0 {
            debugPrint("Failed to get map data with error - \(error)")
        }
    }, receiveValue: { [self] mapData in
        // now you have MapData and can use it to continue with any WemapSDK
    })
    .store(in: &cancellables)

Examples

For additional examples and sample implementations of WemapSDKs, visit the official GitHub repository.

Clone the repository and follow the README instructions to run the sample application.