https://github.com/appsflyersdk/appsflyer-oaid
AppsFlyer OAID collection
https://github.com/appsflyersdk/appsflyer-oaid
android appsflyer huawei msa oaid
Last synced: 6 months ago
JSON representation
AppsFlyer OAID collection
- Host: GitHub
- URL: https://github.com/appsflyersdk/appsflyer-oaid
- Owner: AppsFlyerSDK
- License: mit
- Created: 2020-01-01T10:57:56.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-09-20T14:37:21.000Z (over 1 year ago)
- Last Synced: 2024-04-23T03:41:07.328Z (about 1 year ago)
- Topics: android, appsflyer, huawei, msa, oaid
- Language: Java
- Homepage: https://support.appsflyer.com/hc/en-us/articles/360006278797-Implementing-OAID-in-the-Android-SDK
- Size: 6.04 MB
- Stars: 26
- Watchers: 5
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OAID collection
[](https://oss.sonatype.org/content/repositories/releases/com/appsflyer/oaid/)
## Table of content
- [Adding to your project](#adding-to-your-project)
- [Standalone usage](#standalone-usage)Supported devices:
Manufacturer | OS version
--- | ---
Huawei | HMS 2.6.2
Xiaomi | MIUI 10.2
Vivo | Android 8
OPPO, Realme | Color OS 3
Lenovo | ZUI 11.4
Samsung, Meizu, Nubia, ZTE, ASUS, OnePlus, Black shark, Motorola, Freeme OS | Android 10**Supported MSA library version:** 2.2.0
## Adding to your project
module **build.gradle**
#### Step 1
Download AAR provided by the [MSA](http://www.msa-alliance.cn/col.jsp?id=120) to your module libs folder
**Note:** MSA AAR requires min API level 16
```groovy
implementation 'com.appsflyer:oaid:6.12.3'
implementation files('libs/oaid_sdk_2.2.0.aar')
```#### Step 2
Copy your certificate file (.cert.pem) to the project assets directory.#### Step 3 (When using ProGaurd)
Add the following code to your `proguard-rules.pro` file:
```
# sdk
-keep class com.bun.miitmdid.** { *; }
-keep interface com.bun.supplier.** { *; }
# asus
-keep class com.asus.msa.SupplementaryDID.** { *; }
-keep class com.asus.msa.sdid.** { *; }
# freeme
-keep class com.android.creator.** { *; }
-keep class com.android.msasdk.** { *; }
# huawei
-keep class com.huawei.hms.ads.** { *; }
-keep interface com.huawei.hms.ads.** {*; }
# lenovo
-keep class com.zui.deviceidservice.** { *; }
-keep class com.zui.opendeviceidlibrary.** { *; }
# meizu
-keep class com.meizu.flyme.openidsdk.** { *; }
# nubia
-keep class com.bun.miitmdid.provider.nubia.NubiaIdentityImpl
{ *; }
# oppo
-keep class com.heytap.openid.** { *; }
# samsung
-keep class com.samsung.android.deviceidservice.** { *; }
# vivo
-keep class com.vivo.identifier.** { *; }
# xiaomi
-keep class com.bun.miitmdid.provider.xiaomi.IdentifierManager
{ *; }
# zte
-keep class com.bun.lib.** { *; }
# coolpad
-keep class com.coolpad.deviceidsupport.** { *; }
```## Standalone usage
```kotlin
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
Thread {
val info = OaidClient(this, 1, TimeUnit.SECONDS).fetch()
if (info != null) {
println(info.id)
val lat = info.lat
if (lat != null) {
println(lat)
}
}
}.start()
}
}
```## Important
Time to fetch oaid is around 10 - 1000 ms
---
🛠In order for us to provide optimal support, we would kindly ask you to submit any issues to [email protected]*When submitting an issue please specify your AppsFlyer sign-up (account) email , your app ID , production steps, logs, code snippets and any additional relevant information.*