Skip to content

Commit 0520ee1

Browse files
Merge pull request #587 from Instabug/dev
Release: v15.0.1
2 parents 9598fec + a2b40cd commit 0520ee1

Some content is hidden

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

43 files changed

+238
-99
lines changed

CHANGELOG.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## [15.0.1](https://github.com/Instabug/Instabug-Flutter/compare/v14.3.0...15.0.1)
4+
5+
### Added
6+
7+
- Add support for xCode 16. ([#574](https://github.com/Instabug/Instabug-Flutter/pull/574))
8+
9+
- Add support for BugReporting user consents. ([#573](https://github.com/Instabug/Instabug-Flutter/pull/573))
10+
11+
### Changed
12+
13+
- Bump Instabug iOS SDK to v15.1.1 ([#581](https://github.com/Instabug/Instabug-Flutter/pull/581)). [See release notes](https://github.com/Instabug/Instabug-iOS/releases/tag/15.1.1).
14+
15+
- Bump Instabug Android SDK to v15.0.1 ([#581](https://github.com/Instabug/Instabug-Flutter/pull/581)). [See release notes](https://github.com/Instabug/Instabug-Android/releases/tag/v15.0.1).
16+
317
## [14.3.1](https://github.com/Instabug/Instabug-Flutter/compare/v14.3.0...14.3.1) (May 20, 2025)
418

519
### Changed
@@ -19,12 +33,10 @@
1933

2034
- Bump Instabug Android SDK to v14.3.0 ([#569](https://github.com/Instabug/Instabug-Flutter/pull/569)). [See release notes](https://github.com/Instabug/Instabug-Android/releases/tag/v14.3.0).
2135

22-
2336
### Fixed
2437

2538
- Fixed an issue with `SetReproStepsConfig` on Android platform ([#543](https://github.com/Instabug/Instabug-Flutter/pull/543)).
2639

27-
2840
## [14.1.0](https://github.com/Instabug/Instabug-Flutter/compare/v14.0.0...v14.1.0) (January 2, 2025)
2941

3042
### Changed

android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group 'com.instabug.flutter'
2-
version '14.3.1'
2+
version '15.0.1'
33

44
buildscript {
55
repositories {
@@ -47,7 +47,7 @@ android {
4747
}
4848

4949
dependencies {
50-
api 'com.instabug.library:instabug:14.3.1.6803970-SNAPSHOT'
50+
api 'com.instabug.library:instabug:15.0.1'
5151
testImplementation 'junit:junit:4.13.2'
5252
testImplementation "org.mockito:mockito-inline:3.12.1"
5353
testImplementation "io.mockk:mockk:1.13.13"

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,26 @@ public void setCommentMinimumCharacterCount(@NonNull Long limit, @Nullable List<
186186
}
187187
BugReporting.setCommentMinimumCharacterCount(limit.intValue(), reportTypesArray);
188188
}
189+
190+
@Override
191+
public void addUserConsents(String key, String description, Boolean mandatory, Boolean checked, String actionType) {
192+
ThreadManager.runOnMainThread(new Runnable() {
193+
@Override
194+
public void run() {
195+
String mappedActionType;
196+
try {
197+
if (actionType==null) {
198+
mappedActionType = null;
199+
}
200+
else {
201+
mappedActionType = ArgsRegistry.userConsentActionType.get(actionType);
202+
}
203+
204+
BugReporting.addUserConsent(key, description, mandatory, checked, mappedActionType);
205+
} catch (Exception e) {
206+
e.printStackTrace();
207+
}
208+
}
209+
});
210+
}
189211
}

android/src/main/java/com/instabug/flutter/util/ArgsRegistry.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ public T get(Object key) {
7575
put("Position.bottomRight", InstabugVideoRecordingButtonPosition.BOTTOM_RIGHT);
7676
}};
7777

78+
public static final ArgsMap<String> userConsentActionType = new ArgsMap<String>() {{
79+
put("UserConsentActionType.dropAutoCapturedMedia", com.instabug.bug.userConsent.ActionType.DROP_AUTO_CAPTURED_MEDIA);
80+
put("UserConsentActionType.dropLogs", com.instabug.bug.userConsent.ActionType.DROP_LOGS);
81+
put("UserConsentActionType.noChat", com.instabug.bug.userConsent.ActionType.NO_CHAT);
82+
}};
83+
7884
public static ArgsMap<WelcomeMessage.State> welcomeMessageStates = new ArgsMap<WelcomeMessage.State>() {{
7985
put("WelcomeMessageMode.live", WelcomeMessage.State.LIVE);
8086
put("WelcomeMessageMode.beta", WelcomeMessage.State.BETA);

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import java.util.List;
2828

2929
import io.flutter.plugin.common.BinaryMessenger;
30-
30+
import com.instabug.bug.userConsent.ActionType;
3131

3232
public class BugReportingApiTest {
3333
private final BinaryMessenger mMessenger = mock(BinaryMessenger.class);
@@ -194,4 +194,19 @@ public void testSetCommentMinimumCharacterCount() {
194194

195195
mBugReporting.verify(() -> BugReporting.setCommentMinimumCharacterCount(limit.intValue(), BugReporting.ReportType.BUG, BugReporting.ReportType.QUESTION));
196196
}
197+
198+
@Test
199+
public void TestAddUserConsents() {
200+
201+
final String key = "testKey";
202+
final String description = "Consent description";
203+
final boolean mandatory = true;
204+
final boolean checked = true;
205+
final String actionType = "UserConsentActionType.dropAutoCapturedMedia";
206+
207+
208+
api.addUserConsents(key, description, mandatory, checked, actionType);
209+
210+
mBugReporting.verify(()->BugReporting.addUserConsent(key, description, mandatory, checked,"drop_auto_captured_media"));
211+
}
197212
}

example/ios/InstabugTests/ApmApiTests.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#import <XCTest/XCTest.h>
22
#import "OCMock/OCMock.h"
33
#import "ApmApi.h"
4-
#import "Instabug/IBGAPM.h"
5-
#import "Instabug/Instabug.h"
4+
#import "InstabugSDK/IBGAPM.h"
5+
#import "InstabugSDK/InstabugSDK.h"
66
#import "IBGAPM+PrivateAPIs.h"
77

88
@interface ApmApiTests : XCTestCase

example/ios/InstabugTests/BugReportingApiTests.m

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#import <XCTest/XCTest.h>
22
#import "OCMock/OCMock.h"
33
#import "BugReportingApi.h"
4-
#import "Instabug/IBGBugReporting.h"
4+
#import "InstabugSDK/IBGBugReporting.h"
55

66
@interface BugReportingApiTests : XCTestCase
77

@@ -174,5 +174,26 @@ - (void)testSetCommentMinimumCharacterCountGivenNoReportTypes {
174174

175175
OCMVerify([self.mBugReporting setCommentMinimumCharacterCountForReportTypes:IBGBugReportingReportTypeBug | IBGBugReportingReportTypeFeedback | IBGBugReportingReportTypeQuestion withLimit:limit.intValue]);
176176
}
177-
177+
- (void)testAddUserConsentWithKey {
178+
NSString *key = @"testKey";
179+
NSString *description = @"Consent description";
180+
NSNumber *mandatory = @1;
181+
NSNumber *checked = @0;
182+
NSString *actionType= @"UserConsentActionType.dropAutoCapturedMedia";
183+
FlutterError *error;
184+
IBGActionType mappedActionType = IBGActionTypeDropAutoCapturedMedia;
185+
186+
[self.api addUserConsentsKey:key
187+
description:description
188+
mandatory:mandatory
189+
checked:checked
190+
actionType:actionType
191+
error: &error
192+
];
193+
OCMVerify([self.mBugReporting addUserConsentWithKey:key
194+
description:description
195+
mandatory:[mandatory boolValue]
196+
checked:[checked boolValue]
197+
actionType:mappedActionType]);
198+
}
178199
@end

example/ios/InstabugTests/CrashReportingApiTests.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#import <XCTest/XCTest.h>
22
#import "OCMock/OCMock.h"
33
#import "CrashReportingApi.h"
4-
#import "Instabug/IBGCrashReporting.h"
5-
#import "Instabug/Instabug.h"
4+
#import "InstabugSDK/IBGCrashReporting.h"
5+
#import "InstabugSDK/InstabugSDK.h"
66
#import "Util/Instabug+Test.h"
77
#import "Util/IBGCrashReporting+CP.h"
88

example/ios/InstabugTests/FeatureRequestsApiTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#import <XCTest/XCTest.h>
22
#import "OCMock/OCMock.h"
33
#import "FeatureRequestsApi.h"
4-
#import "Instabug/IBGFeatureRequests.h"
4+
#import "InstabugSDK/IBGFeatureRequests.h"
55

66
@interface FeatureRequestsApiTests : XCTestCase
77

example/ios/InstabugTests/InstabugApiTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#import <XCTest/XCTest.h>
33
#import "OCMock/OCMock.h"
44
#import "InstabugApi.h"
5-
#import "Instabug/Instabug.h"
5+
#import "InstabugSDK/InstabugSDK.h"
66
#import "Util/Instabug+Test.h"
77
#import "IBGNetworkLogger+CP.h"
88
#import "Flutter/Flutter.h"

0 commit comments

Comments
 (0)