> For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt.

# addLynxBackgroundRuntimeClient

APISummary
为 `LynxBackgroundRuntime` 注册生命周期事件监听。

## 语法

### Android

```java
public void addLynxBackgroundRuntimeClient(LynxBackgroundRuntimeClient client);
```

#### 参数说明

- `client`: 客户端实现的结构，并注册给 `LynxBackgroundRuntime` 实例，用于获取后台运行时生命周期各流程回调。

### iOS

```objc
- (void)addLifecycleClient:(nonnull id<LynxBackgroundRuntimeLifecycle>)lifecycleClient;
```

#### 参数说明

- `lifecycleClient`: 客户端实现的结构，并注册给 `LynxBackgroundRuntime` 实例，用于获取后台运行时生命周期各流程回调。

### Harmony

```ts
public addLifecycleClient(client: LynxBackgroundRuntimeClient): void;
```

#### 参数说明

- `client`: 客户端实现，并注册给 `LynxBackgroundRuntime` 实例，用于接收生命周期回调。

## 兼容性

**Compatibility Table**

**Query:** `lynx-native-api.lynx-background-runtime.add-lynx-background-runtime-client`

[Source](https://github.com/lynx-family/lynx-website/tree/main/packages/lynx-compat-data/lynx-native-api/lynx-background-runtime/add-lynx-background-runtime-client.json)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| add-lynx-background-runtime-client | Yes (3.1) | Yes (3.4) | Yes (3.1) | No | No | No |

**`add-lynx-background-runtime-client`**

register lifecycle observer for background runtime

**Specifications:**

