Skip to content

Commit a6ac918

Browse files
committed
fix: revert pod version
2 parents 2677803 + e0e06d0 commit a6ac918

File tree

12 files changed

+72
-9
lines changed

12 files changed

+72
-9
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
- Bump Instabug Android SDK to v14.1.0 ([#539](https://github.com/Instabug/Instabug-Flutter/pull/539)). [See release notes](https://github.com/Instabug/Instabug-Android/releases/tag/v14.1.0).
1313
- Bump Instabug iOS SDK to v14.1.0 ([#539](https://github.com/Instabug/Instabug-Flutter/pull/539)). [See release notes](https://github.com/Instabug/Instabug-iOS/releases/tag/14.1.0),
1414

15+
## [Unreleased](https://github.com/Instabug/Instabug-Flutter/compare/v14.0.0...dev)
16+
17+
### Added
18+
19+
- Add support enable/disable capturing network body. ([#561](https://github.com/Instabug/Instabug-Flutter/pull/561))
20+
1521
## [14.1.0](https://github.com/Instabug/Instabug-Flutter/compare/v14.0.0...v14.1.0) (January 2, 2025)
1622

1723
### Changed

android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ android {
4444
}
4545

4646
dependencies {
47-
api 'com.instabug.library:instabug:14.1.0'
47+
api 'com.instabug.library:instabug:14.2.0.6639544-SNAPSHOT'
4848
testImplementation 'junit:junit:4.13.2'
4949
testImplementation "org.mockito:mockito-inline:3.12.1"
5050
testImplementation "io.mockk:mockk:1.13.13"

android/src/main/java/com/instabug/flutter/modules/InstabugApi.java

+10
Original file line numberDiff line numberDiff line change
@@ -499,4 +499,14 @@ public Map<String, Boolean> isW3CFeatureFlagsEnabled() {
499499
public void willRedirectToStore() {
500500
Instabug.willRedirectToStore();
501501
}
502+
503+
504+
@Override
505+
public void setNetworkLogBodyEnabled(@NonNull Boolean isEnabled) {
506+
try {
507+
Instabug.setNetworkLogBodyEnabled(isEnabled);
508+
} catch (Exception e) {
509+
e.printStackTrace();
510+
}
511+
}
502512
}

android/src/test/java/com/instabug/flutter/InstabugApiTest.java

+14
Original file line numberDiff line numberDiff line change
@@ -644,4 +644,18 @@ public void isW3CFeatureFlagsEnabled() {
644644
assertEquals(isW3cCaughtHeaderEnabled, flags.get("isW3cCaughtHeaderEnabled"));
645645

646646
}
647+
648+
@Test
649+
public void testSetNetworkLogBodyEnabled() {
650+
api.setNetworkLogBodyEnabled(true);
651+
652+
mInstabug.verify(() -> Instabug.setNetworkLogBodyEnabled(true));
653+
}
654+
655+
@Test
656+
public void testSetNetworkLogBodyDisabled() {
657+
api.setNetworkLogBodyEnabled(false);
658+
659+
mInstabug.verify(() -> Instabug.setNetworkLogBodyEnabled(false));
660+
}
647661
}

example/ios/InstabugTests/InstabugApiTests.m

+9
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,15 @@ - (void)testWillRedirectToAppStore {
451451
OCMVerify([self.mInstabug willRedirectToAppStore]);
452452
}
453453

454+
- (void)testSetNetworkLogBodyEnabled {
455+
NSNumber *isEnabled = @1;
456+
FlutterError *error;
457+
458+
[self.api setNetworkLogBodyEnabledIsEnabled:isEnabled error:&error];
459+
460+
XCTAssertTrue(IBGNetworkLogger.logBodyEnabled);
461+
}
462+
454463
- (void)testNetworkLogWithW3Caught {
455464
NSString *url = @"https://example.com";
456465
NSString *requestBody = @"hi";

example/ios/Podfile

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe
2727

2828
flutter_ios_podfile_setup
2929
target 'Runner' do
30+
pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/feature-stop-network-body-base/14.2.0/Instabug.podspec'
3031
use_frameworks!
3132
use_modular_headers!
3233

example/ios/Podfile.lock

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
11
PODS:
22
- Flutter (1.0.0)
3-
- Instabug (14.1.0)
3+
- Instabug (14.2.0)
44
- instabug_flutter (14.0.0):
55
- Flutter
6-
- Instabug (= 14.1.0)
6+
- Instabug (= 14.2.0)
77
- OCMock (3.6)
88

99
DEPENDENCIES:
1010
- Flutter (from `Flutter`)
11+
- Instabug (from `https://ios-releases.instabug.com/custom/feature-stop-network-body-base/14.2.0/Instabug.podspec`)
1112
- instabug_flutter (from `.symlinks/plugins/instabug_flutter/ios`)
1213
- OCMock (= 3.6)
1314

1415
SPEC REPOS:
1516
trunk:
16-
- Instabug
1717
- OCMock
1818

1919
EXTERNAL SOURCES:
2020
Flutter:
2121
:path: Flutter
22+
Instabug:
23+
:podspec: https://ios-releases.instabug.com/custom/feature-stop-network-body-base/14.2.0/Instabug.podspec
2224
instabug_flutter:
2325
:path: ".symlinks/plugins/instabug_flutter/ios"
2426

2527
SPEC CHECKSUMS:
2628
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
27-
Instabug: 8cbca8974168c815658133e2813f5ac3a36f8e20
28-
instabug_flutter: a24751dfaedd29475da2af062d3e19d697438f72
29+
Instabug: fb30e419f172a2c405fad1d2d4c42ae64ea10877
30+
instabug_flutter: d689490b2b63ac341d75a3061ee35edc1c9d8b75
2931
OCMock: 5ea90566be239f179ba766fd9fbae5885040b992
3032

31-
PODFILE CHECKSUM: 8f7552fd115ace1988c3db54a69e4a123c448f84
33+
PODFILE CHECKSUM: 338614a69defdc536fc63f92095b4984aab6080e
3234

3335
COCOAPODS: 1.16.2

ios/Classes/Modules/InstabugApi.m

+4-1
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@ - (void)registerFeatureFlagChangeListenerWithError:(FlutterError * _Nullable __a
391391
};
392392
return result;
393393
}
394-
394+
- (void)setNetworkLogBodyEnabledIsEnabled:(NSNumber *)isEnabled
395+
error:(FlutterError *_Nullable *_Nonnull)error {
396+
IBGNetworkLogger.logBodyEnabled = [isEnabled boolValue];
397+
}
395398

396399
@end

ios/instabug_flutter.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ Pod::Spec.new do |s|
1717
s.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-framework "Flutter" -framework "Instabug"'}
1818

1919
s.dependency 'Flutter'
20-
s.dependency 'Instabug', '14.1.0'
20+
s.dependency 'Instabug', '14.2.0'
2121
end
2222

lib/src/modules/network_logger.dart

+6
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,10 @@ class NetworkLogger {
126126
}
127127
return null;
128128
}
129+
130+
/// Enables or disables network body logs capturing.
131+
/// [boolean] isEnabled
132+
static Future<void> setNetworkLogBodyEnabled(bool isEnabled) async {
133+
return _host.setNetworkLogBodyEnabled(isEnabled);
134+
}
129135
}

pigeons/instabug.api.dart

+2
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,6 @@ abstract class InstabugHostApi {
7474
Map<String, bool> isW3CFeatureFlagsEnabled();
7575

7676
void willRedirectToStore();
77+
78+
void setNetworkLogBodyEnabled(bool isEnabled);
7779
}

test/network_logger_test.dart

+10
Original file line numberDiff line numberDiff line change
@@ -229,4 +229,14 @@ void main() {
229229
await logger.networkLog(networkData);
230230
expect(networkData.requestHeaders['traceparent'], 'test');
231231
});
232+
233+
test('[setNetworkLogBodyEnabled] should call host method', () async {
234+
const enabled = true;
235+
236+
await NetworkLogger.setNetworkLogBodyEnabled(enabled);
237+
238+
verify(
239+
mInstabugHost.setNetworkLogBodyEnabled(enabled),
240+
).called(1);
241+
});
232242
}

0 commit comments

Comments
 (0)