# checkForNewVersion

> 检测是否有新版本

### checkForNewVersion

> 检测是否有新版本可用, iOS 无论是否有最新版本都直接跳转到应用商店, 安卓如果有新版,则弹窗提示,没有的话 toast 提示无新版本

#### 请求参数

| 参数       | 类型                          | 必填 | 说明     |
| ---------- | ----------------------------- | ---- | -------- |
| `success`  | `() => void`                  | 否   | 成功回调 |
| `fail`     | `(error: BridgeCode) => void` | 否   | 失败回调 |
| `complete` | `() => void`                  | 否   | 完成回调 |

#### 返回值

```js
Promise<void>
```

#### 示例代码

```js
import { checkForNewVersion } from '@kbapp/js-bridge'

checkForNewVersion({
    success() {
        console.log('检查成功')
    },
    fail(error) {
        console.log('检查失败', error)
    },
})
```

> 支持 Promise 风格调用
