Skip to content

Commit c9b85d3

Browse files
Merge branch 'dev' into RN/Enabling/disbaling-screenshot-auto-masking
2 parents d198fcb + 1c70cb3 commit c9b85d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+468
-270
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
- Add support enable/disable screenshot auto masking. ([#1389](https://github.com/Instabug/Instabug-React-Native/pull/1389))
88

9+
- Add support for BugReporting user consents. ([#1383](https://github.com/Instabug/Instabug-React-Native/pull/1383))
10+
11+
- Add support for xCode 16. ([#1370](https://github.com/Instabug/Instabug-React-Native/pull/1370))
12+
913
## [14.3.0](https://github.com/Instabug/Instabug-React-Native/compare/v14.1.0...14.3.0)
1014

1115
### Added

RNInstabug.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Pod::Spec.new do |s|
1212
s.homepage = package["homepage"]
1313
s.source = { :git => "https://github.com/Instabug/Instabug-React-Native.git", :tag => 'v' + package["version"] }
1414

15-
s.platform = :ios, "9.0"
15+
s.platform = :ios, "13.0"
1616
s.source_files = "ios/**/*.{h,m,mm}"
1717

1818
s.dependency 'React-Core'

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.3.0'
2+
version: '14.3.0.6752106-SNAPSHOT'
33
]
44

55
dependencies {
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
package com.instabug.apm.networking;
2+
3+
import androidx.annotation.Nullable;
4+
5+
import com.facebook.react.bridge.ReadableMap;
6+
import com.instabug.apm.networking.mapping.NetworkRequestAttributes;
7+
import com.instabug.apm.networkinterception.cp.APMCPNetworkLog;
8+
9+
public class ApmNetworkLoggerHelper {
10+
11+
/// Log network request to the Android SDK using a package private API [APMNetworkLogger.log]
12+
static public void log(final double requestStartTime,
13+
final double requestDuration,
14+
final String requestHeaders,
15+
final String requestBody,
16+
final double requestBodySize,
17+
final String requestMethod,
18+
final String requestUrl,
19+
final String requestContentType,
20+
final String responseHeaders,
21+
final String responseBody,
22+
final double responseBodySize,
23+
final double statusCode,
24+
final String responseContentType,
25+
@Nullable final String errorDomain,
26+
@Nullable final ReadableMap w3cAttributes,
27+
@Nullable final String gqlQueryName,
28+
@Nullable final String serverErrorMessage
29+
) {
30+
try {
31+
final APMNetworkLogger apmNetworkLogger = new APMNetworkLogger();
32+
final boolean hasError = errorDomain != null && !errorDomain.isEmpty();
33+
final String errorMessage = hasError ? errorDomain : null;
34+
boolean isW3cHeaderFound = false;
35+
Long partialId = null;
36+
Long networkStartTimeInSeconds = null;
37+
38+
39+
try {
40+
if (!w3cAttributes.isNull("isW3cHeaderFound")) {
41+
isW3cHeaderFound = w3cAttributes.getBoolean("isW3cHeaderFound");
42+
}
43+
44+
if (!w3cAttributes.isNull("partialId")) {
45+
partialId = (long) w3cAttributes.getDouble("partialId");
46+
networkStartTimeInSeconds = (long) w3cAttributes.getDouble("networkStartTimeInSeconds");
47+
}
48+
49+
} catch (Exception e) {
50+
e.printStackTrace();
51+
}
52+
APMCPNetworkLog.W3CExternalTraceAttributes w3cExternalTraceAttributes =
53+
new APMCPNetworkLog.W3CExternalTraceAttributes(
54+
isW3cHeaderFound,
55+
partialId,
56+
networkStartTimeInSeconds,
57+
w3cAttributes.getString("w3cGeneratedHeader"),
58+
w3cAttributes.getString("w3cCaughtHeader")
59+
);
60+
NetworkRequestAttributes requestAttributes = new NetworkRequestAttributes(
61+
(long) requestStartTime * 1000,
62+
(long) requestDuration,
63+
requestHeaders,
64+
requestBody,
65+
(long) requestBodySize,
66+
requestMethod,
67+
requestUrl,
68+
requestContentType,
69+
responseHeaders,
70+
responseBody,
71+
(long) responseBodySize,
72+
(int) statusCode,
73+
responseContentType,
74+
gqlQueryName,
75+
errorMessage,
76+
serverErrorMessage
77+
);
78+
79+
apmNetworkLogger.log(
80+
requestAttributes,
81+
w3cExternalTraceAttributes
82+
);
83+
} catch (Throwable e) {
84+
e.printStackTrace();
85+
}
86+
87+
}
88+
89+
}

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ static Map<String, Object> getAll() {
6262
putAll(placeholders);
6363
putAll(launchType);
6464
putAll(autoMaskingTypes);
65+
putAll(userConsentActionType);
6566
}};
6667
}
6768

@@ -144,6 +145,12 @@ static Map<String, Object> getAll() {
144145
put("reproStepsDisabled", ReproMode.Disable);
145146
}};
146147

148+
static final ArgsMap<String> userConsentActionType = new ArgsMap<String>() {{
149+
put("dropAutoCapturedMedia", com.instabug.bug.userConsent.ActionType.DROP_AUTO_CAPTURED_MEDIA);
150+
put("dropLogs", com.instabug.bug.userConsent.ActionType.DROP_LOGS);
151+
put("noChat", com.instabug.bug.userConsent.ActionType.NO_CHAT);
152+
}};
153+
147154
static final ArgsMap<Integer> sdkLogLevels = new ArgsMap<Integer>() {{
148155
put("sdkDebugLogsLevelNone", com.instabug.library.LogLevel.NONE);
149156
put("sdkDebugLogsLevelError", com.instabug.library.LogLevel.ERROR);

0 commit comments

Comments
 (0)