device_identity/README.md
宏谋刘 161d9c18f3 1.0
2023-05-10 16:07:15 +08:00

43 lines
856 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# device_identity
用于获取设备标识的插件androidId、Imei、oaid等
## 安装
`device_identity: latestVersion`
## 使用
> 只能在Andoird平台调用插件已经对平台做了条件判断
- 同意协议后调用
`await DeviceIdentity.register();`
- 获取安卓ID可能为空
`String androidId = await DeviceIdentity.androidId;`
- 获取IMEI只支持Android 10之前的系统需要READ_PHONE_STATE权限可能为空
`String imei = await DeviceIdentity.imei;`
- 获取OAID/AAID
`String oaid = await DeviceIdentity.oaid;`
- 获取UA
`String ua = await DeviceIdentity.ua;`
## 注意
1. 在 android/app/build.gradle 中将 minSdkVersion 设置为 19或大于19
## 后续计划
- iOS端idfa的获取
## 感谢
[Android_CN_OAID](https://github.com/gzu-liyujiang/Android_CN_OAID)提供的SDK