From 1592118bc54c7ee621cf6deec6561616b99a5ad6 Mon Sep 17 00:00:00 2001 From: Ahmed alaa Date: Tue, 20 Feb 2024 18:26:40 +0200 Subject: [PATCH 01/19] feat: Mapping-Session-Replay-links-api --- .../flutter/modules/SessionReplayApi.java | 9 +++++ .../flutter/SessionReplayApiTest.java | 25 ++++++++++++++ .../ios/InstabugTests/SessionReplayApiTests.m | 15 ++++++++ example/lib/main.dart | 25 ++++++++++++++ example/pubspec.lock | 34 +++++++++---------- ios/Classes/Modules/SessionReplayApi.m | 7 ++++ lib/src/modules/session_replay.dart | 11 ++++++ pigeons/session_replay.api.dart | 4 +++ test/session_replay_test.dart | 12 +++++++ 9 files changed, 125 insertions(+), 17 deletions(-) diff --git a/android/src/main/java/com/instabug/flutter/modules/SessionReplayApi.java b/android/src/main/java/com/instabug/flutter/modules/SessionReplayApi.java index cf142c0b4..2170f2c98 100644 --- a/android/src/main/java/com/instabug/flutter/modules/SessionReplayApi.java +++ b/android/src/main/java/com/instabug/flutter/modules/SessionReplayApi.java @@ -1,8 +1,10 @@ package com.instabug.flutter.modules; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import com.instabug.flutter.generated.SessionReplayPigeon; +import com.instabug.library.OnSessionReplayLinkReady; import com.instabug.library.sessionreplay.SessionReplay; import io.flutter.plugin.common.BinaryMessenger; @@ -33,4 +35,11 @@ public void setInstabugLogsEnabled(@NonNull Boolean isEnabled) { public void setUserStepsEnabled(@NonNull Boolean isEnabled) { SessionReplay.setUserStepsEnabled(isEnabled); } + + @Override + public void getSessionReplayLink(@NonNull SessionReplayPigeon.Result result) { + SessionReplay.getSessionReplayLink(result::success); + } + + } diff --git a/android/src/test/java/com/instabug/flutter/SessionReplayApiTest.java b/android/src/test/java/com/instabug/flutter/SessionReplayApiTest.java index ace140c92..223871844 100644 --- a/android/src/test/java/com/instabug/flutter/SessionReplayApiTest.java +++ b/android/src/test/java/com/instabug/flutter/SessionReplayApiTest.java @@ -4,10 +4,13 @@ import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mockStatic; +import static org.mockito.Mockito.timeout; +import static org.mockito.Mockito.verify; import com.instabug.flutter.generated.SessionReplayPigeon; import com.instabug.flutter.modules.SessionReplayApi; import com.instabug.flutter.util.GlobalMocks; +import com.instabug.library.OnSessionReplayLinkReady; import com.instabug.library.sessionreplay.SessionReplay; import org.junit.After; @@ -81,6 +84,28 @@ public void testSetUserStepsEnabled() { mSessionReplay.verify(() -> SessionReplay.setUserStepsEnabled(true)); } + @Test + public void testGetSessionReplayLink() { + SessionReplayPigeon.Result result = mock(SessionReplayPigeon.Result.class); + String link="instabug link"; + + mSessionReplay.when(() -> SessionReplay.getSessionReplayLink(any())).thenAnswer( + invocation -> { + OnSessionReplayLinkReady callback = (OnSessionReplayLinkReady) invocation.getArguments()[0]; + callback.onSessionReplayLinkReady(link); + return callback; + }); + api.getSessionReplayLink(result); + + + mSessionReplay.verify(() -> SessionReplay.getSessionReplayLink(any())); + mSessionReplay.verifyNoMoreInteractions(); + + + verify(result, timeout(1000)).success(link); + + + } } diff --git a/example/ios/InstabugTests/SessionReplayApiTests.m b/example/ios/InstabugTests/SessionReplayApiTests.m index 1eeca6ca9..d00ef0af2 100644 --- a/example/ios/InstabugTests/SessionReplayApiTests.m +++ b/example/ios/InstabugTests/SessionReplayApiTests.m @@ -1,4 +1,6 @@ #import +#import +#import #import "OCMock/OCMock.h" #import "SessionReplayApi.h" #import "Instabug/IBGSessionReplay.h" @@ -54,4 +56,17 @@ - (void)testSetUserStepsEnabled { OCMVerify([self.mSessionReplay setUserStepsEnabled:YES]); } +- (void)testGetSessionReplayLink { + NSString *link = @"link"; + id result = ^(NSString * result, FlutterError * error) { + XCTAssertEqualObjects(result, link); + }; + + OCMStub([self.mSessionReplay sessionReplayLink]).andReturn(link); + [self.api getSessionReplayLinkWithCompletion:result]; + OCMVerify([self.mSessionReplay sessionReplayLink]); + +} + + @end diff --git a/example/lib/main.dart b/example/lib/main.dart index 31705db25..cdd183628 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -170,6 +170,23 @@ class _MyHomePageState extends State { Surveys.showSurvey('PMqUZXqarkOR2yGKiENB4w'); } + final _scaffoldKey=GlobalKey(); + + void getCurrentSessionReplaylink() async { + final result=await SessionReplay.getSessionReplayLink(); + if(result==null){ + const snackBar = SnackBar( + content: Text('No Link Found'), + ); + ScaffoldMessenger.of(_scaffoldKey.currentContext!).showSnackBar(snackBar); + }else{ + var snackBar = SnackBar( + content: Text(result), + ); + ScaffoldMessenger.of(_scaffoldKey.currentContext!).showSnackBar(snackBar); + } + } + void showFeatureRequests() { FeatureRequests.show(); } @@ -204,6 +221,7 @@ class _MyHomePageState extends State { @override Widget build(BuildContext context) { return Scaffold( + key: _scaffoldKey, appBar: AppBar(title: Text(widget.title)), body: SingleChildScrollView( physics: ClampingScrollPhysics(), @@ -362,6 +380,13 @@ class _MyHomePageState extends State { ), child: const Text('Dark'), ), + + + SectionTitle('Sessions Replay'), + InstabugButton( + onPressed: getCurrentSessionReplaylink, + text: 'Get current session replay link', + ), ], ), ], diff --git a/example/pubspec.lock b/example/pubspec.lock index a22d74e64..52457f4a1 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" espresso: dependency: "direct dev" description: @@ -112,10 +112,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" path: dependency: transitive description: @@ -128,10 +128,10 @@ packages: dependency: transitive description: name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102 url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.2" process: dependency: transitive description: @@ -157,18 +157,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -197,10 +197,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" vector_math: dependency: transitive description: @@ -213,18 +213,18 @@ packages: dependency: transitive description: name: vm_service - sha256: c620a6f783fa22436da68e42db7ebbf18b8c44b9a46ab911f666ff09ffd9153f + sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583 url: "https://pub.dev" source: hosted - version: "11.7.1" + version: "11.10.0" web: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" webdriver: dependency: transitive description: @@ -234,5 +234,5 @@ packages: source: hosted version: "3.0.2" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=2.10.0" diff --git a/ios/Classes/Modules/SessionReplayApi.m b/ios/Classes/Modules/SessionReplayApi.m index 600fae725..8a4c8d1bf 100644 --- a/ios/Classes/Modules/SessionReplayApi.m +++ b/ios/Classes/Modules/SessionReplayApi.m @@ -27,4 +27,11 @@ - (void)setUserStepsEnabledIsEnabled:(nonnull NSNumber *)isEnabled error:(Flutte IBGSessionReplay.userStepsEnabled = [isEnabled boolValue]; } +- (void)getSessionReplayLinkWithCompletion:(void (^)(NSString *, FlutterError *))completion { + NSString * link= IBGSessionReplay.sessionReplayLink; + completion(link,nil); + +} + + @end diff --git a/lib/src/modules/session_replay.dart b/lib/src/modules/session_replay.dart index e900f2fe5..1e5fa8e86 100644 --- a/lib/src/modules/session_replay.dart +++ b/lib/src/modules/session_replay.dart @@ -63,4 +63,15 @@ class SessionReplay { static Future setUserStepsEnabled(bool isEnabled) async { return _host.setUserStepsEnabled(isEnabled); } + + /// Retrieves current session's replay link. + /// + /// Example: + /// + /// ```dart + /// await SessionReplay.getSessionReplayLink(); + /// ``` + static Future getSessionReplayLink() async { + return _host.getSessionReplayLink(); + } } diff --git a/pigeons/session_replay.api.dart b/pigeons/session_replay.api.dart index 75983fa6f..1d4f01821 100644 --- a/pigeons/session_replay.api.dart +++ b/pigeons/session_replay.api.dart @@ -6,4 +6,8 @@ abstract class SessionReplayHostApi { void setNetworkLogsEnabled(bool isEnabled); void setInstabugLogsEnabled(bool isEnabled); void setUserStepsEnabled(bool isEnabled); + @async + String getSessionReplayLink(); + + } diff --git a/test/session_replay_test.dart b/test/session_replay_test.dart index ad334bb7b..54695e954 100644 --- a/test/session_replay_test.dart +++ b/test/session_replay_test.dart @@ -47,6 +47,7 @@ void main() { ).called(1); }); + test('[setUserStepsEnabled] should call host method', () async { const isEnabled = true; await SessionReplay.setUserStepsEnabled(isEnabled); @@ -55,4 +56,15 @@ void main() { mHost.setUserStepsEnabled(isEnabled), ).called(1); }); + + test('[getSessionReplayLink] should call host method', () async { + const link = 'link'; + when(mHost.getSessionReplayLink()).thenAnswer((_) async => link); + + final result= await SessionReplay.getSessionReplayLink(); + expect(result, link); + verify( + mHost.getSessionReplayLink(), + ).called(1); + }); } From 6c82d6d290e97cefb9cf32c7851fe7ee87bd0522 Mon Sep 17 00:00:00 2001 From: Ahmed alaa Date: Tue, 20 Feb 2024 18:27:54 +0200 Subject: [PATCH 02/19] featL add changelog data --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc7d78ecd..332a3b515 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ # Changelog +## [Unreleased](https://github.com/Instabug/Instabug-React-Native/compare/v12.7.1...dev) + +### Added + +- Add Retrieves current session's replay link. ([#1142](hhttps://github.com/Instabug/Instabug-Flutter/pull/1142)). ## [12.7.0](https://github.com/Instabug/Instabug-Flutter/compare/v12.5.0...v12.7.0) (February 15, 2024) From 15ea612e66eb8127f3b6bbe941e3075b3a9c9ad4 Mon Sep 17 00:00:00 2001 From: ahmed alaa <154802748+ahmedAlaaInstabug@users.noreply.github.com> Date: Tue, 20 Feb 2024 18:30:47 +0200 Subject: [PATCH 03/19] Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 332a3b515..2f00c4ab8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,9 @@ # Changelog -## [Unreleased](https://github.com/Instabug/Instabug-React-Native/compare/v12.7.1...dev) +## [Unreleased](https://github.com/Instabug/Instabug-Flutter/compare/v12.7.0...dev) ### Added -- Add Retrieves current session's replay link. ([#1142](hhttps://github.com/Instabug/Instabug-Flutter/pull/1142)). +- Add Retrieves current session's replay link. ([#445](hhttps://github.com/Instabug/Instabug-Flutter/pull/445)). ## [12.7.0](https://github.com/Instabug/Instabug-Flutter/compare/v12.5.0...v12.7.0) (February 15, 2024) From 93da06bb19b975ec52f75874363c2b2566d17aab Mon Sep 17 00:00:00 2001 From: ahmed alaa <154802748+ahmedAlaaInstabug@users.noreply.github.com> Date: Tue, 20 Feb 2024 18:31:57 +0200 Subject: [PATCH 04/19] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f00c4ab8..429cdeb19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # Changelog + ## [Unreleased](https://github.com/Instabug/Instabug-Flutter/compare/v12.7.0...dev) ### Added From cb2f1a7942c83eea8075452dda5a69283a0dae5a Mon Sep 17 00:00:00 2001 From: ahmed alaa <154802748+ahmedAlaaInstabug@users.noreply.github.com> Date: Sun, 3 Mar 2024 10:12:13 +0200 Subject: [PATCH 05/19] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 429cdeb19..3b75bd2da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### Added -- Add Retrieves current session's replay link. ([#445](hhttps://github.com/Instabug/Instabug-Flutter/pull/445)). +- Add SessionReplay.getSessionReplayLink API which retrieves the current session's replay link ([#445](hhttps://github.com/Instabug/Instabug-Flutter/pull/445)). ## [12.7.0](https://github.com/Instabug/Instabug-Flutter/compare/v12.5.0...v12.7.0) (February 15, 2024) From 080a318e0dd25fc83d78ddf61cbded37c04314ee Mon Sep 17 00:00:00 2001 From: ahmed alaa <154802748+ahmedAlaaInstabug@users.noreply.github.com> Date: Sun, 3 Mar 2024 10:13:22 +0200 Subject: [PATCH 06/19] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b75bd2da..fa5b0f32b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### Added -- Add SessionReplay.getSessionReplayLink API which retrieves the current session's replay link ([#445](hhttps://github.com/Instabug/Instabug-Flutter/pull/445)). +- Add ``` SessionReplay.getSessionReplayLink ``` API which retrieves the current session's replay link ([#445](hhttps://github.com/Instabug/Instabug-Flutter/pull/445)). ## [12.7.0](https://github.com/Instabug/Instabug-Flutter/compare/v12.5.0...v12.7.0) (February 15, 2024) From 3699871d849cbf3e641e4ac94df3abf20530f6f9 Mon Sep 17 00:00:00 2001 From: ahmed alaa <154802748+ahmedAlaaInstabug@users.noreply.github.com> Date: Wed, 6 Mar 2024 11:19:42 +0200 Subject: [PATCH 07/19] Update CHANGELOG.md Co-authored-by: Abdelhamid Nasser <38096011+abdelhamid-f-nasser@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa5b0f32b..39cf5413e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### Added -- Add ``` SessionReplay.getSessionReplayLink ``` API which retrieves the current session's replay link ([#445](hhttps://github.com/Instabug/Instabug-Flutter/pull/445)). +- Add `SessionReplay.getSessionReplayLink` API which retrieves the current session's replay link ([#445](hhttps://github.com/Instabug/Instabug-Flutter/pull/445)). ## [12.7.0](https://github.com/Instabug/Instabug-Flutter/compare/v12.5.0...v12.7.0) (February 15, 2024) From 5571c3d864dfc96569caddb40fd384e7bae2612c Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Thu, 21 Mar 2024 15:13:01 +0200 Subject: [PATCH 08/19] Map: willRedirectToAppStore() api for android & iOS --- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../instabug/flutter/modules/InstabugApi.java | 14 +-- .../com/instabug/flutter/InstabugApiTest.java | 8 +- example/android/app/build.gradle | 2 +- example/android/build.gradle | 2 +- example/ios/Flutter/AppFrameworkInfo.plist | 2 +- example/ios/InstabugTests/InstabugApiTests.m | 7 ++ example/ios/Podfile | 2 +- example/ios/Podfile.lock | 6 +- example/ios/Runner.xcodeproj/project.pbxproj | 13 +-- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- example/ios/Runner/Info.plist | 2 + example/pubspec.lock | 86 +++++++++++-------- ios/Classes/Modules/InstabugApi.m | 4 + lib/src/modules/instabug.dart | 5 ++ pigeons/instabug.api.dart | 2 + test/instabug_test.dart | 10 +++ 17 files changed, 114 insertions(+), 55 deletions(-) diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index ca8c529fc..ffed3a254 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip diff --git a/android/src/main/java/com/instabug/flutter/modules/InstabugApi.java b/android/src/main/java/com/instabug/flutter/modules/InstabugApi.java index 80e9cfa67..a1350221a 100644 --- a/android/src/main/java/com/instabug/flutter/modules/InstabugApi.java +++ b/android/src/main/java/com/instabug/flutter/modules/InstabugApi.java @@ -76,7 +76,7 @@ public void setCurrentPlatform() { @Override public void setEnabled(@NonNull Boolean isEnabled) { try { - if(isEnabled) + if (isEnabled) Instabug.enable(); else Instabug.disable(); @@ -171,13 +171,12 @@ public void setSessionProfilerEnabled(@NonNull Boolean enabled) { @Override public void setValueForStringWithKey(@NonNull String value, @NonNull String key) { - if(ArgsRegistry.placeholders.containsKey(key)) { + if (ArgsRegistry.placeholders.containsKey(key)) { InstabugCustomTextPlaceHolder.Key resolvedKey = ArgsRegistry.placeholders.get(key); placeHolder.set(resolvedKey, value); Instabug.setCustomTextPlaceHolders(placeHolder); - } - else { - Log.i(TAG, "Instabug: " + key + " is only relevant to iOS."); + } else { + Log.i(TAG, "Instabug: " + key + " is only relevant to iOS."); } } @@ -397,4 +396,9 @@ public void networkLog(@NonNull Map data) { Log.e(TAG, "Network logging failed"); } } + + @Override + public void willRedirectToAppStore() { + Instabug.willRedirectToStore(); + } } diff --git a/android/src/test/java/com/instabug/flutter/InstabugApiTest.java b/android/src/test/java/com/instabug/flutter/InstabugApiTest.java index 140daab65..b47ce2f52 100644 --- a/android/src/test/java/com/instabug/flutter/InstabugApiTest.java +++ b/android/src/test/java/com/instabug/flutter/InstabugApiTest.java @@ -493,7 +493,7 @@ public void testAddFileAttachmentWithURLWhenFileDoesNotExists() { @Test public void testAddFileAttachmentWithData() { - byte[] data = new byte[] {65, 100}; + byte[] data = new byte[]{65, 100}; String name = "Issue"; api.addFileAttachmentWithData(data, name); @@ -549,4 +549,10 @@ public void testNetworkLog() { mJSONObject.close(); } + + @Test + public void testWillRedirectToAppStore() { + api.willRedirectToAppStore(); + mInstabug.verify(Instabug::willRedirectToStore); + } } diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 9e8ff84e9..04f99d12a 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -44,7 +44,7 @@ android { defaultConfig { applicationId "com.instabug.flutter.example" - minSdkVersion 18 + minSdkVersion flutter.minSdkVersion targetSdkVersion 30 versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/example/android/build.gradle b/example/android/build.gradle index 58a8c74b1..713d7f6e6 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index 4f8d4d245..8c6e56146 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 12.0 diff --git a/example/ios/InstabugTests/InstabugApiTests.m b/example/ios/InstabugTests/InstabugApiTests.m index 3b55e0c3f..61c58987d 100644 --- a/example/ios/InstabugTests/InstabugApiTests.m +++ b/example/ios/InstabugTests/InstabugApiTests.m @@ -398,4 +398,11 @@ - (void)testNetworkLog { ]); } +- (void)testWillRedirectToAppStore { + FlutterError *error; + [self.api willRedirectToAppStoreWithError:&error]; + + OCMVerify([self.mInstabug willRedirectToAppStore]); +} + @end diff --git a/example/ios/Podfile b/example/ios/Podfile index 3a216ba41..ee085cf9f 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, '11.0' +platform :ios, '12.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index e49ff8e53..0651c540b 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -23,11 +23,11 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/instabug_flutter/ios" SPEC CHECKSUMS: - Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 Instabug: 59f0b0bc2c062b5cdbbf417cca365480a1fe55d8 instabug_flutter: f6ea69a1629e5d7dbdd21b1a0d3199a09fe3e43c OCMock: 5ea90566be239f179ba766fd9fbae5885040b992 -PODFILE CHECKSUM: 637e800c0a0982493b68adb612d2dd60c15c8e5c +PODFILE CHECKSUM: 4de1907d67185ba01b9d9c952bfb1b2c3b10d282 -COCOAPODS: 1.13.0 +COCOAPODS: 1.15.2 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 5b2b044d0..5a8db1840 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -344,7 +344,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -447,10 +447,12 @@ }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -478,6 +480,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -674,7 +677,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -760,7 +763,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -809,7 +812,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 1392808b8..0b15932d1 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ Instabug needs access to your photo library so you can attach images. CADisableMinimumFrameDurationOnPhone + UIApplicationSupportsIndirectInputEvents + diff --git a/example/pubspec.lock b/example/pubspec.lock index a22d74e64..2cf7bb5a7 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" espresso: dependency: "direct dev" description: @@ -61,10 +61,10 @@ packages: dependency: transitive description: name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "7.0.0" flutter: dependency: "direct main" description: flutter @@ -92,54 +92,78 @@ packages: relative: true source: path version: "12.7.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + url: "https://pub.dev" + source: hosted + version: "10.0.0" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + url: "https://pub.dev" + source: hosted + version: "2.0.1" matcher: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.11.0" path: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" platform: dependency: transitive description: name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.4" process: dependency: transitive description: name: process - sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" + sha256: "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32" url: "https://pub.dev" source: hosted - version: "4.2.4" + version: "5.0.2" sky_engine: dependency: transitive description: flutter @@ -157,18 +181,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -197,10 +221,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" vector_math: dependency: transitive description: @@ -213,26 +237,18 @@ packages: dependency: transitive description: name: vm_service - sha256: c620a6f783fa22436da68e42db7ebbf18b8c44b9a46ab911f666ff09ffd9153f - url: "https://pub.dev" - source: hosted - version: "11.7.1" - web: - dependency: transitive - description: - name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "13.0.0" webdriver: dependency: transitive description: name: webdriver - sha256: "3c923e918918feeb90c4c9fdf1fe39220fa4c0e8e2c0fffaded174498ef86c49" + sha256: "003d7da9519e1e5f329422b36c4dcdf18d7d2978d1ba099ea4e45ba490ed845e" url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.3" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.2.0-0 <4.0.0" flutter: ">=2.10.0" diff --git a/ios/Classes/Modules/InstabugApi.m b/ios/Classes/Modules/InstabugApi.m index 7def622f0..bbf3274e3 100644 --- a/ios/Classes/Modules/InstabugApi.m +++ b/ios/Classes/Modules/InstabugApi.m @@ -305,4 +305,8 @@ - (void)networkLogData:(NSDictionary *)data error:(FlutterError } } +- (void)willRedirectToAppStore { + [Instabug willRedirectToAppStore]; +} + @end diff --git a/lib/src/modules/instabug.dart b/lib/src/modules/instabug.dart index 54450c1e5..9a816e0d4 100644 --- a/lib/src/modules/instabug.dart +++ b/lib/src/modules/instabug.dart @@ -412,4 +412,9 @@ class Instabug { final darkKey = await dark.obtainKey(configuration); return _host.setCustomBrandingImage(lightKey.name, darkKey.name); } + + /// This API has to be call when using custom app rating prompt + static Future willRedirectToAppStore() async { + return _host.willRedirectToAppStore(); + } } diff --git a/pigeons/instabug.api.dart b/pigeons/instabug.api.dart index 2d1308ce1..e0199c380 100644 --- a/pigeons/instabug.api.dart +++ b/pigeons/instabug.api.dart @@ -54,4 +54,6 @@ abstract class InstabugHostApi { void clearFileAttachments(); void networkLog(Map data); + + void willRedirectToAppStore(); } diff --git a/test/instabug_test.dart b/test/instabug_test.dart index 8f623796e..3852d3d18 100644 --- a/test/instabug_test.dart +++ b/test/instabug_test.dart @@ -383,4 +383,14 @@ void main() { mHost.clearFileAttachments(), ).called(1); }); + + test('[willRedirectToAppStore] should call host method', () async { + //arrange + await Instabug.willRedirectToAppStore(); + + //assert + verify( + mHost.willRedirectToAppStore(), + ).called(1); + }); } From 686a20b47bbcf557d1e2a0136e186b8e9ce7e390 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Fri, 22 Mar 2024 00:49:35 +0200 Subject: [PATCH 09/19] fix: willRedirectToAppStore iOS signature --- ios/Classes/Modules/InstabugApi.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Classes/Modules/InstabugApi.m b/ios/Classes/Modules/InstabugApi.m index bbf3274e3..887273b10 100644 --- a/ios/Classes/Modules/InstabugApi.m +++ b/ios/Classes/Modules/InstabugApi.m @@ -305,7 +305,7 @@ - (void)networkLogData:(NSDictionary *)data error:(FlutterError } } -- (void)willRedirectToAppStore { +- (void)willRedirectToAppStoreWithError:(FlutterError * _Nullable __autoreleasing *)error { [Instabug willRedirectToAppStore]; } From 3ede9b6cf3fd494ad10ea45eec4ce17b0b6eece3 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Mon, 25 Mar 2024 16:09:29 +0200 Subject: [PATCH 10/19] revert: non related files (build.gradle, Info.plist, Podfile, ... ) --- .../gradle/wrapper/gradle-wrapper.properties | 2 +- example/android/app/build.gradle | 2 +- example/android/build.gradle | 2 +- example/ios/Flutter/AppFrameworkInfo.plist | 2 +- example/ios/Podfile | 2 +- example/ios/Podfile.lock | 6 +- example/ios/Runner.xcodeproj/project.pbxproj | 13 ++- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- example/ios/Runner/Info.plist | 2 - example/pubspec.lock | 86 ++++++++----------- 10 files changed, 49 insertions(+), 70 deletions(-) diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index ffed3a254..ca8c529fc 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 04f99d12a..9e8ff84e9 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -44,7 +44,7 @@ android { defaultConfig { applicationId "com.instabug.flutter.example" - minSdkVersion flutter.minSdkVersion + minSdkVersion 18 targetSdkVersion 30 versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/example/android/build.gradle b/example/android/build.gradle index 713d7f6e6..58a8c74b1 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -tasks.register("clean", Delete) { +task clean(type: Delete) { delete rootProject.buildDir } diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index 8c6e56146..4f8d4d245 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 12.0 + 11.0 diff --git a/example/ios/Podfile b/example/ios/Podfile index ee085cf9f..3a216ba41 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, '12.0' +platform :ios, '11.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 0651c540b..e49ff8e53 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -23,11 +23,11 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/instabug_flutter/ios" SPEC CHECKSUMS: - Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 + Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 Instabug: 59f0b0bc2c062b5cdbbf417cca365480a1fe55d8 instabug_flutter: f6ea69a1629e5d7dbdd21b1a0d3199a09fe3e43c OCMock: 5ea90566be239f179ba766fd9fbae5885040b992 -PODFILE CHECKSUM: 4de1907d67185ba01b9d9c952bfb1b2c3b10d282 +PODFILE CHECKSUM: 637e800c0a0982493b68adb612d2dd60c15c8e5c -COCOAPODS: 1.15.2 +COCOAPODS: 1.13.0 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 5a8db1840..5b2b044d0 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 51; objects = { /* Begin PBXBuildFile section */ @@ -344,7 +344,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1510; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -447,12 +447,10 @@ }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -480,7 +478,6 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -677,7 +674,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 = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -763,7 +760,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 = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -812,7 +809,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 = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 0b15932d1..1392808b8 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ Instabug needs access to your photo library so you can attach images. CADisableMinimumFrameDurationOnPhone - UIApplicationSupportsIndirectInputEvents - diff --git a/example/pubspec.lock b/example/pubspec.lock index 2cf7bb5a7..a22d74e64 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.17.2" espresso: dependency: "direct dev" description: @@ -61,10 +61,10 @@ packages: dependency: transitive description: name: file - sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" url: "https://pub.dev" source: hosted - version: "7.0.0" + version: "6.1.4" flutter: dependency: "direct main" description: flutter @@ -92,78 +92,54 @@ packages: relative: true source: path version: "12.7.0" - leak_tracker: - dependency: transitive - description: - name: leak_tracker - sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" - url: "https://pub.dev" - source: hosted - version: "10.0.0" - leak_tracker_flutter_testing: - dependency: transitive - description: - name: leak_tracker_flutter_testing - sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 - url: "https://pub.dev" - source: hosted - version: "2.0.1" - leak_tracker_testing: - dependency: transitive - description: - name: leak_tracker_testing - sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 - url: "https://pub.dev" - source: hosted - version: "2.0.1" matcher: dependency: transitive description: name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.16+1" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.5.0" meta: dependency: transitive description: name: meta - sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.9.1" path: dependency: transitive description: name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.8.3" platform: dependency: transitive description: name: platform - sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" + sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" url: "https://pub.dev" source: hosted - version: "3.1.4" + version: "3.1.0" process: dependency: transitive description: name: process - sha256: "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32" + sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" url: "https://pub.dev" source: hosted - version: "5.0.2" + version: "4.2.4" sky_engine: dependency: transitive description: flutter @@ -181,18 +157,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.1" string_scanner: dependency: transitive description: @@ -221,10 +197,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "0.6.0" vector_math: dependency: transitive description: @@ -237,18 +213,26 @@ packages: dependency: transitive description: name: vm_service - sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + sha256: c620a6f783fa22436da68e42db7ebbf18b8c44b9a46ab911f666ff09ffd9153f + url: "https://pub.dev" + source: hosted + version: "11.7.1" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 url: "https://pub.dev" source: hosted - version: "13.0.0" + version: "0.1.4-beta" webdriver: dependency: transitive description: name: webdriver - sha256: "003d7da9519e1e5f329422b36c4dcdf18d7d2978d1ba099ea4e45ba490ed845e" + sha256: "3c923e918918feeb90c4c9fdf1fe39220fa4c0e8e2c0fffaded174498ef86c49" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.2" sdks: - dart: ">=3.2.0-0 <4.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=2.10.0" From 2f1aa27114d6403ed465785daf3b9dd8a6361843 Mon Sep 17 00:00:00 2001 From: AndrewAmin Date: Tue, 16 Apr 2024 18:33:33 +0200 Subject: [PATCH 11/19] chore: rename [willRedirectToAppStore] to [willRedirectToStore], chore: add changes to CHANGELOG.md --- CHANGELOG.md | 7 +++++++ .../java/com/instabug/flutter/modules/InstabugApi.java | 2 +- .../test/java/com/instabug/flutter/InstabugApiTest.java | 4 ++-- example/ios/InstabugTests/InstabugApiTests.m | 2 +- ios/Classes/Modules/InstabugApi.m | 2 +- lib/src/modules/instabug.dart | 4 ++-- pigeons/instabug.api.dart | 2 +- test/instabug_test.dart | 6 +++--- 8 files changed, 18 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc7d78ecd..00c471db1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [Unreleased](https://github.com/Instabug/Instabug-React-Native/compare/v12.7.0...dev) + +### Added + +- Adds custom app rating api ([#453](https://github.com/Instabug/Instabug-Flutter/pull/453)) + + ## [12.7.0](https://github.com/Instabug/Instabug-Flutter/compare/v12.5.0...v12.7.0) (February 15, 2024) ### Added diff --git a/android/src/main/java/com/instabug/flutter/modules/InstabugApi.java b/android/src/main/java/com/instabug/flutter/modules/InstabugApi.java index a1350221a..5cfc178e8 100644 --- a/android/src/main/java/com/instabug/flutter/modules/InstabugApi.java +++ b/android/src/main/java/com/instabug/flutter/modules/InstabugApi.java @@ -398,7 +398,7 @@ public void networkLog(@NonNull Map data) { } @Override - public void willRedirectToAppStore() { + public void willRedirectToStore() { Instabug.willRedirectToStore(); } } diff --git a/android/src/test/java/com/instabug/flutter/InstabugApiTest.java b/android/src/test/java/com/instabug/flutter/InstabugApiTest.java index b47ce2f52..b542259b6 100644 --- a/android/src/test/java/com/instabug/flutter/InstabugApiTest.java +++ b/android/src/test/java/com/instabug/flutter/InstabugApiTest.java @@ -551,8 +551,8 @@ public void testNetworkLog() { } @Test - public void testWillRedirectToAppStore() { - api.willRedirectToAppStore(); + public void testWillRedirectToStore() { + api.willRedirectToStore(); mInstabug.verify(Instabug::willRedirectToStore); } } diff --git a/example/ios/InstabugTests/InstabugApiTests.m b/example/ios/InstabugTests/InstabugApiTests.m index 61c58987d..9f9684120 100644 --- a/example/ios/InstabugTests/InstabugApiTests.m +++ b/example/ios/InstabugTests/InstabugApiTests.m @@ -400,7 +400,7 @@ - (void)testNetworkLog { - (void)testWillRedirectToAppStore { FlutterError *error; - [self.api willRedirectToAppStoreWithError:&error]; + [self.api willRedirectToStoreWithError:&error]; OCMVerify([self.mInstabug willRedirectToAppStore]); } diff --git a/ios/Classes/Modules/InstabugApi.m b/ios/Classes/Modules/InstabugApi.m index 887273b10..493d1fc19 100644 --- a/ios/Classes/Modules/InstabugApi.m +++ b/ios/Classes/Modules/InstabugApi.m @@ -305,7 +305,7 @@ - (void)networkLogData:(NSDictionary *)data error:(FlutterError } } -- (void)willRedirectToAppStoreWithError:(FlutterError * _Nullable __autoreleasing *)error { +- (void)willRedirectToStoreWithError:(FlutterError * _Nullable __autoreleasing *)error { [Instabug willRedirectToAppStore]; } diff --git a/lib/src/modules/instabug.dart b/lib/src/modules/instabug.dart index 9a816e0d4..3254ea5dd 100644 --- a/lib/src/modules/instabug.dart +++ b/lib/src/modules/instabug.dart @@ -414,7 +414,7 @@ class Instabug { } /// This API has to be call when using custom app rating prompt - static Future willRedirectToAppStore() async { - return _host.willRedirectToAppStore(); + static Future willRedirectToStore() async { + return _host.willRedirectToStore(); } } diff --git a/pigeons/instabug.api.dart b/pigeons/instabug.api.dart index e0199c380..7113f164c 100644 --- a/pigeons/instabug.api.dart +++ b/pigeons/instabug.api.dart @@ -55,5 +55,5 @@ abstract class InstabugHostApi { void networkLog(Map data); - void willRedirectToAppStore(); + void willRedirectToStore(); } diff --git a/test/instabug_test.dart b/test/instabug_test.dart index 3852d3d18..41ee2f98b 100644 --- a/test/instabug_test.dart +++ b/test/instabug_test.dart @@ -384,13 +384,13 @@ void main() { ).called(1); }); - test('[willRedirectToAppStore] should call host method', () async { + test('[willRedirectToStore] should call host method', () async { //arrange - await Instabug.willRedirectToAppStore(); + await Instabug.willRedirectToStore(); //assert verify( - mHost.willRedirectToAppStore(), + mHost.willRedirectToStore(), ).called(1); }); } From a3416a7a33bd65020245a84312633923c9908fb5 Mon Sep 17 00:00:00 2001 From: AndrewAmin Date: Tue, 16 Apr 2024 18:36:39 +0200 Subject: [PATCH 12/19] chore: remove useless comments --- test/instabug_test.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/test/instabug_test.dart b/test/instabug_test.dart index 41ee2f98b..78a370963 100644 --- a/test/instabug_test.dart +++ b/test/instabug_test.dart @@ -385,7 +385,6 @@ void main() { }); test('[willRedirectToStore] should call host method', () async { - //arrange await Instabug.willRedirectToStore(); //assert From 33bee162d5e53773b8805ccc7010c7fdb6551f5c Mon Sep 17 00:00:00 2001 From: AndrewAmin Date: Mon, 22 Apr 2024 11:16:15 +0200 Subject: [PATCH 13/19] chore: improve the documentation of the mapping API --- lib/src/modules/instabug.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/modules/instabug.dart b/lib/src/modules/instabug.dart index 3254ea5dd..ac6c49698 100644 --- a/lib/src/modules/instabug.dart +++ b/lib/src/modules/instabug.dart @@ -413,7 +413,11 @@ class Instabug { return _host.setCustomBrandingImage(lightKey.name, darkKey.name); } - /// This API has to be call when using custom app rating prompt + /// Allows detection of app review sessions which are submitted through custom prompts. + /// + /// Use this when utilizing a custom app rating prompt. It should be called + /// once the user clicks on the Call to Action (CTA) that redirects them to the app store. + /// Helps track session data for insights on user interactions during review submission. static Future willRedirectToStore() async { return _host.willRedirectToStore(); } From 378ce7ab8b18618b560aef7cb87c72fabbb2d4ff Mon Sep 17 00:00:00 2001 From: Ahmed alaa Date: Tue, 23 Apr 2024 15:45:27 +0200 Subject: [PATCH 14/19] chore(ios): bump SDL to v13.0.0 --- CHANGELOG.md | 4 ++++ example/ios/Podfile.lock | 10 +++++----- ios/instabug_flutter.podspec | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5dd2272e2..b5eea0566 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ - Adds custom app rating api ([#453](https://github.com/Instabug/Instabug-Flutter/pull/453)) - Add `SessionReplay.getSessionReplayLink` API which retrieves the current session's replay link ([#445](hhttps://github.com/Instabug/Instabug-Flutter/pull/445)). +### Changed + +- Bump Instabug iOS SDK to v13.0.0 ([#446](https://github.com/Instabug/Instabug-Flutter/pull/446)). [See release notes](https://github.com/Instabug/Instabug-iOS/releases/tag/13.0.0). + ## [12.7.0](https://github.com/Instabug/Instabug-Flutter/compare/v12.5.0...v12.7.0) (February 15, 2024) ### Added diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index e49ff8e53..4d58250bc 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,9 +1,9 @@ PODS: - Flutter (1.0.0) - - Instabug (12.7.0) + - Instabug (13.0.0) - instabug_flutter (12.7.0): - Flutter - - Instabug (= 12.7.0) + - Instabug (= 13.0.0) - OCMock (3.6) DEPENDENCIES: @@ -23,9 +23,9 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/instabug_flutter/ios" SPEC CHECKSUMS: - Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 - Instabug: 59f0b0bc2c062b5cdbbf417cca365480a1fe55d8 - instabug_flutter: f6ea69a1629e5d7dbdd21b1a0d3199a09fe3e43c + Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 + Instabug: fa52de4a6cac26cde0a60ec5e0540f2461a06fe2 + instabug_flutter: c8293ec7ad7ffe049c743a0057601838b8af505d OCMock: 5ea90566be239f179ba766fd9fbae5885040b992 PODFILE CHECKSUM: 637e800c0a0982493b68adb612d2dd60c15c8e5c diff --git a/ios/instabug_flutter.podspec b/ios/instabug_flutter.podspec index 73c4b23b1..4cecf2e83 100644 --- a/ios/instabug_flutter.podspec +++ b/ios/instabug_flutter.podspec @@ -17,6 +17,6 @@ Pod::Spec.new do |s| s.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-framework "Flutter" -framework "Instabug"'} s.dependency 'Flutter' - s.dependency 'Instabug', '12.7.0' + s.dependency 'Instabug', '13.0.0' end From aa45682314ca75c9720de4f81eeb6c230492d5a1 Mon Sep 17 00:00:00 2001 From: Andrew Amin <160974398+AndrewAminInstabug@users.noreply.github.com> Date: Tue, 23 Apr 2024 20:24:03 +0200 Subject: [PATCH 15/19] ci: upgrade android orb, node orbe android image (#454) * ci: upgrade android orb, node orb and android_image versions * ci: apply Circle Ci recommendations * ci: fix missing tag circle ci error * ci: fix image android:2024.01.1-ndk is not a valid resource class error * Updated config.yml * ci: add default to android tag * ci: remove [ additional-avd-args: -d "pixel_4"] * ci: upgrade [android system-image from android-30 to android-33 ] * ci: upgrade [system image to x86_64] * ci: upgrade [system image to x86_64] * chore(CI): using x86 android emulator system image * chore(CI): using x86 android emulator system image * chore (CI): change system-image to [system-images;android-29;default;x86] * chore (CI): add install avd command * chore (CI): hash non related jobs * chore (CI): rename emulator * ci: remove espresso test cases --------- Co-authored-by: Ahmed alaa --- .circleci/config.yml | 67 +++++++++++++++++++--------------------- e2e/Utils/CaptainTest.cs | 6 ++-- 2 files changed, 35 insertions(+), 38 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 44d0c8c33..271a239ed 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,9 +1,10 @@ version: 2.1 orbs: - android: circleci/android@2.0 + android: circleci/android@2.5.0 flutter: circleci/flutter@2.0.2 - node: circleci/node@5.1.0 + node: circleci/node@5.2.0 + advanced-checkout: vsco/advanced-checkout@1.1.0 commands: setup_flutter: @@ -103,13 +104,12 @@ commands: name: Build Pigeons command: dart run build_runner build --delete-conflicting-outputs - jobs: danger: executor: name: node/default steps: - - checkout + - advanced-checkout/shallow-checkout - node/install-packages: pkg-manager: yarn override-ci-command: yarn install --frozen-lockfile --network-concurrency 1 @@ -126,7 +126,7 @@ jobs: docker: - image: cirrusci/flutter:<> steps: - - checkout + - advanced-checkout/shallow-checkout - install_flutter_and_dart_packages: generate_pigeons: true - run: flutter test --coverage @@ -142,16 +142,10 @@ jobs: executor: name: android/android-machine resource-class: xlarge - tag: 2022.04.1 + tag: default steps: - - checkout + - advanced-checkout/shallow-checkout - setup_flutter - - android/start-emulator-and-run-tests: - system-image: system-images;android-30;google_apis;x86 - additional-avd-args: -d "Nexus 5" - post-emulator-launch-assemble-command: cd example && flutter build apk - run-tests-working-directory: example/android - test-command: ./gradlew app:connectedAndroidTest -Ptarget=`pwd`/../test_driver/example.dart - android/run-tests: working-directory: example/android test-command: ./gradlew test @@ -160,42 +154,45 @@ jobs: executor: name: android/android-machine resource-class: xlarge - tag: 2022.04.1 + tag: default steps: - - checkout + - advanced-checkout/shallow-checkout - setup_captain: platform: android - setup_flutter - android/start-emulator-and-run-tests: - system-image: system-images;android-30;google_apis;x86 - additional-avd-args: -d "pixel_4" - post-emulator-launch-assemble-command: cd example || true && flutter build apk --debug - test-command: cd e2e || true && dotnet test + run-tests-working-directory: e2e + system-image: system-images;android-33;default;x86_64 + post-emulator-launch-assemble-command: cd example && flutter build apk --debug + test-command: dotnet test test_ios: macos: - xcode: 13.4.1 + xcode: 15.3.0 resource_class: macos.m1.medium.gen1 + environment: + INSTABUG_SOURCEMAPS_UPLOAD_DISABLE: true steps: - - checkout + - advanced-checkout/shallow-checkout - setup_ios - run: name: Build and run tests - working_directory: example/ios + working_directory: ~/project/example/ios command: | xcodebuild -allowProvisioningUpdates \ - -workspace Runner.xcworkspace \ - -scheme Runner \ - -sdk iphonesimulator \ - -destination 'name=iPhone 12 Pro Max' \ - test | xcpretty + -workspace Runner.xcworkspace \ + -scheme Runner \ + -resultBundlePath coverage/result.xcresult \ + -sdk iphonesimulator \ + -destination 'platform=iOS Simulator,name=iPhone 15 Pro Max,OS=17.4' \ + test | xcpretty e2e_ios_captain: macos: - xcode: 13.4.1 + xcode: 15.3.0 resource_class: macos.m1.medium.gen1 steps: - - checkout + - advanced-checkout/shallow-checkout - setup_captain: platform: ios - setup_ios @@ -213,7 +210,7 @@ jobs: docker: - image: cirrusci/flutter steps: - - checkout + - advanced-checkout/shallow-checkout - install_flutter_and_dart_packages: generate_pigeons: false - run: @@ -224,7 +221,7 @@ jobs: docker: - image: cirrusci/flutter steps: - - checkout + - advanced-checkout/shallow-checkout - install_flutter_and_dart_packages: generate_pigeons: true - run: @@ -235,7 +232,7 @@ jobs: docker: - image: cirrusci/flutter steps: - - checkout + - advanced-checkout/shallow-checkout - install_flutter_and_dart_packages: generate_pigeons: true - run: @@ -245,11 +242,11 @@ jobs: release: macos: - xcode: 13.4.1 + xcode: 15.3.0 resource_class: macos.m1.medium.gen1 working_directory: "~" steps: - - checkout: + - advanced-checkout/shallow-checkout: path: ~/project # Flutter doesn't support Apple Silicon yet, so we need to install Rosetta use Flutter on M1 machines. - run: @@ -284,6 +281,7 @@ workflows: version: 2 build-test-and-approval-deploy: jobs: + - test_android - danger: requires: - test_flutter-stable @@ -293,7 +291,6 @@ workflows: - test_flutter: name: test_flutter-2.10.5 version: 2.10.5 - - test_android - e2e_android_captain - test_ios - e2e_ios_captain diff --git a/e2e/Utils/CaptainTest.cs b/e2e/Utils/CaptainTest.cs index d73f37e3c..04884fcea 100644 --- a/e2e/Utils/CaptainTest.cs +++ b/e2e/Utils/CaptainTest.cs @@ -9,11 +9,11 @@ public class CaptainTest : IDisposable { AndroidApp = Path.GetFullPath("../../../../example/build/app/outputs/flutter-apk/app-debug.apk"), AndroidAppId = "com.instabug.flutter.example", - AndroidVersion = "11", + AndroidVersion = "13", IosApp = Path.GetFullPath("../../../../example/build/ios/iphonesimulator/Runner.app"), IosAppId = "com.instabug.InstabugSample", - IosVersion = "15.5", - IosDevice = "iPhone 13 Pro Max" + IosVersion = "17.4", + IosDevice = "iPhone 15 Pro Max" }; protected static readonly Captain captain = new(_config); From a639ab7d413ffe1f9d4b44500b7d0af6232200b7 Mon Sep 17 00:00:00 2001 From: ahmed alaa <154802748+ahmedAlaaInstabug@users.noreply.github.com> Date: Tue, 23 Apr 2024 20:24:51 +0200 Subject: [PATCH 16/19] chore(android): bump sdk to v13.0.0 (#455) * chore(android): bump SDL to v13.0.0 * Update CHANGELOG.md Co-authored-by: Ahmed Mahmoud <68241710+a7medev@users.noreply.github.com> --------- Co-authored-by: Ahmed Mahmoud <68241710+a7medev@users.noreply.github.com> --- CHANGELOG.md | 2 +- android/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5eea0566..661df88a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ - Add `SessionReplay.getSessionReplayLink` API which retrieves the current session's replay link ([#445](hhttps://github.com/Instabug/Instabug-Flutter/pull/445)). ### Changed - +- Bump Instabug Android SDK to v13.0.0 ([#455](https://github.com/Instabug/Instabug-Flutter/pull/455)). [See release notes](https://github.com/Instabug/Instabug-Android/releases/tag/v13.0.0). - Bump Instabug iOS SDK to v13.0.0 ([#446](https://github.com/Instabug/Instabug-Flutter/pull/446)). [See release notes](https://github.com/Instabug/Instabug-iOS/releases/tag/13.0.0). ## [12.7.0](https://github.com/Instabug/Instabug-Flutter/compare/v12.5.0...v12.7.0) (February 15, 2024) diff --git a/android/build.gradle b/android/build.gradle index 52f1d9b50..6587271de 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -41,7 +41,7 @@ android { } dependencies { - api 'com.instabug.library:instabug:12.7.1' + api 'com.instabug.library:instabug:13.0.0' testImplementation 'junit:junit:4.13.2' testImplementation "org.mockito:mockito-inline:3.12.1" From c1f78513e0f28018eaf074ff0094ceae51041002 Mon Sep 17 00:00:00 2001 From: Abdelhamid Nasser <38096011+abdelhamid-f-nasser@users.noreply.github.com> Date: Tue, 23 Apr 2024 20:26:03 +0200 Subject: [PATCH 17/19] feat: support app flows APIs (#446) * chore: deprecate execution traces APIs Deprecate execution traces in favor of AppFlows APIs. * feat: support app flows * chore: reformat files * docs: update changelog.md * docs: update deprecation notice with APM prefix * refactor: change flow attribute value to nullable * Update CHANGELOG.md Co-authored-by: Ahmed Mahmoud <68241710+a7medev@users.noreply.github.com> * Update lib/src/modules/apm.dart Co-authored-by: Ahmed Mahmoud <68241710+a7medev@users.noreply.github.com> --------- Co-authored-by: Ahmed Mahmoud <68241710+a7medev@users.noreply.github.com> --- CHANGELOG.md | 5 + .../com/instabug/flutter/modules/ApmApi.java | 34 ++++++- .../java/com/instabug/flutter/ApmApiTest.java | 33 +++++++ example/ios/InstabugTests/ApmApiTests.m | 29 ++++++ example/pubspec.lock | 98 ++++++++++++------- ios/Classes/Modules/ApmApi.m | 12 +++ lib/src/models/trace.dart | 15 +++ lib/src/modules/apm.dart | 48 +++++++++ pigeons/apm.api.dart | 3 + test/apm_test.dart | 33 +++++++ 10 files changed, 268 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 661df88a8..a1361a0ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ - Adds custom app rating api ([#453](https://github.com/Instabug/Instabug-Flutter/pull/453)) - Add `SessionReplay.getSessionReplayLink` API which retrieves the current session's replay link ([#445](hhttps://github.com/Instabug/Instabug-Flutter/pull/445)). +- Add support for App Flows APIs `APM.startFlow`, `APM.endFlow` and `APM.setFlowAttribute` ([#446](https://github.com/Instabug/Instabug-Flutter/pull/446)). + +### Deprecated + +- Deprecate execution traces APIs `APM.startExecutionTrace`, `APM.setExecutionTraceAttribute`, `APM.endExecutionTrace`, `Trace.setAttribute` and `Trace.end` in favor of the new app flow APIs ([#446](https://github.com/Instabug/Instabug-Flutter/pull/446)). ### Changed - Bump Instabug Android SDK to v13.0.0 ([#455](https://github.com/Instabug/Instabug-Flutter/pull/455)). [See release notes](https://github.com/Instabug/Instabug-Android/releases/tag/v13.0.0). diff --git a/android/src/main/java/com/instabug/flutter/modules/ApmApi.java b/android/src/main/java/com/instabug/flutter/modules/ApmApi.java index c0a4a81e8..c0862acac 100644 --- a/android/src/main/java/com/instabug/flutter/modules/ApmApi.java +++ b/android/src/main/java/com/instabug/flutter/modules/ApmApi.java @@ -1,24 +1,21 @@ package com.instabug.flutter.modules; import android.util.Log; - import androidx.annotation.NonNull; - +import androidx.annotation.Nullable; import com.instabug.apm.APM; import com.instabug.apm.model.ExecutionTrace; import com.instabug.apm.networking.APMNetworkLogger; import com.instabug.flutter.generated.ApmPigeon; import com.instabug.flutter.util.Reflection; import com.instabug.flutter.util.ThreadManager; - +import io.flutter.plugin.common.BinaryMessenger; import org.json.JSONObject; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; -import io.flutter.plugin.common.BinaryMessenger; - public class ApmApi implements ApmPigeon.ApmHostApi { private final String TAG = ApmApi.class.getName(); private final HashMap traces = new HashMap<>(); @@ -95,6 +92,33 @@ public void run() { ); } + @Override + public void startFlow(@NonNull String name) { + try { + APM.startFlow(name); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Override + public void setFlowAttribute(@NonNull String name, @NonNull String key, @Nullable String value) { + try { + APM.setFlowAttribute(name, key, value); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Override + public void endFlow(@NonNull String name) { + try { + APM.endFlow(name); + } catch (Exception e) { + e.printStackTrace(); + } + } + @Override public void setExecutionTraceAttribute(@NonNull String id, @NonNull String key, @NonNull String value) { try { diff --git a/android/src/test/java/com/instabug/flutter/ApmApiTest.java b/android/src/test/java/com/instabug/flutter/ApmApiTest.java index 45528217a..aefb3b62d 100644 --- a/android/src/test/java/com/instabug/flutter/ApmApiTest.java +++ b/android/src/test/java/com/instabug/flutter/ApmApiTest.java @@ -148,6 +148,39 @@ public void testEndExecutionTrace() { verify(mTrace).end(); } + @Test + public void testStartFlow() { + String appFlowName = "appFlowName"; + + api.startFlow(appFlowName); + + mAPM.verify(() -> APM.startFlow(appFlowName)); + mAPM.verifyNoMoreInteractions(); + } + + @Test + public void testEndFlow() { + String appFlowName = "appFlowName"; + + api.startFlow(appFlowName); + + mAPM.verify(() -> APM.startFlow(appFlowName)); + mAPM.verifyNoMoreInteractions(); + } + + @Test + public void testSetFlowAttribute() { + String appFlowName = "appFlowName"; + String flowAttributeKey = "attributeKey"; + String flowAttributeValue = "attributeValue"; + + + api.setFlowAttribute(appFlowName, flowAttributeKey, flowAttributeValue); + + mAPM.verify(() -> APM.setFlowAttribute(appFlowName, flowAttributeKey, flowAttributeValue)); + mAPM.verifyNoMoreInteractions(); + } + @Test public void testStartUITrace() { String name = "login"; diff --git a/example/ios/InstabugTests/ApmApiTests.m b/example/ios/InstabugTests/ApmApiTests.m index 795c9e1a1..09e8bad46 100644 --- a/example/ios/InstabugTests/ApmApiTests.m +++ b/example/ios/InstabugTests/ApmApiTests.m @@ -114,6 +114,35 @@ - (void)testEndExecutionTrace { OCMVerify([mTrace end]); } +- (void) testStartFlow { + NSString* appFlowName = @"app-flow-name"; + FlutterError *error; + + [self.api startFlowName:appFlowName error:&error]; + + OCMVerify([self.mAPM startFlowWithName:appFlowName]); +} + +- (void) testEndFlow { + NSString* appFlowName = @"app-flow-name"; + FlutterError *error; + + [self.api endFlowName:appFlowName error:&error]; + + OCMVerify([self.mAPM endFlowWithName:appFlowName]); +} + +- (void) testSetFlowAttribute { + NSString* appFlowName = @"app-flow-name"; + NSString* attributeKey = @"attribute-key"; + NSString* attributeValue = @"attribute-value"; + FlutterError *error; + + [self.api setFlowAttributeName:appFlowName key:attributeKey value:attributeValue error:&error]; + + OCMVerify([self.mAPM setAttributeForFlowWithName:appFlowName key:attributeKey value:attributeValue]); +} + - (void)testStartUITrace { NSString *name = @"login"; FlutterError *error; diff --git a/example/pubspec.lock b/example/pubspec.lock index 52457f4a1..d6f6d91dc 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -1,14 +1,22 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + archive: + dependency: transitive + description: + name: archive + sha256: "80e5141fafcb3361653ce308776cfd7d45e6e9fbb429e14eec571382c0c5fecb" + url: "https://pub.dev" + source: hosted + version: "3.3.2" async: dependency: transitive description: name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 url: "https://pub.dev" source: hosted - version: "2.11.0" + version: "2.10.0" boolean_selector: dependency: transitive description: @@ -21,10 +29,10 @@ packages: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.2.1" clock: dependency: transitive description: @@ -37,10 +45,18 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.17.0" + crypto: + dependency: transitive + description: + name: crypto + sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 + url: "https://pub.dev" + source: hosted + version: "3.0.2" espresso: dependency: "direct dev" description: @@ -92,46 +108,54 @@ packages: relative: true source: path version: "12.7.0" + js: + dependency: transitive + description: + name: js + sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + url: "https://pub.dev" + source: hosted + version: "0.6.5" matcher: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.13" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.2.0" meta: dependency: transitive description: name: meta - sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.8.0" path: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.8.2" platform: dependency: transitive description: name: platform - sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102 + sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.0" process: dependency: transitive description: @@ -149,26 +173,26 @@ packages: dependency: transitive description: name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.1" string_scanner: dependency: transitive description: @@ -197,10 +221,18 @@ packages: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + url: "https://pub.dev" + source: hosted + version: "0.4.16" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "1.3.1" vector_math: dependency: transitive description: @@ -213,26 +245,18 @@ packages: dependency: transitive description: name: vm_service - sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583 - url: "https://pub.dev" - source: hosted - version: "11.10.0" - web: - dependency: transitive - description: - name: web - sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + sha256: e7fb6c2282f7631712b69c19d1bff82f3767eea33a2321c14fa59ad67ea391c7 url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "9.4.0" webdriver: dependency: transitive description: name: webdriver - sha256: "3c923e918918feeb90c4c9fdf1fe39220fa4c0e8e2c0fffaded174498ef86c49" + sha256: ef67178f0cc7e32c1494645b11639dd1335f1d18814aa8435113a92e9ef9d841 url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.1" sdks: - dart: ">=3.2.0-194.0.dev <4.0.0" + dart: ">=2.18.0 <3.0.0" flutter: ">=2.10.0" diff --git a/ios/Classes/Modules/ApmApi.m b/ios/Classes/Modules/ApmApi.m index a849df1ec..da7fa84be 100644 --- a/ios/Classes/Modules/ApmApi.m +++ b/ios/Classes/Modules/ApmApi.m @@ -56,6 +56,18 @@ - (void)endExecutionTraceId:(NSString *)id error:(FlutterError *_Nullable *_Nonn } } +- (void)startFlowName:(nonnull NSString *)name error:(FlutterError * _Nullable __autoreleasing * _Nonnull)error { + [IBGAPM startFlowWithName:name]; +} + +- (void)setFlowAttributeName:(nonnull NSString *)name key:(nonnull NSString *)key value:(nullable NSString *)value error:(FlutterError * _Nullable __autoreleasing * _Nonnull)error { + [IBGAPM setAttributeForFlowWithName:name key:key value:value]; +} + +- (void)endFlowName:(nonnull NSString *)name error:(FlutterError * _Nullable __autoreleasing * _Nonnull)error { + [IBGAPM endFlowWithName:name]; +} + - (void)startUITraceName:(NSString *)name error:(FlutterError *_Nullable *_Nonnull)error { [IBGAPM startUITraceWithName:name]; } diff --git a/lib/src/models/trace.dart b/lib/src/models/trace.dart index 9a6a3f458..bf267640b 100644 --- a/lib/src/models/trace.dart +++ b/lib/src/models/trace.dart @@ -10,11 +10,26 @@ class Trace { final String name; final Map attributes = {}; + /// Sets attribute of execution trace. + /// [String] id of the trace. + /// [String] key of attribute. + /// [String] value of attribute. + /// + /// Please migrate to the App Flows APIs: [APM.startFlow], [APM.setFlowAttribute], and [APM.endFlow]. + @Deprecated( + 'Please migrate to the App Flows APIs: APM.startAppFlow, APM.endFlow, and APM.setFlowAttribute. This feature was deprecated in v13.0.0', + ) void setAttribute(String key, String value) { APM.setExecutionTraceAttribute(id, key, value); attributes[key] = value; } + /// Ends Execution Trace + /// + /// Please migrate to the App Flows APIs: [APM.startFlow], [APM.setFlowAttribute], and [APM.endFlow]. + @Deprecated( + 'Please migrate to the App Flows APIs: APM.startAppFlow, APM.endFlow, and APM.setFlowAttribute. This feature was deprecated in v13.0.0', + ) void end() { APM.endExecutionTrace(id); } diff --git a/lib/src/modules/apm.dart b/lib/src/modules/apm.dart index 6f71a9db4..6ade70fa9 100644 --- a/lib/src/modules/apm.dart +++ b/lib/src/modules/apm.dart @@ -33,6 +33,11 @@ class APM { /// Starts an execution trace. /// [String] name of the trace. + /// + /// Please migrate to the App Flows APIs: [startFlow], [setFlowAttribute], and [endFlow]. + @Deprecated( + 'Please migrate to the App Flows APIs: APM.startAppFlow, APM.endFlow, and APM.setFlowAttribute. This feature was deprecated in v13.0.0', + ) static Future startExecutionTrace(String name) async { final id = IBGDateTime.instance.now(); final traceId = await _host.startExecutionTrace(id.toString(), name); @@ -54,6 +59,11 @@ class APM { /// [String] id of the trace. /// [String] key of attribute. /// [String] value of attribute. + /// + /// Please migrate to the App Flows APIs: [startFlow], [setFlowAttribute], and [endFlow]. + @Deprecated( + 'Please migrate to the App Flows APIs: APM.startAppFlow, APM.endFlow, and APM.setFlowAttribute. This feature was deprecated in v13.0.0', + ) static Future setExecutionTraceAttribute( String id, String key, @@ -64,10 +74,48 @@ class APM { /// Ends an execution trace. /// [String] id of the trace. + /// + /// Please migrate to the App Flows APIs: [startFlow], [setFlowAttribute], and [endFlow]. + @Deprecated( + 'Please migrate to the App Flows APIs: APM.startAppFlow, APM.endFlow, and APM.setFlowAttribute. This feature was deprecated in v13.0.0', + ) static Future endExecutionTrace(String id) async { return _host.endExecutionTrace(id); } + /// Starts an AppFlow with the given [name]. + /// + /// The [name] must not be an empty string. It should be unique and not exceed 150 characters, + /// ignoring leading and trailing spaces. + /// + /// Duplicate [name]s will terminate the older AppFlow with the termination reason recorded as + /// 'force abandon end reason'. + /// + /// The method will only execute if APM is enabled, the feature is + /// active, and the SDK has been initialized. + static Future startFlow(String name) async { + if (name.isNotEmpty) { + return _host.startFlow(name.trim()); + } + } + + /// Assigns a custom attribute to an AppFlow with the specified [name], [key], and [value]. + /// + /// The [name] must not be an empty string. The [key] should not exceed 30 characters, + /// and [value] should not exceed 60 characters, with both ignoring leading and trailing spaces. + /// + /// To remove an attribute, set its [value] to null. Attributes cannot be added or + /// modified after an AppFlow has concluded. + static Future setFlowAttribute( + String name, String key, String? value) async { + return _host.setFlowAttribute(name, key, value); + } + + /// Ends the AppFlow with the given [name]. + static Future endFlow(String name) async { + return _host.endFlow(name); + } + /// Enables or disables auto UI tracing. /// [boolean] isEnabled static Future setAutoUITraceEnabled(bool isEnabled) async { diff --git a/pigeons/apm.api.dart b/pigeons/apm.api.dart index 573aad192..dfb23366c 100644 --- a/pigeons/apm.api.dart +++ b/pigeons/apm.api.dart @@ -9,6 +9,9 @@ abstract class ApmHostApi { @async String? startExecutionTrace(String id, String name); + void startFlow(String name); + void setFlowAttribute(String name, String key, String? value); + void endFlow(String name); void setExecutionTraceAttribute( String id, String key, diff --git a/test/apm_test.dart b/test/apm_test.dart index 72d4bcf2a..de4d97c49 100644 --- a/test/apm_test.dart +++ b/test/apm_test.dart @@ -97,6 +97,39 @@ void main() { ).called(1); }); + test('[startFlow] should call host method', () async { + const flowName = "flow-name"; + + verify( + mHost.startFlow(flowName), + ).called(1); + verifyNoMoreInteractions(mHost); + }); + + test('[setFlowAttribute] should call host method', () async { + const flowName = "flow-name"; + const flowAttributeKey = 'attribute-key'; + const flowAttributeValue = 'attribute-value'; + + await APM.setFlowAttribute(flowName, flowAttributeKey, flowAttributeValue); + + verify( + mHost.setFlowAttribute(flowName, flowAttributeKey, flowAttributeValue), + ).called(1); + verifyNoMoreInteractions(mHost); + }); + + test('[endFlow] should call host method', () async { + const flowName = "flow-name"; + + await APM.endFlow(flowName); + + verify( + mHost.endFlow(flowName), + ).called(1); + verifyNoMoreInteractions(mHost); + }); + test('[startUITrace] should call host method', () async { const name = 'UI-trace'; From d5568997b2aaf4815614e2d8aecdb0c22b775700 Mon Sep 17 00:00:00 2001 From: ahmed alaa <154802748+ahmedAlaaInstabug@users.noreply.github.com> Date: Sun, 28 Apr 2024 13:44:30 +0300 Subject: [PATCH 18/19] fix: resolve failing tests (#458) * fix: change-log typo * ci: fix appium issue --- .circleci/config.yml | 13 ++-- CHANGELOG.md | 2 +- e2e/BugReportingTests.cs | 5 ++ e2e/FeatureRequestsTests.cs | 2 + e2e/Utils/CaptainTest.cs | 4 +- example/android/app/build.gradle | 2 +- example/android/build.gradle | 2 +- example/ios/Podfile.lock | 2 +- example/lib/main.dart | 26 ++++--- example/pubspec.lock | 116 ++++++++++++++----------------- lib/src/modules/apm.dart | 5 +- pigeons/session_replay.api.dart | 2 - test/apm_test.dart | 4 ++ test/session_replay_test.dart | 3 +- test/trace_test.dart | 2 + 15 files changed, 97 insertions(+), 93 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 271a239ed..0b712a8fb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,7 +47,7 @@ commands: steps: - run: name: Install XCUITest Driver - command: appium driver install xcuitest@4.35.0 + command: appium driver install xcuitest@7.14.0 - when: condition: equal: @@ -56,7 +56,7 @@ commands: steps: - run: name: Install UIAutomator2 Driver - command: appium driver install uiautomator2@2.29.5 + command: appium driver install uiautomator2@3.1.0 - run: name: Launch Appium # Enable --relaxed-security for `mobile: shell` command that Captain uses internally. @@ -162,13 +162,14 @@ jobs: - setup_flutter - android/start-emulator-and-run-tests: run-tests-working-directory: e2e + additional-avd-args: --device 3 system-image: system-images;android-33;default;x86_64 post-emulator-launch-assemble-command: cd example && flutter build apk --debug test-command: dotnet test test_ios: macos: - xcode: 15.3.0 + xcode: 15.2.0 resource_class: macos.m1.medium.gen1 environment: INSTABUG_SOURCEMAPS_UPLOAD_DISABLE: true @@ -184,12 +185,12 @@ jobs: -scheme Runner \ -resultBundlePath coverage/result.xcresult \ -sdk iphonesimulator \ - -destination 'platform=iOS Simulator,name=iPhone 15 Pro Max,OS=17.4' \ + -destination 'platform=iOS Simulator,name=iPhone 15 Pro Max,OS=17.2' \ test | xcpretty e2e_ios_captain: macos: - xcode: 15.3.0 + xcode: 15.2.0 resource_class: macos.m1.medium.gen1 steps: - advanced-checkout/shallow-checkout @@ -242,7 +243,7 @@ jobs: release: macos: - xcode: 15.3.0 + xcode: 15.2.0 resource_class: macos.m1.medium.gen1 working_directory: "~" steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index a1361a0ad..6c1ce6718 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ ### Added - Adds custom app rating api ([#453](https://github.com/Instabug/Instabug-Flutter/pull/453)) -- Add `SessionReplay.getSessionReplayLink` API which retrieves the current session's replay link ([#445](hhttps://github.com/Instabug/Instabug-Flutter/pull/445)). +- Add `SessionReplay.getSessionReplayLink` API which retrieves the current session's replay link ([#445](https://github.com/Instabug/Instabug-Flutter/pull/445)). - Add support for App Flows APIs `APM.startFlow`, `APM.endFlow` and `APM.setFlowAttribute` ([#446](https://github.com/Instabug/Instabug-Flutter/pull/446)). ### Deprecated diff --git a/e2e/BugReportingTests.cs b/e2e/BugReportingTests.cs index d951ae902..1e933c030 100644 --- a/e2e/BugReportingTests.cs +++ b/e2e/BugReportingTests.cs @@ -69,6 +69,7 @@ public void ShakeInvocationEvent() [Fact] public void TwoFingersSwipeLeftInvocationEvent() { + ScrollUp(); captain.FindByText("Two Fingers Swipe Left").Tap(); Thread.Sleep(500); @@ -112,6 +113,8 @@ public void ManualInvocation() [Fact] public void MultipleScreenshotsInReproSteps() { + ScrollDown(); + captain.FindByText("Enter screen name").Tap(); captain.Type("My Screen"); captain.HideKeyboard(); @@ -189,6 +192,8 @@ public void ChangeFloatingButtonEdge() [Fact] public void OnDismissCallbackIsCalled() { + ScrollUp(); + captain.FindByText("Set On Dismiss Callback").Tap(); captain.FindByText("Invoke").Tap(); diff --git a/e2e/FeatureRequestsTests.cs b/e2e/FeatureRequestsTests.cs index 8a3ba89a1..41c97f684 100644 --- a/e2e/FeatureRequestsTests.cs +++ b/e2e/FeatureRequestsTests.cs @@ -11,6 +11,8 @@ public class FeatureRequestsTests : CaptainTest public void ShowFeatureRequetsScreen() { ScrollDown(); + ScrollDown(); + captain.FindByText("Show Feature Requests").Tap(); var screenTitle = captain.FindById( diff --git a/e2e/Utils/CaptainTest.cs b/e2e/Utils/CaptainTest.cs index 04884fcea..6592dceca 100644 --- a/e2e/Utils/CaptainTest.cs +++ b/e2e/Utils/CaptainTest.cs @@ -9,10 +9,10 @@ public class CaptainTest : IDisposable { AndroidApp = Path.GetFullPath("../../../../example/build/app/outputs/flutter-apk/app-debug.apk"), AndroidAppId = "com.instabug.flutter.example", - AndroidVersion = "13", + AndroidVersion = "14", IosApp = Path.GetFullPath("../../../../example/build/ios/iphonesimulator/Runner.app"), IosAppId = "com.instabug.InstabugSample", - IosVersion = "17.4", + IosVersion = "17.2", IosDevice = "iPhone 15 Pro Max" }; protected static readonly Captain captain = new(_config); diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 9e8ff84e9..04f99d12a 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -44,7 +44,7 @@ android { defaultConfig { applicationId "com.instabug.flutter.example" - minSdkVersion 18 + minSdkVersion flutter.minSdkVersion targetSdkVersion 30 versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/example/android/build.gradle b/example/android/build.gradle index 58a8c74b1..713d7f6e6 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 4d58250bc..abac8f8a3 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -28,6 +28,6 @@ SPEC CHECKSUMS: instabug_flutter: c8293ec7ad7ffe049c743a0057601838b8af505d OCMock: 5ea90566be239f179ba766fd9fbae5885040b992 -PODFILE CHECKSUM: 637e800c0a0982493b68adb612d2dd60c15c8e5c +PODFILE CHECKSUM: 4de1907d67185ba01b9d9c952bfb1b2c3b10d282 COCOAPODS: 1.13.0 diff --git a/example/lib/main.dart b/example/lib/main.dart index cdd183628..d5e90e1db 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -170,17 +170,17 @@ class _MyHomePageState extends State { Surveys.showSurvey('PMqUZXqarkOR2yGKiENB4w'); } - final _scaffoldKey=GlobalKey(); + final _scaffoldKey = GlobalKey(); void getCurrentSessionReplaylink() async { - final result=await SessionReplay.getSessionReplayLink(); - if(result==null){ + final result = await SessionReplay.getSessionReplayLink(); + if (result == null) { const snackBar = SnackBar( content: Text('No Link Found'), ); ScaffoldMessenger.of(_scaffoldKey.currentContext!).showSnackBar(snackBar); - }else{ - var snackBar = SnackBar( + } else { + var snackBar = SnackBar( content: Text(result), ); ScaffoldMessenger.of(_scaffoldKey.currentContext!).showSnackBar(snackBar); @@ -225,7 +225,7 @@ class _MyHomePageState extends State { appBar: AppBar(title: Text(widget.title)), body: SingleChildScrollView( physics: ClampingScrollPhysics(), - padding: const EdgeInsets.only(top: 20.0), + padding: const EdgeInsets.only(top: 20.0, bottom: 16), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -360,7 +360,7 @@ class _MyHomePageState extends State { ), SectionTitle('Color Theme'), ButtonBar( - mainAxisSize: MainAxisSize.max, + mainAxisSize: MainAxisSize.min, alignment: MainAxisAlignment.center, children: [ ElevatedButton( @@ -380,15 +380,13 @@ class _MyHomePageState extends State { ), child: const Text('Dark'), ), - - - SectionTitle('Sessions Replay'), - InstabugButton( - onPressed: getCurrentSessionReplaylink, - text: 'Get current session replay link', - ), ], ), + SectionTitle('Sessions Replay'), + InstabugButton( + onPressed: getCurrentSessionReplaylink, + text: 'Get current session replay link', + ), ], )), // This trailing comma makes auto-formatting nicer for build methods. ); diff --git a/example/pubspec.lock b/example/pubspec.lock index d6f6d91dc..055c11dd1 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -1,22 +1,14 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - archive: - dependency: transitive - description: - name: archive - sha256: "80e5141fafcb3361653ce308776cfd7d45e6e9fbb429e14eec571382c0c5fecb" - url: "https://pub.dev" - source: hosted - version: "3.3.2" async: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" boolean_selector: dependency: transitive description: @@ -29,10 +21,10 @@ packages: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" clock: dependency: transitive description: @@ -45,18 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.0" - crypto: - dependency: transitive - description: - name: crypto - sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 - url: "https://pub.dev" - source: hosted - version: "3.0.2" + version: "1.18.0" espresso: dependency: "direct dev" description: @@ -77,10 +61,10 @@ packages: dependency: transitive description: name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "7.0.0" flutter: dependency: "direct main" description: flutter @@ -107,63 +91,79 @@ packages: path: ".." relative: true source: path - version: "12.7.0" - js: + version: "13.0.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + url: "https://pub.dev" + source: hosted + version: "10.0.0" + leak_tracker_flutter_testing: dependency: transitive description: - name: js - sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + name: leak_tracker_flutter_testing + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 url: "https://pub.dev" source: hosted - version: "0.6.5" + version: "2.0.1" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + url: "https://pub.dev" + source: hosted + version: "2.0.1" matcher: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.11.0" path: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.9.0" platform: dependency: transitive description: name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.4" process: dependency: transitive description: name: process - sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" + sha256: "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32" url: "https://pub.dev" source: hosted - version: "4.2.4" + version: "5.0.2" sky_engine: dependency: transitive description: flutter @@ -173,26 +173,26 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -221,18 +221,10 @@ packages: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 - url: "https://pub.dev" - source: hosted - version: "0.4.16" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "0.6.1" vector_math: dependency: transitive description: @@ -245,18 +237,18 @@ packages: dependency: transitive description: name: vm_service - sha256: e7fb6c2282f7631712b69c19d1bff82f3767eea33a2321c14fa59ad67ea391c7 + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 url: "https://pub.dev" source: hosted - version: "9.4.0" + version: "13.0.0" webdriver: dependency: transitive description: name: webdriver - sha256: ef67178f0cc7e32c1494645b11639dd1335f1d18814aa8435113a92e9ef9d841 + sha256: "003d7da9519e1e5f329422b36c4dcdf18d7d2978d1ba099ea4e45ba490ed845e" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.3" sdks: - dart: ">=2.18.0 <3.0.0" + dart: ">=3.2.0-0 <4.0.0" flutter: ">=2.10.0" diff --git a/lib/src/modules/apm.dart b/lib/src/modules/apm.dart index 6ade70fa9..58b27c082 100644 --- a/lib/src/modules/apm.dart +++ b/lib/src/modules/apm.dart @@ -107,7 +107,10 @@ class APM { /// To remove an attribute, set its [value] to null. Attributes cannot be added or /// modified after an AppFlow has concluded. static Future setFlowAttribute( - String name, String key, String? value) async { + String name, + String key, + String? value, + ) async { return _host.setFlowAttribute(name, key, value); } diff --git a/pigeons/session_replay.api.dart b/pigeons/session_replay.api.dart index 1d4f01821..d9253289d 100644 --- a/pigeons/session_replay.api.dart +++ b/pigeons/session_replay.api.dart @@ -8,6 +8,4 @@ abstract class SessionReplayHostApi { void setUserStepsEnabled(bool isEnabled); @async String getSessionReplayLink(); - - } diff --git a/test/apm_test.dart b/test/apm_test.dart index de4d97c49..8551c0c82 100644 --- a/test/apm_test.dart +++ b/test/apm_test.dart @@ -66,6 +66,7 @@ void main() { when(mHost.startExecutionTrace(id.toString(), name)) .thenAnswer((_) async => id.toString()); + // ignore: deprecated_member_use_from_same_package final trace = await APM.startExecutionTrace(name); expect(trace.id, id.toString()); @@ -80,6 +81,7 @@ void main() { const key = "attr-key"; const attribute = "Trace Attribute"; + // ignore: deprecated_member_use_from_same_package await APM.setExecutionTraceAttribute(id, key, attribute); verify( @@ -90,6 +92,7 @@ void main() { test('[endExecutionTrace] should call host method', () async { final id = DateTime.now().toString(); + // ignore: deprecated_member_use_from_same_package await APM.endExecutionTrace(id); verify( @@ -99,6 +102,7 @@ void main() { test('[startFlow] should call host method', () async { const flowName = "flow-name"; + await APM.startFlow(flowName); verify( mHost.startFlow(flowName), diff --git a/test/session_replay_test.dart b/test/session_replay_test.dart index 54695e954..8c717f72e 100644 --- a/test/session_replay_test.dart +++ b/test/session_replay_test.dart @@ -47,7 +47,6 @@ void main() { ).called(1); }); - test('[setUserStepsEnabled] should call host method', () async { const isEnabled = true; await SessionReplay.setUserStepsEnabled(isEnabled); @@ -61,7 +60,7 @@ void main() { const link = 'link'; when(mHost.getSessionReplayLink()).thenAnswer((_) async => link); - final result= await SessionReplay.getSessionReplayLink(); + final result = await SessionReplay.getSessionReplayLink(); expect(result, link); verify( mHost.getSessionReplayLink(), diff --git a/test/trace_test.dart b/test/trace_test.dart index 3f06d1cbb..2415420be 100644 --- a/test/trace_test.dart +++ b/test/trace_test.dart @@ -25,6 +25,7 @@ void main() { }); test('[end] should call host method', () async { + // ignore: deprecated_member_use_from_same_package trace.end(); verify( @@ -35,6 +36,7 @@ void main() { test('[setAttribute] should call host method', () async { const key = "attr-key"; const attribute = "Trace Attribute"; + // ignore: deprecated_member_use_from_same_package trace.setAttribute(key, attribute); verify( From aaca54eb00bb254833e9e73e6e1e5de04288eb13 Mon Sep 17 00:00:00 2001 From: ahmed alaa <154802748+ahmedAlaaInstabug@users.noreply.github.com> Date: Mon, 29 Apr 2024 17:42:45 +0300 Subject: [PATCH 19/19] Release: 13.0.0 (#462) * release:v 13.0.0 * release:v 13.0.0 * release:v 13.0.0 * Update CHANGELOG.md Co-authored-by: Ahmed Mahmoud <68241710+a7medev@users.noreply.github.com> --------- Co-authored-by: Ahmed Mahmoud <68241710+a7medev@users.noreply.github.com> --- CHANGELOG.md | 2 +- android/build.gradle | 2 +- e2e/Utils/CaptainTest.cs | 2 +- example/ios/Podfile.lock | 6 +++--- ios/instabug_flutter.podspec | 2 +- pubspec.yaml | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c1ce6718..cebed1910 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [Unreleased](https://github.com/Instabug/Instabug-React-Native/compare/v12.7.0...dev) +## [13.0.0](https://github.com/Instabug/Instabug-React-Native/compare/v12.7.0...dev) (April 29, 2024) ### Added diff --git a/android/build.gradle b/android/build.gradle index 6587271de..9afbfed05 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ group 'com.instabug.flutter' -version '12.7.0' +version '13.0.0' buildscript { repositories { diff --git a/e2e/Utils/CaptainTest.cs b/e2e/Utils/CaptainTest.cs index 6592dceca..dbab7e912 100644 --- a/e2e/Utils/CaptainTest.cs +++ b/e2e/Utils/CaptainTest.cs @@ -9,7 +9,7 @@ public class CaptainTest : IDisposable { AndroidApp = Path.GetFullPath("../../../../example/build/app/outputs/flutter-apk/app-debug.apk"), AndroidAppId = "com.instabug.flutter.example", - AndroidVersion = "14", + AndroidVersion = "13", IosApp = Path.GetFullPath("../../../../example/build/ios/iphonesimulator/Runner.app"), IosAppId = "com.instabug.InstabugSample", IosVersion = "17.2", diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index abac8f8a3..4a9cac97e 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,7 +1,7 @@ PODS: - Flutter (1.0.0) - Instabug (13.0.0) - - instabug_flutter (12.7.0): + - instabug_flutter (13.0.0): - Flutter - Instabug (= 13.0.0) - OCMock (3.6) @@ -25,9 +25,9 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 Instabug: fa52de4a6cac26cde0a60ec5e0540f2461a06fe2 - instabug_flutter: c8293ec7ad7ffe049c743a0057601838b8af505d + instabug_flutter: b80c4b8748d1da660a8f0cc0b2e5f4375898761c OCMock: 5ea90566be239f179ba766fd9fbae5885040b992 -PODFILE CHECKSUM: 4de1907d67185ba01b9d9c952bfb1b2c3b10d282 +PODFILE CHECKSUM: 637e800c0a0982493b68adb612d2dd60c15c8e5c COCOAPODS: 1.13.0 diff --git a/ios/instabug_flutter.podspec b/ios/instabug_flutter.podspec index 4cecf2e83..2f54e05da 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 = '12.7.0' + s.version = '13.0.0' s.summary = 'Flutter plugin for integrating the Instabug SDK.' s.author = 'Instabug' s.homepage = 'https://www.instabug.com/platforms/flutter' diff --git a/pubspec.yaml b/pubspec.yaml index 6bdcc3e1b..db1b25f92 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: instabug_flutter -version: 12.7.0 +version: 13.0.0 description: >- Instabug empowers mobile teams to monitor, prioritize, and debug performance and stability issues throughout the app development lifecycle.