UDID solution for Android/iOS.
- It will create a uuid string and save it to keychain for ios
- It will return mac address's MD5 (ADID when >= API Level23) for android
- return SystemInfo.deviceUniqueIdentifier for other platforms.
It is so easy to use it on unity:
-
Add event handle
DeviceIDManager.deviceIDHandler += (string deviceid) => { if (!string.IsNullOrEmpty(deviceid)) { deviceID.text = deviceid; } };
-
Call 'GetDeviceID' method
DeviceIDManager.GetDeviceID();
You'd better change the value of macroes in KeyChain.mm for ios:
#define SERVICE_NAME @"my_service_name"
#define IDENTIFIER @"my_app_identifier"
#define ACOUNT_ID @"my_account"