---
updatedAt: 2026-05-21T09:46:04.000Z
agentTools:
  projectIndex: https://docs.damoov.com/llms.txt
---

# Setting up for iOS app

** Add a key to ```Info.plist``` file of your app with a description of the requirement why they need Bluetooth: ```Privacy - Bluetooth Peripheral Usage.

## Setting up the environment

***

* Add a key to `Info.plist` file of your app with a description of the requirement why they need Bluetooth: `Privacy - Bluetooth Peripheral Usage Description`

* In xCode, in the Signing & Capabilities project section, add the following items:
  * Uses Bluetooth LE accessories
  * Acts as a Bluetooth LE accessory

* When initialisingRaxelPulse SDK library, be sure to call:

[block:code]
{
  "codes": [
    {
      "code": "[[RPCPermissionsWizard returnInstance] setupBluetoothEnabled];\n[RPEntry enableELM: YES];",
      "language": "objectivec"
    },
    {
      "code": "RPPermissionsWizard.returnInstance().setupBluetoothEnabled()\nRPEntry.enableELM(true)",
      "language": "swift"
    }
  ]
}
[/block]

## Setting up the connection

***

To set up the connection between SDK and device, please follow the steps below:

### 1. Search Bluetooth device

[block:code]
{
  "codes": [
    {
      "code": "[[RPELMEntry instance] getELMDevicesWithCompletion:^(id  _Nullable response, NSArray * _Nullable errors) {\n    for(RPELMItem *item in response) {\n        NSLog(@\"item.tag = %@ item.uuid = %@\", item.name, item.uuid);\n    }\n}];",
      "language": "objectivec"
    },
    {
      "code": "RPELMEntry.instance().getELMDevices{response, errors in\n    //\n}",
      "language": "swift"
    }
  ]
}
[/block]

### 2. Get a vehicle

if you haven't registered a vehicle yet, please refer to the [\_Vehicle management](https://docs.damoov.com/docs/vehicle-management)

[block:code]
{
  "codes": [
    {
      "code": "[[RPELMEntry instance] getVehicles:^(id  _Nullable response, NSArray * _Nullable errors) {\n    NSLog(@\"%@\", response);\n}];",
      "language": "objectivec"
    },
    {
      "code": "RPELMEntry.instance().getVehicles{response, errors in\n    self.vehiclesArray = response as! NSArray\n}",
      "language": "swift"
    }
  ]
}
[/block]

### 3. Connect Bluetooth OBD to the vehicle (from the step above)

[block:code]
{
  "codes": [
    {
      "code": "[[RPELMEntry instance] connectDevice:@\"UUID_DEVICE_TOKEN\" vehicleToken:@\"VEHICLE_TOKEN\" withCompletion:^(BOOL response, NSArray * _Nullable errors) {\n    if (response) {\n        // Success\n    } else {\n        NSLog(@\"error - %@\", [error localizedDescription]);\n    }\n}];",
      "language": "objectivec"
    },
    {
      "code": "RPELMEntry.instance().connectDevice(\"UUID_DEVICE_TOKEN\", vehicleToken:\"VEHICLE_TOKEN\", withCompletion: {[weak self] response, errors in\n    guard let strongSelf = self else {\n        return\n    }\n            \n    if response == true {\n        print(\"\\(response)\")\n    }\n})",
      "language": "swift"
    }
  ]
}
[/block]

[block:callout]
{
  "type": "info",
  "body": "When connecting to ELM, you may experience difficulties getting a repetitive response in the [RPELMEntry instance] connectDevice method.\nWe recommend doing DispatchQueue.once (token: \"com.<YOURAPPNAME>.elm\"). \n\nPlease refer to the code example below in Swift language",
  "title": "Troubleshouting"
}
[/block]

[block:code]
{
  "codes": [
    {
      "code": "[[RPELMEntry instance] connectDevice:@\"UUID_DEVICE_TOKEN\" vehicleToken:@\"VEHICLE_TOKEN\" withCompletion:^(BOOL response, NSArray * _Nullable errors) {\n    if (response) {\n        // Success\n    } else {\n        NSLog(@\"Errors %@\", errors);\n    }\n}];",
      "language": "objectivec"
    },
    {
      "code": "RPELMEntry.instance().connectDevice(\"UUID_DEVICE_TOKEN\", vehicleToken: \"VEHICLE_TOKEN\", withCompletion: {[weak self] response, errors in\n    guard let strongSelf = self else {\n        return\n    }\n    \n    if let theErrors = errors as? [NSError] {\n        var isNetwork = false\n        for item in theErrors {\n            if item.code == 2005 {\n                isNetwork = true\n                break;\n            }\n        }\n        if isNetwork {\n            //Internet connection error\n        }\n        \n        DispatchQueue.main.async {\n                    \n            if response == true {\n                print(\"\\(response)\")\n            } else {\n                print(\"\\(response)\")\n\n                DispatchQueue.once(token: \"com.<YOURAPPNAME>.elm\") {\n                    //Next connection action\n                }\n            }\n    })",
      "language": "swift"
    }
  ]
}
[/block]

## Get connection status

At any time you can request the status of the connection to ELM (connected/not connected) and the timestamp date of the last connection.

**Connection status**

[block:code]
{
  "codes": [
    {
      "code": "BOOL isConnect = [[[RPELMEntry instance] getLastSession] isConnect];",
      "language": "objectivec"
    },
    {
      "code": "let isConnect = RPELMEntry.instance().getLastSession().isConnect",
      "language": "swift"
    }
  ]
}
[/block]

**Timestamp date of the last connection.**

[block:code]
{
  "codes": [
    {
      "code": "NSDate *lastConnect = [[[RPELMEntry instance] getLastSession] lastConnect];",
      "language": "objectivec"
    },
    {
      "code": "let lastConnect = RPELMEntry.instance().getLastSession().lastConnect",
      "language": "swift"
    }
  ]
}
[/block]