# invokeSync

当小程序中调用 [`wmpf.Channel.invokeSync`](/doc/oplatform/Miniprogram_Frame/api/mini_program/invokeSync) 时，Client 端需要使用 call 操作完成同步调用。

## 传入参数

command 对应 call 方法的 「method」 字段，data 对应 call 方法的 「arg」 字段

| 参数    | 类型   | 必填 | 说明                                      |
| :------ | :----- | :--- | :---------------------------------------- |
| command | String | 是   | 小程序经 wmpf 透传给第三方 app 的指令名   |
| data    | String | 否   | 小程序经 wmpf 透传给第三方 app 的指令参数 |

## 返回参数

通过 Bundle 返回

| 参数 | 类型   | 必填 | 说明                                          |
| :--- | :----- | :--- | :-------------------------------------------- |
| data | String | 否   | 第三方 app 经 wmpf 透传给小程序的调用返回结果 |

## 示例代码

```kotlin
// 同步调用
override fun call(method: String, arg: String?, extras: Bundle?): Bundle? {
  Log.i(TAG, "method: $method, arg: $arg, extras: $extras")
  // 实现特定的功能逻辑
  val bundle = Bundle()
  bundle.putString("data", "call success, method: $method, arg: $arg, extras: $extras")
  // 返回执行结果给小程序端
  return bundle
}
```
