File tree Expand file tree Collapse file tree 4 files changed +56
-13
lines changed Expand file tree Collapse file tree 4 files changed +56
-13
lines changed Original file line number Diff line number Diff line change @@ -202,6 +202,23 @@ You can disable Repro Steps using the following API:
202
202
Instabug.setReproStepsMode(Instabug.reproStepsMode.disabled);
203
203
` ` `
204
204
205
+ # # APM
206
+
207
+ # ## Network metric is enabled by default. To disable it:
208
+
209
+ * # ### In iOS:
210
+ Call ` APM.setNetworkEnabledIOS(false)`
211
+
212
+ * # ### In Android:
213
+ In build.gradle, set ` networkInterceptingEnabled` to ` false`
214
+ ` ` `
215
+ Instabug {
216
+ APM {
217
+ networkInterceptingEnabled false
218
+ }
219
+ }
220
+ ` ` `
221
+
205
222
# # Update Guide
206
223
# ## Updating to versions 8.0-8.4.x
207
224
Original file line number Diff line number Diff line change 100
100
- (void )logError : (NSString *)log ;
101
101
- (void )clearLogs ;
102
102
103
+ /*
104
+ +------------------------------------------------------------------------+
105
+ | Network Logging |
106
+ +------------------------------------------------------------------------+
107
+ */
108
+
109
+ - (void )setNetworkLoggingEnabled : (BOOL )isEnabled ;
110
+
103
111
@end
Original file line number Diff line number Diff line change @@ -339,6 +339,14 @@ - (dispatch_queue_t)methodQueue {
339
339
callback (@[[NSNumber numberWithBool: result]]);
340
340
}
341
341
342
+ RCT_EXPORT_METHOD (setNetworkLoggingEnabled:(BOOL )isEnabled) {
343
+ if (isEnabled) {
344
+ IBGNetworkLogger.enabled = YES ;
345
+ } else {
346
+ IBGNetworkLogger.enabled = NO ;
347
+ }
348
+ }
349
+
342
350
RCT_EXPORT_METHOD (networkLog:(NSDictionary *) networkData) {
343
351
NSString * url = networkData[@" url" ];
344
352
NSString * method = networkData[@" method" ];
Original file line number Diff line number Diff line change 1
1
import {
2
- NativeModules
2
+ NativeModules ,
3
+ Platform ,
3
4
} from 'react-native' ;
4
5
import Trace from '../models/Trace' ;
5
- let { IBGAPM } = NativeModules ;
6
+ let { Instabug, IBGAPM } = NativeModules ;
7
+
6
8
7
9
/**
8
10
* APM
9
11
* @exports APM
10
12
*/
11
13
export default {
12
-
13
14
/**
14
- * Enables and disables APM
15
+ * Enables or disables APM
15
16
* @param {boolean } isEnabled
16
17
*/
17
18
setEnabled ( isEnabled ) {
18
19
IBGAPM . setEnabled ( isEnabled ) ;
19
20
} ,
20
21
21
22
/**
22
- * Enables and disables App Launch
23
- * @param {boolean } isEnabled
24
- */
23
+ * Enables or disables APM App Launch
24
+ * @param {boolean } isEnabled
25
+ */
25
26
setAppLaunchEnabled ( isEnabled ) {
26
27
IBGAPM . setEnabled ( isEnabled ) ;
27
28
} ,
28
29
29
30
/**
30
- * Enables and disables App Launch
31
- * @param {boolean } isEnabled
32
- */
31
+ * Enables or disables APM Network Metric
32
+ * @param {boolean } isEnabled
33
+ */
34
+ setNetworkEnabledIOS ( isEnabled ) {
35
+ if ( Platform . OS === 'ios' ) {
36
+ Instabug . setNetworkLoggingEnabled ( isEnabled ) ;
37
+ }
38
+ } ,
39
+
40
+ /**
41
+ * Starts a custom trace
42
+ * @param {string } name
43
+ */
33
44
startTrace ( name ) {
34
- const id = Date . now ( ) + "" ;
45
+ const id = Date . now ( ) + '' ;
35
46
IBGAPM . startTrace ( name , id ) ;
36
47
return new Trace ( id , name ) ;
37
48
} ,
38
-
39
- }
49
+ } ;
You can’t perform that action at this time.
0 commit comments