Skip to content

Commit 5c39572

Browse files
committed
feat: add network body max size APIs in iOS
- Updated Instabug podspec to version 15.0.1. - Added `getNetworkBodyMaxSize` method in `InstabugApi` for retrieving network log body size. - Introduced a new test case for `getNetworkBodyMaxSize` in `InstabugApiTests`. - Updated .gitignore files to include project-specific and Android-related paths.
1 parent acce870 commit 5c39572

File tree

8 files changed

+38
-9
lines changed

8 files changed

+38
-9
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ android/gradlew.bat
7878
**/ios/ServiceDefinitions.json
7979
**/ios/Runner/GeneratedPluginRegistrant.*
8080

81+
# Project specific
82+
/PRDs/
83+
8184
# Exceptions to above rules.
8285
!**/ios/**/default.mode1v3
8386
!**/ios/**/default.mode2v3

example/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ app.*.symbols
3939

4040
# Obfuscation related
4141
app.*.map.json
42+
43+
# Android related
44+
/android/app/.cxx/

example/ios/InstabugTests/InstabugApiTests.m

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,4 +611,22 @@ - (void)testisW3CFeatureFlagsEnabled {
611611

612612
}
613613

614+
- (void)testGetNetworkBodyMaxSize {
615+
id mock = OCMClassMock([IBGNetworkLogger class]);
616+
double expectedValue = 10240.0;
617+
618+
OCMStub([mock getNetworkBodyMaxSize]).andReturn(expectedValue);
619+
620+
XCTestExpectation *expectation = [self expectationWithDescription:@"Call resolve block"];
621+
RCTPromiseResolveBlock resolve = ^(NSNumber *result) {
622+
XCTAssertEqual(result.doubleValue, expectedValue);
623+
[expectation fulfill];
624+
};
625+
626+
[self.instabugBridge getNetworkBodyMaxSize:resolve :nil];
627+
[self waitForExpectationsWithTimeout:1.0 handler:nil];
628+
629+
OCMVerify(ClassMethod([mock getNetworkBodyMaxSize]));
630+
}
631+
614632
@end

example/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ target 'Runner' do
3030

3131
use_frameworks!
3232
use_modular_headers!
33-
pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/fix-main-thread-warning/15.0.0/Instabug.podspec'
33+
pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/feature-expose_network_limit-expose_body_limit/15.0.1/Instabug.podspec'
3434

3535
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
3636
end

example/ios/Podfile.lock

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
PODS:
22
- Flutter (1.0.0)
3-
- Instabug (15.0.0)
3+
- Instabug (15.0.1)
44
- instabug_flutter (14.3.0):
55
- Flutter
6-
- Instabug (= 15.0.0)
76
- OCMock (3.6)
87

98
DEPENDENCIES:
109
- Flutter (from `Flutter`)
11-
- Instabug (from `https://ios-releases.instabug.com/custom/fix-main-thread-warning/15.0.0/Instabug.podspec`)
10+
- Instabug (from `https://ios-releases.instabug.com/custom/feature-expose_network_limit-expose_body_limit/15.0.1/Instabug.podspec`)
1211
- instabug_flutter (from `.symlinks/plugins/instabug_flutter/ios`)
1312
- OCMock (= 3.6)
1413

@@ -20,16 +19,16 @@ EXTERNAL SOURCES:
2019
Flutter:
2120
:path: Flutter
2221
Instabug:
23-
:podspec: https://ios-releases.instabug.com/custom/fix-main-thread-warning/15.0.0/Instabug.podspec
22+
:podspec: https://ios-releases.instabug.com/custom/feature-expose_network_limit-expose_body_limit/15.0.1/Instabug.podspec
2423
instabug_flutter:
2524
:path: ".symlinks/plugins/instabug_flutter/ios"
2625

2726
SPEC CHECKSUMS:
2827
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
29-
Instabug: 3b1db5a683e85ec5a02946aa2b3314036f9022be
30-
instabug_flutter: e59da7a0cae82ce00b2773625ee544c275442000
28+
Instabug: ba6587d15ad5e3ffa265afc8174ff83af4eed29d
29+
instabug_flutter: 4fff4189287934eb3677f72edb0604eeed643980
3130
OCMock: 5ea90566be239f179ba766fd9fbae5885040b992
3231

33-
PODFILE CHECKSUM: c16418947581b888c337ed7ff120a59b4b5f3f3f
32+
PODFILE CHECKSUM: cb4e58e3fdd6b7eb6b2fa2288c84d8a46b98b309
3433

3534
COCOAPODS: 1.16.2

ios/Classes/Modules/InstabugApi.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,4 +396,9 @@ - (void)setNetworkLogBodyEnabledIsEnabled:(NSNumber *)isEnabled
396396
IBGNetworkLogger.logBodyEnabled = [isEnabled boolValue];
397397
}
398398

399+
- (void)getNetworkBodyMaxSizeWithCompletion:(nonnull void (^)(NSNumber * _Nullable, FlutterError * _Nullable))completion {
400+
completion(@(IBGNetworkLogger.getNetworkBodyMaxSize), nil);
401+
}
402+
403+
399404
@end

ios/Classes/Util/IBGNetworkLogger+CP.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ NS_ASSUME_NONNULL_BEGIN
4949
duration:(int64_t) duration
5050
gqlQueryName:(NSString * _Nullable)gqlQueryName;
5151

52+
+ (double)getNetworkBodyMaxSize;
53+
5254
@end
5355

5456
NS_ASSUME_NONNULL_END

ios/instabug_flutter.podspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@ Pod::Spec.new do |s|
1717
s.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-framework "Flutter" -framework "InstabugSDK"'}
1818

1919
s.dependency 'Flutter'
20-
s.dependency 'Instabug', '15.0.0'
2120
end
2221

0 commit comments

Comments
 (0)