Skip to content

Commit 570fae8

Browse files
Map setAutoUITraceEnabled on Android
1 parent 84f9504 commit 570fae8

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,24 @@ public void run() {
107107
});
108108
}
109109

110+
/**
111+
* Enables or disables auto UI tracing
112+
* @param isEnabled boolean indicating enabled or disabled.
113+
*/
114+
@ReactMethod
115+
public void setAutoUITraceEnabled(final boolean isEnabled) {
116+
MainThreadHandler.runOnMainThread(new Runnable() {
117+
@Override
118+
public void run() {
119+
try {
120+
APM.setAutoUITraceEnabled(isEnabled);
121+
} catch (Exception e) {
122+
e.printStackTrace();
123+
}
124+
}
125+
});
126+
}
127+
110128
/**
111129
* Starts an execution trace
112130
* @param name string name of the trace.

modules/APM.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ export default {
7070
* @param {boolean} isEnabled
7171
*/
7272
setAutoUITraceEnabled(isEnabled) {
73-
if (Platform.OS === 'ios') {
74-
IBGAPM.setAutoUITraceEnabled(isEnabled);
75-
}
73+
IBGAPM.setAutoUITraceEnabled(isEnabled);
7674
},
7775

7876
/**

0 commit comments

Comments
 (0)