diff --git a/CHANGELOG.md b/CHANGELOG.md index 136dba6b7..039ad6ae1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [15.0.1](https://github.com/Instabug/Instabug-Flutter/compare/v14.3.0...15.0.1) + +### Added + +- Add support for xCode 16. ([#574](https://github.com/Instabug/Instabug-Flutter/pull/574)) + +- Add support for BugReporting user consents. ([#573](https://github.com/Instabug/Instabug-Flutter/pull/573)) + +### Changed + +- 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). + +- 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). + ## [14.3.1](https://github.com/Instabug/Instabug-Flutter/compare/v14.3.0...14.3.1) (May 20, 2025) ### Changed @@ -19,12 +33,10 @@ - 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). - ### Fixed - Fixed an issue with `SetReproStepsConfig` on Android platform ([#543](https://github.com/Instabug/Instabug-Flutter/pull/543)). - ## [14.1.0](https://github.com/Instabug/Instabug-Flutter/compare/v14.0.0...v14.1.0) (January 2, 2025) ### Changed diff --git a/android/build.gradle b/android/build.gradle index 31d9ee389..be7f0c4dc 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ group 'com.instabug.flutter' -version '14.3.1' +version '15.0.1' buildscript { repositories { @@ -47,7 +47,7 @@ android { } dependencies { - api 'com.instabug.library:instabug:14.3.1.6803970-SNAPSHOT' + api 'com.instabug.library:instabug:15.0.1' testImplementation 'junit:junit:4.13.2' testImplementation "org.mockito:mockito-inline:3.12.1" testImplementation "io.mockk:mockk:1.13.13" diff --git a/android/src/main/java/com/instabug/flutter/modules/BugReportingApi.java b/android/src/main/java/com/instabug/flutter/modules/BugReportingApi.java index 56d91600b..f3236bb4e 100644 --- a/android/src/main/java/com/instabug/flutter/modules/BugReportingApi.java +++ b/android/src/main/java/com/instabug/flutter/modules/BugReportingApi.java @@ -186,4 +186,26 @@ public void setCommentMinimumCharacterCount(@NonNull Long limit, @Nullable List< } BugReporting.setCommentMinimumCharacterCount(limit.intValue(), reportTypesArray); } + + @Override +public void addUserConsents(String key, String description, Boolean mandatory, Boolean checked, String actionType) { + ThreadManager.runOnMainThread(new Runnable() { + @Override + public void run() { + String mappedActionType; + try { + if (actionType==null) { + mappedActionType = null; + } + else { + mappedActionType = ArgsRegistry.userConsentActionType.get(actionType); + } + + BugReporting.addUserConsent(key, description, mandatory, checked, mappedActionType); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); +} } diff --git a/android/src/main/java/com/instabug/flutter/util/ArgsRegistry.java b/android/src/main/java/com/instabug/flutter/util/ArgsRegistry.java index 222a72836..c38028707 100644 --- a/android/src/main/java/com/instabug/flutter/util/ArgsRegistry.java +++ b/android/src/main/java/com/instabug/flutter/util/ArgsRegistry.java @@ -75,6 +75,12 @@ public T get(Object key) { put("Position.bottomRight", InstabugVideoRecordingButtonPosition.BOTTOM_RIGHT); }}; + public static final ArgsMap userConsentActionType = new ArgsMap() {{ + put("UserConsentActionType.dropAutoCapturedMedia", com.instabug.bug.userConsent.ActionType.DROP_AUTO_CAPTURED_MEDIA); + put("UserConsentActionType.dropLogs", com.instabug.bug.userConsent.ActionType.DROP_LOGS); + put("UserConsentActionType.noChat", com.instabug.bug.userConsent.ActionType.NO_CHAT); + }}; + public static ArgsMap welcomeMessageStates = new ArgsMap() {{ put("WelcomeMessageMode.live", WelcomeMessage.State.LIVE); put("WelcomeMessageMode.beta", WelcomeMessage.State.BETA); diff --git a/android/src/test/java/com/instabug/flutter/BugReportingApiTest.java b/android/src/test/java/com/instabug/flutter/BugReportingApiTest.java index 683b5f49a..6d22e26b8 100644 --- a/android/src/test/java/com/instabug/flutter/BugReportingApiTest.java +++ b/android/src/test/java/com/instabug/flutter/BugReportingApiTest.java @@ -27,7 +27,7 @@ import java.util.List; import io.flutter.plugin.common.BinaryMessenger; - +import com.instabug.bug.userConsent.ActionType; public class BugReportingApiTest { private final BinaryMessenger mMessenger = mock(BinaryMessenger.class); @@ -194,4 +194,19 @@ public void testSetCommentMinimumCharacterCount() { mBugReporting.verify(() -> BugReporting.setCommentMinimumCharacterCount(limit.intValue(), BugReporting.ReportType.BUG, BugReporting.ReportType.QUESTION)); } + + @Test + public void TestAddUserConsents() { + + final String key = "testKey"; + final String description = "Consent description"; + final boolean mandatory = true; + final boolean checked = true; + final String actionType = "UserConsentActionType.dropAutoCapturedMedia"; + + + api.addUserConsents(key, description, mandatory, checked, actionType); + + mBugReporting.verify(()->BugReporting.addUserConsent(key, description, mandatory, checked,"drop_auto_captured_media")); + } } diff --git a/example/ios/InstabugTests/ApmApiTests.m b/example/ios/InstabugTests/ApmApiTests.m index 073937c04..bdb710ac7 100644 --- a/example/ios/InstabugTests/ApmApiTests.m +++ b/example/ios/InstabugTests/ApmApiTests.m @@ -1,8 +1,8 @@ #import #import "OCMock/OCMock.h" #import "ApmApi.h" -#import "Instabug/IBGAPM.h" -#import "Instabug/Instabug.h" +#import "InstabugSDK/IBGAPM.h" +#import "InstabugSDK/InstabugSDK.h" #import "IBGAPM+PrivateAPIs.h" @interface ApmApiTests : XCTestCase diff --git a/example/ios/InstabugTests/BugReportingApiTests.m b/example/ios/InstabugTests/BugReportingApiTests.m index 16f5fbee0..e01df21d2 100644 --- a/example/ios/InstabugTests/BugReportingApiTests.m +++ b/example/ios/InstabugTests/BugReportingApiTests.m @@ -1,7 +1,7 @@ #import #import "OCMock/OCMock.h" #import "BugReportingApi.h" -#import "Instabug/IBGBugReporting.h" +#import "InstabugSDK/IBGBugReporting.h" @interface BugReportingApiTests : XCTestCase @@ -174,5 +174,26 @@ - (void)testSetCommentMinimumCharacterCountGivenNoReportTypes { OCMVerify([self.mBugReporting setCommentMinimumCharacterCountForReportTypes:IBGBugReportingReportTypeBug | IBGBugReportingReportTypeFeedback | IBGBugReportingReportTypeQuestion withLimit:limit.intValue]); } - +- (void)testAddUserConsentWithKey { + NSString *key = @"testKey"; + NSString *description = @"Consent description"; + NSNumber *mandatory = @1; + NSNumber *checked = @0; + NSString *actionType= @"UserConsentActionType.dropAutoCapturedMedia"; + FlutterError *error; + IBGActionType mappedActionType = IBGActionTypeDropAutoCapturedMedia; + + [self.api addUserConsentsKey:key + description:description + mandatory:mandatory + checked:checked + actionType:actionType + error: &error + ]; + OCMVerify([self.mBugReporting addUserConsentWithKey:key + description:description + mandatory:[mandatory boolValue] + checked:[checked boolValue] + actionType:mappedActionType]); +} @end diff --git a/example/ios/InstabugTests/CrashReportingApiTests.m b/example/ios/InstabugTests/CrashReportingApiTests.m index 7b067b329..770342eaf 100644 --- a/example/ios/InstabugTests/CrashReportingApiTests.m +++ b/example/ios/InstabugTests/CrashReportingApiTests.m @@ -1,8 +1,8 @@ #import #import "OCMock/OCMock.h" #import "CrashReportingApi.h" -#import "Instabug/IBGCrashReporting.h" -#import "Instabug/Instabug.h" +#import "InstabugSDK/IBGCrashReporting.h" +#import "InstabugSDK/InstabugSDK.h" #import "Util/Instabug+Test.h" #import "Util/IBGCrashReporting+CP.h" diff --git a/example/ios/InstabugTests/FeatureRequestsApiTests.m b/example/ios/InstabugTests/FeatureRequestsApiTests.m index c0d6dd1fc..e888652c5 100644 --- a/example/ios/InstabugTests/FeatureRequestsApiTests.m +++ b/example/ios/InstabugTests/FeatureRequestsApiTests.m @@ -1,7 +1,7 @@ #import #import "OCMock/OCMock.h" #import "FeatureRequestsApi.h" -#import "Instabug/IBGFeatureRequests.h" +#import "InstabugSDK/IBGFeatureRequests.h" @interface FeatureRequestsApiTests : XCTestCase diff --git a/example/ios/InstabugTests/InstabugApiTests.m b/example/ios/InstabugTests/InstabugApiTests.m index 943e030dd..9f2c04373 100644 --- a/example/ios/InstabugTests/InstabugApiTests.m +++ b/example/ios/InstabugTests/InstabugApiTests.m @@ -2,7 +2,7 @@ #import #import "OCMock/OCMock.h" #import "InstabugApi.h" -#import "Instabug/Instabug.h" +#import "InstabugSDK/InstabugSDK.h" #import "Util/Instabug+Test.h" #import "IBGNetworkLogger+CP.h" #import "Flutter/Flutter.h" diff --git a/example/ios/InstabugTests/InstabugLogApiTests.m b/example/ios/InstabugTests/InstabugLogApiTests.m index 1947ce965..b006ae53c 100644 --- a/example/ios/InstabugTests/InstabugLogApiTests.m +++ b/example/ios/InstabugTests/InstabugLogApiTests.m @@ -1,7 +1,7 @@ #import #import "OCMock/OCMock.h" #import "InstabugLogApi.h" -#import "Instabug/IBGLog.h" +#import "InstabugSDK/IBGLog.h" @interface InstabugLogApiTests : XCTestCase diff --git a/example/ios/InstabugTests/RepliesApiTests.m b/example/ios/InstabugTests/RepliesApiTests.m index 5680cd5a1..ec71f0619 100644 --- a/example/ios/InstabugTests/RepliesApiTests.m +++ b/example/ios/InstabugTests/RepliesApiTests.m @@ -1,7 +1,7 @@ #import #import "OCMock/OCMock.h" #import "RepliesApi.h" -#import "Instabug/IBGReplies.h" +#import "InstabugSDK/IBGReplies.h" @interface RepliesApiTests : XCTestCase diff --git a/example/ios/InstabugTests/SessionReplayApiTests.m b/example/ios/InstabugTests/SessionReplayApiTests.m index d00ef0af2..558d07460 100644 --- a/example/ios/InstabugTests/SessionReplayApiTests.m +++ b/example/ios/InstabugTests/SessionReplayApiTests.m @@ -3,7 +3,7 @@ #import #import "OCMock/OCMock.h" #import "SessionReplayApi.h" -#import "Instabug/IBGSessionReplay.h" +#import "InstabugSDK/IBGSessionReplay.h" @interface SessionReplayApiTests : XCTestCase diff --git a/example/ios/InstabugTests/SurveysApiTests.m b/example/ios/InstabugTests/SurveysApiTests.m index 5feae8bf7..fa552e409 100644 --- a/example/ios/InstabugTests/SurveysApiTests.m +++ b/example/ios/InstabugTests/SurveysApiTests.m @@ -1,7 +1,7 @@ #import #import "OCMock/OCMock.h" #import "SurveysApi.h" -#import "Instabug/IBGSurveys.h" +#import "InstabugSDK/IBGSurveys.h" #import "Util/IBGSurvey+Test.h" @interface SurveysApiTests : XCTestCase diff --git a/example/ios/InstabugTests/Util/Apm+Test.h b/example/ios/InstabugTests/Util/Apm+Test.h index c3bddc4bf..48b93744f 100644 --- a/example/ios/InstabugTests/Util/Apm+Test.h +++ b/example/ios/InstabugTests/Util/Apm+Test.h @@ -1,7 +1,7 @@ // This header file defines Instabug methods that are called using selectors for test verification. -#import -#import +#import +#import @interface IBGAPM (Test) + (void)startUITraceCPWithName:(NSString *)name startTimestampMUS:(NSTimeInterval)startTimestampMUS; diff --git a/example/ios/InstabugTests/Util/IBGCrashReporting+CP.h b/example/ios/InstabugTests/Util/IBGCrashReporting+CP.h index 4229dbcea..cf3a1c200 100644 --- a/example/ios/InstabugTests/Util/IBGCrashReporting+CP.h +++ b/example/ios/InstabugTests/Util/IBGCrashReporting+CP.h @@ -1,4 +1,4 @@ -#import +#import @interface IBGCrashReporting (CP) diff --git a/example/ios/InstabugTests/Util/IBGNetworkLogger+Test.h b/example/ios/InstabugTests/Util/IBGNetworkLogger+Test.h index 09f10eb8d..6f9687768 100644 --- a/example/ios/InstabugTests/Util/IBGNetworkLogger+Test.h +++ b/example/ios/InstabugTests/Util/IBGNetworkLogger+Test.h @@ -1,6 +1,6 @@ // This header file defines IBGNetworkLogger methods that are called using selectors for test verification. -#import +#import @interface IBGNetworkLogger (Test) + (void)addNetworkLogWithUrl:(NSString *)url diff --git a/example/ios/InstabugTests/Util/IBGSurvey+Test.h b/example/ios/InstabugTests/Util/IBGSurvey+Test.h index b17f9107e..631438b9b 100644 --- a/example/ios/InstabugTests/Util/IBGSurvey+Test.h +++ b/example/ios/InstabugTests/Util/IBGSurvey+Test.h @@ -1,6 +1,6 @@ // This header file makes IBGSurvey title property editable to be used in tests. -#import +#import @interface IBGSurvey (Test) @property (nonatomic, strong) NSString *title; diff --git a/example/ios/InstabugTests/Util/Instabug+Test.h b/example/ios/InstabugTests/Util/Instabug+Test.h index d86927c5b..5bb37257a 100644 --- a/example/ios/InstabugTests/Util/Instabug+Test.h +++ b/example/ios/InstabugTests/Util/Instabug+Test.h @@ -1,6 +1,6 @@ // This header file defines Instabug methods that are called using selectors for test verification. -#import +#import @interface Instabug (Test) + (void)setCurrentPlatform:(IBGPlatform)platform; diff --git a/example/ios/Podfile b/example/ios/Podfile index cdffbc5db..00756a1dd 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, '13.4' +platform :ios, '14.4' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' @@ -27,6 +27,7 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe flutter_ios_podfile_setup target 'Runner' do + use_frameworks! use_modular_headers! diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 71008a950..619d1436c 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,9 +1,9 @@ PODS: - Flutter (1.0.0) - - Instabug (14.3.0) - - instabug_flutter (14.3.1): + - Instabug (15.1.1) + - instabug_flutter (15.0.1): - Flutter - - Instabug (= 14.3.0) + - Instabug (= 15.1.1) - OCMock (3.6) DEPENDENCIES: @@ -24,10 +24,10 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 - Instabug: 97a4e694731f46bbc02dbe49ab29cc552c5e2f41 - instabug_flutter: 0a2d35be020c80b2b63bd8337a94a3f2ffe65bc0 + Instabug: 3e7af445c14d7823fcdecba223f09b5f7c0c6ce1 + instabug_flutter: e4e366434313bab3a2db123c1501ca6247dc950b OCMock: 5ea90566be239f179ba766fd9fbae5885040b992 -PODFILE CHECKSUM: 8f7552fd115ace1988c3db54a69e4a123c448f84 +PODFILE CHECKSUM: 4d0aaaf6a444f68024f992999ff2c2ee26baa6ec COCOAPODS: 1.16.2 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 858ba01e5..d32f983fc 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -536,7 +536,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.6; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -559,6 +559,7 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 15.6; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -696,6 +697,7 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 15.6; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -727,6 +729,7 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 15.6; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/example/ios/Runner/AppDelegate.swift b/example/ios/Runner/AppDelegate.swift index 11f416a26..b8991863b 100644 --- a/example/ios/Runner/AppDelegate.swift +++ b/example/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/example/ios/Runner/InstabugExampleMethodCallHandler.m b/example/ios/Runner/InstabugExampleMethodCallHandler.m index 6b1331587..3e4ee70d6 100644 --- a/example/ios/Runner/InstabugExampleMethodCallHandler.m +++ b/example/ios/Runner/InstabugExampleMethodCallHandler.m @@ -1,7 +1,7 @@ #import #import "InstabugExampleMethodCallHandler.h" -#import -#import +#import +#import #import // MARK: - Private Interface diff --git a/example/pubspec.lock b/example/pubspec.lock index 34967c6fa..b6bf3b61e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,58 +5,58 @@ packages: dependency: transitive description: name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 url: "https://pub.dev" source: hosted - version: "2.11.0" + version: "2.12.0" boolean_selector: dependency: transitive description: name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" characters: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.0" clock: dependency: transitive description: name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" collection: dependency: transitive description: name: collection - sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" url: "https://pub.dev" source: hosted - version: "1.19.0" + version: "1.19.1" fake_async: dependency: transitive description: name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.2" file: dependency: transitive description: name: file - sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 url: "https://pub.dev" source: hosted - version: "7.0.0" + version: "7.0.1" flutter: dependency: "direct main" description: flutter @@ -107,7 +107,7 @@ packages: path: ".." relative: true source: path - version: "14.3.1" + version: "15.0.1" instabug_http_client: dependency: "direct main" description: @@ -120,18 +120,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" + sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec url: "https://pub.dev" source: hosted - version: "10.0.7" + version: "10.0.8" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 url: "https://pub.dev" source: hosted - version: "3.0.8" + version: "3.0.9" leak_tracker_testing: dependency: transitive description: @@ -152,10 +152,10 @@ packages: dependency: transitive description: name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 url: "https://pub.dev" source: hosted - version: "0.12.16+1" + version: "0.12.17" material_color_utilities: dependency: transitive description: @@ -168,34 +168,34 @@ packages: dependency: transitive description: name: meta - sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.16.0" path: dependency: transitive description: name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" platform: dependency: transitive description: name: platform - sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" url: "https://pub.dev" source: hosted - version: "3.1.5" + version: "3.1.6" process: dependency: transitive description: name: process - sha256: "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32" + sha256: "107d8be718f120bbba9dcd1e95e3bd325b1b4a4f07db64154635ba03f2567a0d" url: "https://pub.dev" source: hosted - version: "5.0.2" + version: "5.0.3" sky_engine: dependency: transitive description: flutter @@ -205,34 +205,34 @@ packages: dependency: transitive description: name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.10.1" stack_trace: dependency: transitive description: name: stack_trace - sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.12.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" string_scanner: dependency: transitive description: name: string_scanner - sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.1" sync_http: dependency: transitive description: @@ -245,18 +245,18 @@ packages: dependency: transitive description: name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" test_api: dependency: transitive description: name: test_api - sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd url: "https://pub.dev" source: hosted - version: "0.7.3" + version: "0.7.4" typed_data: dependency: transitive description: @@ -277,10 +277,10 @@ packages: dependency: transitive description: name: vm_service - sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b + sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" url: "https://pub.dev" source: hosted - version: "14.3.0" + version: "14.3.1" webdriver: dependency: transitive description: @@ -290,5 +290,5 @@ packages: source: hosted version: "3.0.4" sdks: - dart: ">=3.5.0 <4.0.0" + dart: ">=3.7.0-0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/ios/Classes/Modules/ApmApi.m b/ios/Classes/Modules/ApmApi.m index 782765ad7..c6295ce67 100644 --- a/ios/Classes/Modules/ApmApi.m +++ b/ios/Classes/Modules/ApmApi.m @@ -1,4 +1,4 @@ -#import "Instabug.h" +#import "InstabugSDK.h" #import "ApmApi.h" #import "ArgsRegistry.h" #import "IBGAPM+PrivateAPIs.h" diff --git a/ios/Classes/Modules/BugReportingApi.m b/ios/Classes/Modules/BugReportingApi.m index 3c914b789..bb97810b8 100644 --- a/ios/Classes/Modules/BugReportingApi.m +++ b/ios/Classes/Modules/BugReportingApi.m @@ -1,5 +1,5 @@ #import -#import "Instabug.h" +#import "InstabugSDK.h" #import "BugReportingApi.h" #import "ArgsRegistry.h" @@ -165,4 +165,21 @@ - (void)setCommentMinimumCharacterCountLimit:(NSNumber *)limit reportTypes:(null [IBGBugReporting setCommentMinimumCharacterCountForReportTypes:resolvedTypes withLimit:limit.intValue]; } +- (void)addUserConsentsKey:(NSString *)key + description:(NSString *)description + mandatory:(NSNumber *)mandatory + checked:(NSNumber *)checked + actionType:(nullable NSString *)actionType + error:(FlutterError *_Nullable *_Nonnull)error { + + IBGActionType mappedActionType = (ArgsRegistry.userConsentActionTypes[actionType]).integerValue; + + [IBGBugReporting addUserConsentWithKey:key + description:description + mandatory:[mandatory boolValue] + checked:[checked boolValue] + actionType:mappedActionType]; +} + + @end diff --git a/ios/Classes/Modules/CrashReportingApi.m b/ios/Classes/Modules/CrashReportingApi.m index f36e821cf..0103aa766 100644 --- a/ios/Classes/Modules/CrashReportingApi.m +++ b/ios/Classes/Modules/CrashReportingApi.m @@ -1,4 +1,4 @@ -#import "Instabug.h" +#import "InstabugSDK.h" #import "CrashReportingApi.h" #import "../Util/IBGCrashReporting+CP.h" #import "ArgsRegistry.h" diff --git a/ios/Classes/Modules/FeatureRequestsApi.m b/ios/Classes/Modules/FeatureRequestsApi.m index 391bdf06b..8c71bbddd 100644 --- a/ios/Classes/Modules/FeatureRequestsApi.m +++ b/ios/Classes/Modules/FeatureRequestsApi.m @@ -1,4 +1,4 @@ -#import "Instabug.h" +#import "InstabugSDK.h" #import "FeatureRequestsApi.h" #import "ArgsRegistry.h" diff --git a/ios/Classes/Modules/InstabugApi.m b/ios/Classes/Modules/InstabugApi.m index 95222a4c8..3bdc465f0 100644 --- a/ios/Classes/Modules/InstabugApi.m +++ b/ios/Classes/Modules/InstabugApi.m @@ -1,7 +1,7 @@ #import #import #import -#import "Instabug.h" +#import "InstabugSDK.h" #import "IBGNetworkLogger+CP.h" #import "InstabugApi.h" #import "ArgsRegistry.h" diff --git a/ios/Classes/Modules/InstabugLogApi.m b/ios/Classes/Modules/InstabugLogApi.m index 0ae811219..64e62ed2c 100644 --- a/ios/Classes/Modules/InstabugLogApi.m +++ b/ios/Classes/Modules/InstabugLogApi.m @@ -1,4 +1,4 @@ -#import "Instabug.h" +#import "InstabugSDK.h" #import "InstabugLogApi.h" extern void InitInstabugLogApi(id messenger) { diff --git a/ios/Classes/Modules/RepliesApi.m b/ios/Classes/Modules/RepliesApi.m index 636040181..b01dafef7 100644 --- a/ios/Classes/Modules/RepliesApi.m +++ b/ios/Classes/Modules/RepliesApi.m @@ -1,4 +1,4 @@ -#import "Instabug.h" +#import "InstabugSDK.h" #import "RepliesApi.h" extern void InitRepliesApi(id messenger) { diff --git a/ios/Classes/Modules/SessionReplayApi.m b/ios/Classes/Modules/SessionReplayApi.m index 8a4c8d1bf..a7ad68ea3 100644 --- a/ios/Classes/Modules/SessionReplayApi.m +++ b/ios/Classes/Modules/SessionReplayApi.m @@ -1,4 +1,4 @@ -#import "Instabug.h" +#import "InstabugSDK.h" #import "IBGSessionReplay.h" #import "SessionReplayApi.h" #import "ArgsRegistry.h" diff --git a/ios/Classes/Modules/SurveysApi.m b/ios/Classes/Modules/SurveysApi.m index fb6ee9fa4..1a435426c 100644 --- a/ios/Classes/Modules/SurveysApi.m +++ b/ios/Classes/Modules/SurveysApi.m @@ -1,5 +1,5 @@ #import -#import "Instabug.h" +#import "InstabugSDK.h" #import "SurveysApi.h" extern void InitSurveysApi(id messenger) { diff --git a/ios/Classes/Util/ArgsRegistry.h b/ios/Classes/Util/ArgsRegistry.h index a465365df..28e8ecefd 100644 --- a/ios/Classes/Util/ArgsRegistry.h +++ b/ios/Classes/Util/ArgsRegistry.h @@ -1,5 +1,5 @@ #import -#import +#import typedef NSDictionary ArgsDictionary; @@ -21,5 +21,6 @@ typedef NSDictionary ArgsDictionary; + (ArgsDictionary *)locales; + (NSDictionary *)placeholders; ++ (ArgsDictionary *) userConsentActionTypes; @end diff --git a/ios/Classes/Util/ArgsRegistry.m b/ios/Classes/Util/ArgsRegistry.m index b8cdaa21a..c4732550e 100644 --- a/ios/Classes/Util/ArgsRegistry.m +++ b/ios/Classes/Util/ArgsRegistry.m @@ -211,5 +211,11 @@ + (ArgsDictionary *)locales { @"CustomTextPlaceHolderKey.insufficientContentMessage" : kIBGInsufficientContentMessageStringName, }; } - ++ (ArgsDictionary *) userConsentActionTypes { + return @{ + @"UserConsentActionType.dropAutoCapturedMedia": @(IBGActionTypeDropAutoCapturedMedia), + @"UserConsentActionType.dropLogs": @(IBGActionTypeDropLogs), + @"UserConsentActionType.noChat": @(IBGActionTypeNoChat) + }; +} @end diff --git a/ios/Classes/Util/IBGAPM+PrivateAPIs.h b/ios/Classes/Util/IBGAPM+PrivateAPIs.h index e61bda308..22207d45b 100644 --- a/ios/Classes/Util/IBGAPM+PrivateAPIs.h +++ b/ios/Classes/Util/IBGAPM+PrivateAPIs.h @@ -6,7 +6,7 @@ // Copyright © 2020 Moataz. All rights reserved. // -#import +#import #import "IBGTimeIntervalUnits.h" @interface IBGAPM (PrivateAPIs) diff --git a/ios/Classes/Util/IBGCrashReporting+CP.h b/ios/Classes/Util/IBGCrashReporting+CP.h index 4229dbcea..cf3a1c200 100644 --- a/ios/Classes/Util/IBGCrashReporting+CP.h +++ b/ios/Classes/Util/IBGCrashReporting+CP.h @@ -1,4 +1,4 @@ -#import +#import @interface IBGCrashReporting (CP) diff --git a/ios/Classes/Util/IBGNetworkLogger+CP.h b/ios/Classes/Util/IBGNetworkLogger+CP.h index 244e3d195..54cb9d7ef 100644 --- a/ios/Classes/Util/IBGNetworkLogger+CP.h +++ b/ios/Classes/Util/IBGNetworkLogger+CP.h @@ -1,4 +1,4 @@ -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ios/instabug_flutter.podspec b/ios/instabug_flutter.podspec index 1c097aee9..2d898f9c6 100644 --- a/ios/instabug_flutter.podspec +++ b/ios/instabug_flutter.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'instabug_flutter' - s.version = '14.3.1' + s.version = '15.0.1' s.summary = 'Flutter plugin for integrating the Instabug SDK.' s.author = 'Instabug' s.homepage = 'https://www.instabug.com/platforms/flutter' @@ -14,9 +14,9 @@ Pod::Spec.new do |s| s.public_header_files = 'Classes/**/*.h' s.ios.deployment_target = '10.0' - s.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-framework "Flutter" -framework "Instabug"'} + s.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-framework "Flutter" -framework "InstabugSDK"'} s.dependency 'Flutter' - s.dependency 'Instabug', '14.3.0' + s.dependency 'Instabug', '15.1.1' end diff --git a/lib/src/modules/bug_reporting.dart b/lib/src/modules/bug_reporting.dart index bf2bca82c..b19147d3d 100644 --- a/lib/src/modules/bug_reporting.dart +++ b/lib/src/modules/bug_reporting.dart @@ -15,6 +15,12 @@ enum InvocationOption { emailFieldOptional } +enum UserConsentActionType { + dropAutoCapturedMedia, + dropLogs, + noChat, +} + enum DismissType { cancel, submit, addAttachment } enum ReportType { bug, feedback, question, other } @@ -255,4 +261,26 @@ class BugReporting implements BugReportingFlutterApi { reportTypes?.mapToString(), ); } + + /// Adds a user consent item to the bug reporting form. + /// [key] A unique identifier string for the consent item. + /// [description] The text shown to the user describing the consent item. + /// [mandatory] Whether the user must agree to this item before submitting a report. + /// [checked] Whether the consent checkbox is pre-selected. + /// [actionType] A string representing the action type to map to SDK behavior. + static Future addUserConsents({ + required String key, + required String description, + required bool mandatory, + required bool checked, + UserConsentActionType? actionType, + }) async { + return _host.addUserConsents( + key, + description, + mandatory, + checked, + actionType?.toString(), + ); + } } diff --git a/pigeons/bug_reporting.api.dart b/pigeons/bug_reporting.api.dart index faa180893..8bf127531 100644 --- a/pigeons/bug_reporting.api.dart +++ b/pigeons/bug_reporting.api.dart @@ -32,4 +32,11 @@ abstract class BugReportingHostApi { int limit, List? reportTypes, ); + void addUserConsents( + String key, + String description, + bool mandatory, + bool checked, + String? actionType, + ); } diff --git a/pubspec.yaml b/pubspec.yaml index f72a3695f..b6957c5b8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: instabug_flutter -version: 14.3.1 +version: 15.0.1 description: >- Instabug empowers mobile teams to monitor, prioritize, and debug performance and stability issues throughout the app development lifecycle. @@ -15,15 +15,15 @@ dependencies: dev_dependencies: build_runner: ^2.0.3 - fake_async: '>=1.2.0 <1.4.0' + fake_async: ">=1.2.0 <1.4.0" flutter_test: sdk: flutter lint: ^1.0.0 # mockito v5.2.0 is needed for running Flutter 2 tests on CI - mockito: '>=5.2.0 <5.5.0' + mockito: ">=5.2.0 <5.5.0" pana: ^0.21.0 # pigeon v3.0.0 is needed for running Flutter 2 tests on CI - pigeon: '>=3.0.0 <=10.1.5' + pigeon: ">=3.0.0 <=10.1.5" flutter: plugin: