uniapp Get the unique device identification (OAID, AAID, AndroidID, IMEI, etc.) plug-in Ba-IdCode

Introduction ( download address )

Ba-IdCode is a uniapp plug-in that can obtain OAID (Open Anonymous Device Identifier) ​​of major domestic mobile phone manufacturers and AAID (Android Advertising Identifier) ​​of overseas mobile phone platforms. In addition, it also supports obtaining common device identifications such as IMEI/MEID, AndroidID, WidevineID, PseudoID, and GUID.

screenshot display

insert image description here

different kinds of identifiers

identifier illustrate
IMEI It should be the most familiar kind of ID.
It is the ID card of the mobile phone
and the code for the operator to identify the information of the equipment connected to the network.
It is a non-resettable permanent identifier with the scope of the device.
Android ID(SSAID)
As the name suggests, Android ID is a "semi-permanent identifier" that does not depend on hardware in Android devices .
It will not change during the system life cycle,
but it will change after system reset or flashing.
Its scope is a set of associated application.
Device ID On the Android platform, Device ID is a general term.
All IDs related to hardware can be called Device ID.
Generally, it is a non-resettable permanent identifier
with the scope of the device.
UUID、GUID UUID is also called instance ID, and
these two IDs can be said to be universal identifiers in the computer system
(for more information about UUID and GUID, you can read Wikipedia related content)
AAID AAID works the same as IDFA - IDFA is the ad tracking ID within the iOS platform and
AAID is used on the Android platform.
OAID The Advertising Identifier (OAID) is a non-persistent device identifier. Using OAID can provide users with personalized advertisements
under the premise of protecting the privacy and security of users' personal data . An alternative to domestic App and ad tracking services

Support

manufacturer or brand system or framework
Huawei (Huawei, Honor) HMS Core 2.6.2+ 、Google Play Service 4.0+
Xiaomi (XiaoMi, Redmi, BlackShark) MIUI 10.2+、Google Play Service 4.0+
Vivo (VIVO, IQOO) Funtouch OS 9+、OriginOS 1.0+、Google Play Service 4.0+
Oppo (OPPO, Realme) ColorOS 7.0+、Google Play Service 4.0+
Samsung Android 10+、Google Play Service 4.0+
Lenovo ZUI 11.4+、Google Play Service 4.0+
ASUS Android 10+、Google Play Service 4.0+
Meizu Android 10+、Google Play Service 4.0+
OnePlus Android 10+、Google Play Service 4.0+
Nubia Android 10+、Google Play Service 4.0+
Coolpad CoolOS、Google Play Service 4.0+
Coosea Android 10+、Google Play Service 4.0+
Droi Freeme OS、Google Play Service 4.0+
Others (ZTE, HTC, Motorola, ...) SSUI、Google Play Service 4.0+

Instructions

scriptIntroduce components in

	const idCode = uni.requireNativePlugin('Ba-IdCode')

scriptCalled in (example reference, you can modify it according to your own business and calling method)

	const idCode = uni.requireNativePlugin('Ba-IdCode')
	export default {
    
    
		data() {
    
    
			return {
    
    
				msgList: []
			}
		},
		methods: {
    
    
			register() {
    
     //注册,先注册再获取,注意APP合规性,若最终用户未同意隐私政策则不要调用
				idCode.register(
					res => {
    
    
						console.log(res);
						uni.showToast({
    
    
							title: res.msg,
							icon: "none",
							duration: 3000
						})
					});
			},
			getIdCodes() {
    
     //获取设备的各种标识码
				idCode.getIdCodes(res => {
    
    
					console.log(res);
					if (res.data) {
    
    
						this.msgList.unshift(JSON.stringify(res.data))
					}
					uni.showToast({
    
    
						title: res.msg,
						icon: "none",
						duration: 3000
					})
				});
			},
			getOAID() {
    
     //异步获取 OAID
				idCode.getOAID(res => {
    
    
					console.log(res);
					if (res.data) {
    
    
						this.msgList.unshift(JSON.stringify(res.data))
					}
					uni.showToast({
    
    
						title: res.msg,
						icon: "none",
						duration: 3000
					})
				});
			},
		}
	}	

api list

method name illustrate
register 注册,先注册再获取,注意APP合规性,若最终用户未同意隐私政策则不要调用
getIdCodes 获取设备的各种标识码(OAID、AAID、AndroidID、IMEI、WidevineID、PseudoID、GUID)
getOAID 异步获取设备的OAID(AAID)。同步调用getIdCodes获取OAID,第一次可能为空,可采用getOAID方法

系列插件

图片选择插件 Ba-MediaPicker文档

图片编辑插件 Ba-ImageEditor文档

文件选择插件 Ba-FilePicker文档

应用消息通知插件(多种样式,新增支持常驻通知模式) Ba-Notify文档

应用未读角标插件 Ba-Shortcut-Badge文档

应用开机自启插件 Ba-Autoboot文档

扫码原生插件(毫秒级、支持多码)Ba-Scanner-G文档

扫码原生插件 - 新(可任意自定义界面版本;支持连续扫码;支持设置扫码格式)Ba-Scanner文档

动态修改状态栏、导航栏背景色、字体颜色插件 Ba-AppBar文档

原生sqlite本地数据库管理 Ba-Sqlite文档

安卓保活插件(采用多种主流技术) Ba-KeepAlive文档

安卓快捷方式(桌面长按app图标) Ba-Shortcut文档

自定义图片水印(任意位置) Ba-Watermark文档

最接近微信的图片压缩插件 Ba-ImageCompressor文档

视频压缩、视频剪辑插件 Ba-VideoCompressor文档

动态切换应用图标、名称(如新年、国庆等) Ba-ChangeIcon文档

原生Toast弹窗提示(穿透所有界面、穿透原生;自定义颜色、图标 ) Ba-Toast文档

图片涂鸦、画笔 Ba-ImagePaint文档

pdf阅读(手势缩放、显示页数) Ba-Pdf文档

Sound reminder, vibration reminder, voice broadcast Ba-Beep ( documentation )

Websocket native service (automatic reconnection, heartbeat detection) Ba-Websocket ( documentation )

SMS monitoring (verification code) Ba-Sms ( documentation )

Smart Install (Automatic Upgrade) Ba-SmartUpgrade ( documentation )

Monitor system broadcast, custom broadcast Ba-Broadcast ( documentation )

Listen to notification bar messages (support whitelist, blacklist, filter) Ba-NotifyListener ( documentation )

Global graying, mourning graying (dynamic, support nvue, vue at the same time) Ba-Gray ( documentation )

Real-time positioning (system, background operation, support screen) plug-in Ba-Location ( documentation )

Guess you like

Origin blog.csdn.net/u013164293/article/details/128162974