Skip to content

Commit 4266b4e

Browse files
committed
Merge branch 'dev' into dev-to-master
2 parents 2b094ca + 196b481 commit 4266b4e

23 files changed

+242
-35
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## [14.3.0](https://github.com/Instabug/Instabug-React-Native/compare/v14.1.0...14.3.0)
4+
5+
### Added
6+
7+
- Add support for enable/disable capturing network body. ([#1362](https://github.com/Instabug/Instabug-React-Native/pull/1362))
8+
9+
### Changed
10+
11+
- Bump Instabug iOS SDK to v14.3.0 ([#1367](https://github.com/Instabug/Instabug-React-Native/pull/1367)). [See release notes](https://github.com/Instabug/Instabug-iOS/releases/tag/14.3.0).
12+
13+
- Bump Instabug Android SDK to v14.3.0 ([#1375](https://github.com/Instabug/Instabug-React-Native/pull/1375)). [See release notes](https://github.com/Instabug/Instabug-Android/releases/tag/v14.3.0).
14+
315
## [14.1.0](https://github.com/Instabug/Instabug-React-Native/compare/v14.0.0...v14.1.0) (January 2, 2025)
416

517
### Added

RNInstabug.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ Pod::Spec.new do |s|
1717

1818
s.dependency 'React-Core'
1919
use_instabug!(s)
20+
2021
end

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ android {
5757
minSdkVersion getExtOrDefault('minSdkVersion').toInteger()
5858
targetSdkVersion getExtOrDefault('targetSdkVersion').toInteger()
5959
versionCode 1
60-
versionName "14.1.0"
60+
versionName "14.3.0"
6161
multiDexEnabled true
6262
ndk {
6363
abiFilters "armeabi-v7a", "x86"

android/native.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project.ext.instabug = [
2-
version: '14.1.0'
2+
version: '14.3.0'
33
]
44

55
dependencies {

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

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public String getName() {
4343
}
4444

4545
/**
46-
* Sets the printed logs priority. Filter to one of the following levels.
46+
* Pauses the current thread for 3 seconds.
4747
*/
4848
@ReactMethod
4949
public void ibgSleep() {
@@ -57,6 +57,7 @@ public void run() {
5757

5858
/**
5959
* Enables or disables APM.
60+
*
6061
* @param isEnabled boolean indicating enabled or disabled.
6162
*/
6263
@ReactMethod
@@ -75,6 +76,7 @@ public void run() {
7576

7677
/**
7778
* Enables or disables app launch tracking.
79+
*
7880
* @param isEnabled boolean indicating enabled or disabled.
7981
*/
8082
@ReactMethod
@@ -92,7 +94,7 @@ public void run() {
9294
}
9395

9496
/**
95-
* Ends app launch
97+
* This method is used to signal the end of the app launch process.
9698
*/
9799
@ReactMethod
98100
public void endAppLaunch() {
@@ -110,6 +112,7 @@ public void run() {
110112

111113
/**
112114
* Enables or disables auto UI tracing
115+
*
113116
* @param isEnabled boolean indicating enabled or disabled.
114117
*/
115118
@ReactMethod
@@ -281,6 +284,7 @@ public void run() {
281284

282285
/**
283286
* Starts a UI trace
287+
*
284288
* @param name string name of the UI trace.
285289
*/
286290
@ReactMethod
@@ -298,7 +302,7 @@ public void run() {
298302
}
299303

300304
/**
301-
* Ends the current running UI trace
305+
* This method is used to terminate the currently active UI trace.
302306
*/
303307
@ReactMethod
304308
public void endUITrace() {
@@ -314,6 +318,73 @@ public void run() {
314318
});
315319
}
316320

321+
/**
322+
* The `networkLogAndroid` function logs network-related information using APMNetworkLogger in a React
323+
* Native module.
324+
*
325+
* @param requestStartTime The `requestStartTime` parameter in the `networkLogAndroid` method
326+
* represents the timestamp when the network request started. It is of type `double` and is passed as
327+
* a parameter to log network-related information.
328+
* @param requestDuration The `requestDuration` parameter in the `networkLogAndroid` method represents
329+
* the duration of the network request in milliseconds. It indicates the time taken for the request to
330+
* complete from the moment it was initiated until the response was received. This parameter helps in
331+
* measuring the performance of network requests and identifying any potential
332+
* @param requestHeaders requestHeaders is a string parameter that contains the headers of the network
333+
* request. It typically includes information such as the content type, authorization token, and any
334+
* other headers that were sent with the request.
335+
* @param requestBody The `requestBody` parameter in the `networkLogAndroid` method represents the
336+
* body of the HTTP request being logged. It contains the data that is sent as part of the request to
337+
* the server. This could include form data, JSON payload, XML data, or any other content that is
338+
* being transmitted
339+
* @param requestBodySize The `requestBodySize` parameter in the `networkLogAndroid` method represents
340+
* the size of the request body in bytes. It is a double value that indicates the size of the request
341+
* body being sent in the network request. This parameter is used to log information related to the
342+
* network request, including details
343+
* @param requestMethod The `requestMethod` parameter in the `networkLogAndroid` method represents the
344+
* HTTP method used in the network request, such as GET, POST, PUT, DELETE, etc. It indicates the type
345+
* of operation that the client is requesting from the server.
346+
* @param requestUrl The `requestUrl` parameter in the `networkLogAndroid` method represents the URL
347+
* of the network request being logged. It typically contains the address of the server to which the
348+
* request is being made, along with any additional path or query parameters required for the request.
349+
* This URL is essential for identifying the
350+
* @param requestContentType The `requestContentType` parameter in the `networkLogAndroid` method
351+
* represents the content type of the request being made. This could be values like
352+
* "application/json", "application/xml", "text/plain", etc., indicating the format of the data being
353+
* sent in the request body. It helps in specifying
354+
* @param responseHeaders The `responseHeaders` parameter in the `networkLogAndroid` method represents
355+
* the headers of the response received from a network request. These headers typically include
356+
* information such as content type, content length, server information, and any other metadata
357+
* related to the response. The `responseHeaders` parameter is expected to
358+
* @param responseBody The `responseBody` parameter in the `networkLogAndroid` method represents the
359+
* body of the response received from a network request. It contains the data or content sent back by
360+
* the server in response to the request made by the client. This could be in various formats such as
361+
* JSON, XML, HTML
362+
* @param responseBodySize The `responseBodySize` parameter in the `networkLogAndroid` method
363+
* represents the size of the response body in bytes. It is a double value that indicates the size of
364+
* the response body received from the network request. This parameter is used to log information
365+
* related to the network request and response, including
366+
* @param statusCode The `statusCode` parameter in the `networkLogAndroid` method represents the HTTP
367+
* status code of the network request/response. It indicates the status of the HTTP response, such as
368+
* success (200), redirection (3xx), client errors (4xx), or server errors (5xx). This parameter is
369+
* @param responseContentType The `responseContentType` parameter in the `networkLogAndroid` method
370+
* represents the content type of the response received from the network request. It indicates the
371+
* format of the data in the response, such as JSON, XML, HTML, etc. This information is useful for
372+
* understanding how to parse and handle the
373+
* @param errorDomain The `errorDomain` parameter in the `networkLogAndroid` method is used to specify
374+
* the domain of an error, if any occurred during the network request. If there was no error, this
375+
* parameter will be `null`.
376+
* @param w3cAttributes The `w3cAttributes` parameter in the `networkLogAndroid` method is a
377+
* ReadableMap object that contains additional attributes related to W3C external trace. It may
378+
* include the following key-value pairs:
379+
* @param gqlQueryName The `gqlQueryName` parameter in the `networkLogAndroid` method represents the
380+
* name of the GraphQL query being executed. It is a nullable parameter, meaning it can be null if no
381+
* GraphQL query name is provided. This parameter is used to log information related to GraphQL
382+
* queries in the network logging
383+
* @param serverErrorMessage The `serverErrorMessage` parameter in the `networkLogAndroid` method is
384+
* used to pass any error message received from the server during network communication. This message
385+
* can provide additional details about any errors that occurred on the server side, helping in
386+
* debugging and troubleshooting network-related issues.
387+
*/
317388
@ReactMethod
318389
private void networkLogAndroid(final double requestStartTime,
319390
final double requestDuration,

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,4 +1274,22 @@ public Map<String, Object> getConstants() {
12741274

12751275
return constants;
12761276
}
1277+
1278+
/**
1279+
* Enables or disables capturing network body.
1280+
* @param isEnabled A boolean to enable/disable capturing network body.
1281+
*/
1282+
@ReactMethod
1283+
public void setNetworkLogBodyEnabled(final boolean isEnabled) {
1284+
MainThreadHandler.runOnMainThread(new Runnable() {
1285+
@Override
1286+
public void run() {
1287+
try {
1288+
Instabug.setNetworkLogBodyEnabled(isEnabled);
1289+
} catch (Exception e) {
1290+
e.printStackTrace();
1291+
}
1292+
}
1293+
});
1294+
}
12771295
}

examples/default/ios/InstabugTests/InstabugSampleTests.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,4 +609,13 @@ - (void) testIsW3CaughtHeaderEnabled {
609609
}
610610

611611

612+
- (void)testSetNetworkLogBodyEnabled {
613+
id mock = OCMClassMock([IBGNetworkLogger class]);
614+
BOOL isEnabled = YES;
615+
616+
OCMStub([mock setLogBodyEnabled:isEnabled]);
617+
[self.instabugBridge setNetworkLogBodyEnabled:isEnabled];
618+
OCMVerify([mock setLogBodyEnabled:isEnabled]);
619+
}
620+
612621
@end

examples/default/ios/Podfile.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ PODS:
3131
- hermes-engine (0.75.4):
3232
- hermes-engine/Pre-built (= 0.75.4)
3333
- hermes-engine/Pre-built (0.75.4)
34-
- Instabug (14.1.0)
34+
- Instabug (14.3.0)
3535
- instabug-reactnative-ndk (0.1.0):
3636
- DoubleConversion
3737
- glog
@@ -1319,7 +1319,7 @@ PODS:
13191319
- ReactCommon/turbomodule/bridging
13201320
- ReactCommon/turbomodule/core
13211321
- Yoga
1322-
- react-native-webview (13.12.3):
1322+
- react-native-webview (13.13.2):
13231323
- DoubleConversion
13241324
- glog
13251325
- hermes-engine
@@ -1623,8 +1623,8 @@ PODS:
16231623
- ReactCommon/turbomodule/bridging
16241624
- ReactCommon/turbomodule/core
16251625
- Yoga
1626-
- RNInstabug (14.1.0):
1627-
- Instabug (= 14.1.0)
1626+
- RNInstabug (14.3.0):
1627+
- Instabug (= 14.3.0)
16281628
- React-Core
16291629
- RNReanimated (3.16.1):
16301630
- DoubleConversion
@@ -2017,7 +2017,7 @@ SPEC CHECKSUMS:
20172017
Google-Maps-iOS-Utils: f77eab4c4326d7e6a277f8e23a0232402731913a
20182018
GoogleMaps: 032f676450ba0779bd8ce16840690915f84e57ac
20192019
hermes-engine: ea92f60f37dba025e293cbe4b4a548fd26b610a0
2020-
Instabug: 8cbca8974168c815658133e2813f5ac3a36f8e20
2020+
Instabug: 97a4e694731f46bbc02dbe49ab29cc552c5e2f41
20212021
instabug-reactnative-ndk: d765ac289d56e8896398d02760d9abf2562fc641
20222022
OCMock: 589f2c84dacb1f5aaf6e4cec1f292551fe748e74
20232023
RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740
@@ -2055,7 +2055,7 @@ SPEC CHECKSUMS:
20552055
react-native-maps: 72a8a903f8a1b53e2c777ba79102078ab502e0bf
20562056
react-native-safe-area-context: 142fade490cbebbe428640b8cbdb09daf17e8191
20572057
react-native-slider: 4a0f3386a38fc3d2d955efc515aef7096f7d1ee4
2058-
react-native-webview: 926d2665cf3196e39c4449a72d136d0a53b9df8a
2058+
react-native-webview: c0b91a4598bd54e9fbc70353aebf1e9bab2e5bb9
20592059
React-nativeconfig: 8c83d992b9cc7d75b5abe262069eaeea4349f794
20602060
React-NativeModulesApple: 9f7920224a3b0c7d04d77990067ded14cee3c614
20612061
React-perflogger: 59e1a3182dca2cee7b9f1f7aab204018d46d1914
@@ -2084,7 +2084,7 @@ SPEC CHECKSUMS:
20842084
ReactCommon: 6a952e50c2a4b694731d7682aaa6c79bc156e4ad
20852085
RNCClipboard: 2821ac938ef46f736a8de0c8814845dde2dcbdfb
20862086
RNGestureHandler: 511250b190a284388f9dd0d2e56c1df76f14cfb8
2087-
RNInstabug: 96e629f47c0af2e9455fbcf800d12049f980d873
2087+
RNInstabug: c55b6c697b39d3cbe51b1ab9b729f0b55ed619f1
20882088
RNReanimated: f42a5044d121d68e91680caacb0293f4274228eb
20892089
RNScreens: c7ceced6a8384cb9be5e7a5e88e9e714401fd958
20902090
RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d

examples/default/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"react-native-screens": "^3.35.0",
3333
"react-native-svg": "^15.8.0",
3434
"react-native-vector-icons": "^10.2.0",
35-
"react-native-webview": "^13.12.3",
35+
"react-native-webview": "^13.13.2",
3636
"react-query": "^3.39.3"
3737
},
3838
"devDependencies": {
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import React from 'react';
2+
import { type DimensionValue, View } from 'react-native';
3+
4+
// Define the component type with static properties
5+
interface CustomGapComponent extends React.FC<{ height?: DimensionValue; width?: DimensionValue }> {
6+
small: JSX.Element;
7+
smallV: JSX.Element;
8+
smallH: JSX.Element;
9+
large: JSX.Element;
10+
largeV: JSX.Element;
11+
largeH: JSX.Element;
12+
}
13+
14+
const defaultDimensionValue = 16;
15+
16+
// Define the CustomGap component
17+
const CustomGap: CustomGapComponent = ({ height, width }) => {
18+
return (
19+
<View
20+
style={{ width: width ?? defaultDimensionValue, height: height ?? defaultDimensionValue }}
21+
/>
22+
);
23+
};
24+
25+
// Assign static properties for predefined gaps
26+
CustomGap.small = <CustomGap height={8} width={8} />;
27+
CustomGap.large = <CustomGap height={32} width={32} />;
28+
CustomGap.smallV = <CustomGap height={8} />;
29+
CustomGap.largeV = <CustomGap height={32} />;
30+
CustomGap.smallH = <CustomGap width={8} />;
31+
CustomGap.largeH = <CustomGap width={32} />;
32+
33+
export default CustomGap;

examples/default/src/screens/apm/APMScreen.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import type { HomeStackParamList } from '../../navigation/HomeStack';
33
import React, { useState } from 'react';
44
import { ListTile } from '../../components/ListTile';
55
import { Screen } from '../../components/Screen';
6-
import { Text, Switch } from 'react-native';
6+
import { StyleSheet, Switch, Text, View } from 'react-native';
77
import { APM } from 'instabug-reactnative';
88
import { showNotification } from '../../utils/showNotification';
9+
import CustomGap from '../../components/CustomGap';
910

1011
export const APMScreen: React.FC<NativeStackScreenProps<HomeStackParamList, 'APM'>> = ({
1112
navigation,
@@ -17,16 +18,26 @@ export const APMScreen: React.FC<NativeStackScreenProps<HomeStackParamList, 'APM
1718
APM.setEnabled(value);
1819
showNotification('APM status', 'APM enabled set to ' + value);
1920
};
21+
const styles = StyleSheet.create({
22+
switch: {
23+
flexDirection: 'row',
24+
justifyContent: 'space-between',
25+
},
26+
});
2027

2128
return (
2229
<Screen>
23-
<Text>Enable APM:</Text>
24-
<Switch onValueChange={toggleSwitch} value={isEnabled} />
30+
<View style={styles.switch}>
31+
<Text>Enable APM:</Text>
32+
<Switch onValueChange={toggleSwitch} value={isEnabled} />
33+
</View>
34+
{CustomGap.smallV}
2535
<ListTile title="End App launch" onPress={() => APM.endAppLaunch()} />
2636
<ListTile title="Network Screen" onPress={() => navigation.navigate('NetworkTraces')} />
2737
<ListTile title="Traces" onPress={() => navigation.navigate('ExecutionTraces')} />
2838
<ListTile title="Flows" onPress={() => navigation.navigate('AppFlows')} />
2939
<ListTile title="WebViews" onPress={() => navigation.navigate('WebViews')} />
40+
<ListTile title="Complex Views" onPress={() => navigation.navigate('ComplexViews')} />
3041
</Screen>
3142
);
3243
};

examples/default/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6329,10 +6329,10 @@ react-native-vector-icons@^10.2.0:
63296329
prop-types "^15.7.2"
63306330
yargs "^16.1.1"
63316331

6332-
react-native-webview@^13.12.3:
6333-
version "13.12.3"
6334-
resolved "https://registry.yarnpkg.com/react-native-webview/-/react-native-webview-13.12.3.tgz#3aa9d2fc982ba2681e56d3e96e22b63a0d929270"
6335-
integrity sha512-Y1I5YyDYyE7NC96RHLhd2nxh7ymLYOYLTefgx5ixxw2OToQK0ow3OJ+o77QcI1Tuevj5PCxwqC/14ceS/7yPJQ==
6332+
react-native-webview@^13.13.2:
6333+
version "13.13.2"
6334+
resolved "https://registry.yarnpkg.com/react-native-webview/-/react-native-webview-13.13.2.tgz#6d72fd8492f11accbcf3be4d1386fa961e424357"
6335+
integrity sha512-zACPDTF0WnaEnKZ9mA/r/UpcOpV2gQM06AAIrOOexnO8UJvXL8Pjso0b/wTqKFxUZZnmjKuwd8gHVUosVOdVrw==
63366336
dependencies:
63376337
escape-string-regexp "^4.0.0"
63386338
invariant "2.2.4"

0 commit comments

Comments
 (0)