Device ID¶
Device ID is an ID which Repro SDK uses to distinguish devices.
iOS
Warning
IDFV may change when reinstalling the app.
Android
ANDROID_ID (default). If using ANDROID_ID is not allowed by your privacy policy, you can make the ANDROID_ID hashed or use UUID generated by the SDK instead by adding the below tag to AndroidManifest.xml
. Make sure to assign one of the followings to android:value
.
"ANDROID_ID"
: Use ANDROID_ID as the device ID (default)"ANDROID_ID_MD5"
: Use MD5 hashed ANDROID_ID as the device ID"UUID"
: Use UUID generated by the SDK as the device ID. This UUID will be saved inSharedPreferences
.
<application>
...
<meta-data
android:name="io.repro.android.DeviceID.Mode"
android:value="ANDROID_ID"> // Specify "ANDROID_ID", "ANDROID_ID_MD5" or "UUID"
</meta-data>
...
</application>
Also, you can specify the hash salt with the below tag when using "ANDROID_ID_MD5"
. Set an arbitrary string to android:value
.
<application>
...
<meta-data
android:name="io.repro.android.DeviceID.Salt"
android:value="mysalt">
</meta-data>
...
</application>
Warning
When changing the device ID type after SDK has been installed, the result of push notification measurements may temporarily get less accurate.
When using
"UUID"
, the device ID will change to a new value afterSharedPreferences
being deleted after uninstalling/re-installing the app. This may also make the result of push notification measurement temporarily less accurate.
Get Device ID¶
Get the device ID described above.
NSString* deviceID = [Repro getDeviceID];
let deviceID = Repro.deviceID()
String deviceID = Repro.getDeviceID();
const char* deviceID = ReproCpp::getDeviceID();
string deviceID = Repro.GetDeviceID ();
// retrieve the deviceID via a callback function
Repro.getDeviceID(function(deviceID) {
...
});
// retrieve the deviceID via a callback function
Repro.getDeviceID((error, deviceID) => {
...
});
final deviceID = await Repro.getDeviceID();