|
@@ -16,6 +16,10 @@
|
16
|
16
|
|
17
|
17
|
package org.jitsi.meet.sdk;
|
18
|
18
|
|
|
19
|
+import android.annotation.SuppressLint;
|
|
20
|
+import android.provider.Settings;
|
|
21
|
+import android.text.TextUtils;
|
|
22
|
+
|
19
|
23
|
import com.facebook.react.bridge.ReactApplicationContext;
|
20
|
24
|
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
21
|
25
|
import com.facebook.react.bridge.ReactMethod;
|
|
@@ -49,8 +53,16 @@ class AmplitudeModule
|
49
|
53
|
* @param apiKey The API_KEY of the Amplitude project.
|
50
|
54
|
*/
|
51
|
55
|
@ReactMethod
|
|
56
|
+ @SuppressLint("HardwareIds")
|
52
|
57
|
public void init(String instanceName, String apiKey) {
|
53
|
58
|
Amplitude.getInstance(instanceName).initialize(getCurrentActivity(), apiKey);
|
|
59
|
+
|
|
60
|
+ // Set the device ID to something consistent.
|
|
61
|
+ String android_id
|
|
62
|
+ = Settings.Secure.getString(getReactApplicationContext().getContentResolver(), Settings.Secure.ANDROID_ID);
|
|
63
|
+ if (!TextUtils.isEmpty(android_id)) {
|
|
64
|
+ Amplitude.getInstance(instanceName).setDeviceId(android_id);
|
|
65
|
+ }
|
54
|
66
|
}
|
55
|
67
|
|
56
|
68
|
/**
|