# Device service

### `activateDeviceService`

**Description**

Activate the current device service for data collection.

**Parameters**

* `identity` (Identity): The identity for activation.

**Returns**

* `Promise<any>`: A promise that resolves when the operation is complete.

Usage example:

```typescript
import { activateDeviceService, Identity } from "ims-react-native/src";

const identity = new Identity("API_KEY", "EXTERNAL_REFERENCE_ID");

activateDeviceService(identity).then((result: string) => {
        console.log(result);
      }).catch((error: Error) => {
        console.log(error.message);
    });
```

### `deactivateDeviceService`

**Description**

Deactivate the current device for data collection. It may be desirable to deactivate a device if the host application's user logs out or if the user becomes inactive.

**Parameters**

* `identity` (Identity): The identity for deactivation.

**Returns**

* `Promise<any>`: A promise that resolves when the operation is complete.

Usage example:

```typescript
import { deactivateDeviceService, Identity } from "ims-react-native/src";

const identity = new Identity("API_KEY", "EXTERNAL_REFERENCE_ID");

deactivateDeviceService(identity).then((result: string) => {
        console.log(result);
      }).catch((error: Error) => {
        console.log(error.message);
    });
```

### `fetchDeviceService`

**Description**

Fetch the current Device's model.

**Parameters**

* `identity` (Identity): The identity for fetching the current Device's model.

**Returns**

* `Promise<any>`: A promise that resolves with the current Device's model.

Usage example:

```typescript
import { fetchDeviceService, Identity } from "ims-react-native";

const identity = new Identity("API_KEY", "EXTERNAL_REFERENCE_ID");

fetchDeviceService(identity).then((result: string) => {
        console.log(result);
      }).catch((error: Error) => {
        console.log(error.message);
    });
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sdk.ims.tech/readme/other-platforms/react-native/using-the-sdk/device-service.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
