Skip to content

Refactor: merge private-views package into mono-repo #527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
e0c0fd2
feat: add private view
ahmedAlaaInstabug Oct 2, 2024
c38dead
feat: add private view
ahmedAlaaInstabug Oct 2, 2024
23d3912
Merge remote-tracking branch 'refs/remotes/origin/dev' into feat/priv…
ahmedAlaaInstabug Oct 2, 2024
1af3598
feat: add private view
ahmedAlaaInstabug Oct 2, 2024
0476bcd
feat: add private view
ahmedAlaaInstabug Oct 2, 2024
9b8ec64
feat: add private view
ahmedAlaaInstabug Oct 2, 2024
cedc297
feat: add private view
ahmedAlaaInstabug Oct 7, 2024
59c1ffa
feat: add private view
ahmedAlaaInstabug Oct 9, 2024
f7f8f08
feat: add private view android integration
ahmedAlaaInstabug Oct 10, 2024
c9bb481
feat: add private view android integration
ahmedAlaaInstabug Oct 10, 2024
52bced3
feat: add private view android integration
ahmedAlaaInstabug Oct 10, 2024
d0f334f
fix PR comments
ahmedAlaaInstabug Oct 27, 2024
ae524a2
fix: android test cases
ahmedAlaaInstabug Oct 27, 2024
ddead7f
fix: android test cases
ahmedAlaaInstabug Oct 27, 2024
7414132
fix PR comments
ahmedAlaaInstabug Oct 27, 2024
476c29e
doc:comment why not use const constructor
ahmedAlaaInstabug Oct 31, 2024
5b94581
feat(ios): handle private views (#524)
ahmedAlaaInstabug Oct 31, 2024
6dcdffb
feat: add private view example page (#525)
ahmedAlaaInstabug Oct 31, 2024
a142b7b
init
ahmedAlaaInstabug Nov 2, 2024
92201a1
Merge branch 'refs/heads/refactor/monorepo' into refactor/monorepo-pr…
ahmedAlaaInstabug Nov 2, 2024
422e21f
init
ahmedAlaaInstabug Nov 2, 2024
53abf96
init
ahmedAlaaInstabug Nov 2, 2024
c8b944d
init
ahmedAlaaInstabug Nov 2, 2024
96e128a
init
ahmedAlaaInstabug Nov 2, 2024
38971ab
init
ahmedAlaaInstabug Nov 3, 2024
837e133
add hybrid app
ahmedAlaaInstabug Nov 10, 2024
d157d4e
add hybrid app
ahmedAlaaInstabug Nov 10, 2024
e9d124a
add hybrid app
ahmedAlaaInstabug Nov 10, 2024
a6789c2
add more example in private view oage
ahmedAlaaInstabug Nov 12, 2024
0370666
add more example in private view oage
ahmedAlaaInstabug Nov 12, 2024
5f0af4c
add more example in private view oage
ahmedAlaaInstabug Nov 12, 2024
4dcf75f
chore: add build files
ahmedAlaaInstabug Nov 13, 2024
e4b6c3a
chore: add animation
ahmedAlaaInstabug Nov 14, 2024
89d0de1
fix: private view time
ahmedAlaaInstabug Nov 21, 2024
7763743
fix: private view time
ahmedAlaaInstabug Nov 22, 2024
dc50a5c
Merge remote-tracking branch 'refs/remotes/origin/refactor/monorepo' …
ahmedAlaaInstabug Dec 2, 2024
838a434
chore: update to latest version
ahmedAlaaInstabug Dec 2, 2024
86ba310
chore: update to latest version
ahmedAlaaInstabug Dec 2, 2024
48b1132
chore: update to latest version
ahmedAlaaInstabug Dec 12, 2024
c50bc61
Merge remote-tracking branch 'refs/remotes/origin/refactor/monorepo-p…
ahmedAlaaInstabug Dec 12, 2024
cdb8017
chore: update to latest version
ahmedAlaaInstabug Dec 12, 2024
2215874
chore: update to latest version
ahmedAlaaInstabug Dec 12, 2024
be76a07
chore: update to latest version
ahmedAlaaInstabug Dec 15, 2024
4ac9541
Merge branch 'refs/heads/refactor/monorepo' into refactor/monorepo-pr…
ahmedAlaaInstabug Jan 8, 2025
05fac1f
monorepo
ahmedAlaaInstabug Jan 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,15 @@ jobs:
- run: chmod +x packages/instabug_flutter_modular/release.sh
- run: ./packages/instabug_flutter_modular/release.sh

release_instabug_private_views_plugin:
executor: flutter-executor
steps:
- advanced-checkout/shallow-checkout
- setup_flutter
- run: chmod +x packages/instabug_private_views/release.sh
- run: ./packages/instabug_private_views/release.sh


release_instabug_flutter:
macos:
xcode: 15.2.0
Expand Down Expand Up @@ -454,6 +463,20 @@ workflows:
filters:
branches:
only: master
- hold_release_instabug_private_views_plugin:
type: approval
requires:
- test_flutter-stable
filters:
branches:
only: master
- release_instabug_private_views_plugin:
requires:
- hold_release_instabug_private_views_plugin
- verify_pub
filters:
branches:
only: master
- release_instabug_flutter:
requires:
- hold_release_instabug_flutter
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ android/gradlew.bat
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/Pods/

**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
Expand Down
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ analyzer:
exclude:
- "packages/**/*.g.dart"
- "packages/**/example/**"
- "packages/instabug_private_views/example-hybrid-ios-app/**/**"


linter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class InstabugDioInterceptor extends Interceptor {

var responseBodySize = 0;
if (responseHeaders.containsKey('content-length')) {
responseBodySize = int.parse(responseHeaders['content-length'][0] ?? '0');
// ignore: avoid_dynamic_calls
responseBodySize = int.parse((responseHeaders['content-length'][0]) ?? '0');
} else if (response.data != null) {
responseBodySize = response.data.toString().length;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/instabug_flutter/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ android {
}

dependencies {
api 'com.instabug.library:instabug:14.0.0'
api 'com.instabug.library:instabug:13.4.1.6295791-SNAPSHOT'

testImplementation 'junit:junit:4.13.2'
testImplementation "org.mockito:mockito-inline:3.12.1"
testImplementation "io.mockk:mockk:1.13.13"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.instabug.flutter.modules.RepliesApi;
import com.instabug.flutter.modules.SessionReplayApi;
import com.instabug.flutter.modules.SurveysApi;
import com.instabug.library.internal.crossplatform.InternalCore;

import java.util.concurrent.Callable;

Expand All @@ -35,6 +36,7 @@ public class InstabugFlutterPlugin implements FlutterPlugin, ActivityAware {
@SuppressLint("StaticFieldLeak")
private static Activity activity;


/**
* Embedding v1
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.instabug.library.internal.crossplatform.CoreFeaturesState;
import com.instabug.library.internal.crossplatform.FeaturesStateListener;
import com.instabug.library.internal.crossplatform.InternalCore;
import com.instabug.flutter.util.privateViews.ScreenshotCaptor;
import com.instabug.library.Feature;
import com.instabug.library.Instabug;
import com.instabug.library.InstabugColorTheme;
Expand All @@ -25,9 +26,11 @@
import com.instabug.library.Platform;
import com.instabug.library.ReproConfigurations;
import com.instabug.library.featuresflags.model.IBGFeatureFlag;
import com.instabug.library.internal.crossplatform.InternalCore;
import com.instabug.library.internal.module.InstabugLocale;
import com.instabug.library.invocation.InstabugInvocationEvent;
import com.instabug.library.model.NetworkLog;
import com.instabug.library.screenshot.instacapture.ScreenshotRequest;
import com.instabug.library.ui.onboarding.WelcomeMessage;
import io.flutter.FlutterInjector;
import io.flutter.embedding.engine.loader.FlutterLoader;
Expand Down Expand Up @@ -492,4 +495,24 @@ public Map<String, Boolean> isW3CFeatureFlagsEnabled() {
public void willRedirectToStore() {
Instabug.willRedirectToStore();
}

public static void setScreenshotCaptor(ScreenshotCaptor screenshotCaptor,InternalCore internalCore) {
internalCore._setScreenshotCaptor(new com.instabug.library.screenshot.ScreenshotCaptor() {
@Override
public void capture(@NonNull ScreenshotRequest screenshotRequest) {
screenshotCaptor.capture(new ScreenshotCaptor.CapturingCallback() {
@Override
public void onCapturingFailure(Throwable throwable) {
screenshotRequest.getListener().onCapturingFailure(throwable);
}

@Override
public void onCapturingSuccess(Bitmap bitmap) {
screenshotRequest.getListener().onCapturingSuccess(bitmap);
}
});
}
});
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.instabug.flutter.util.privateViews;

import android.graphics.Bitmap;

public interface ScreenshotCaptor {
public void capture(CapturingCallback listener);

public interface CapturingCallback {
public void onCapturingFailure(Throwable throwable);

public void onCapturingSuccess(Bitmap bitmap);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@
import com.instabug.library.internal.crossplatform.FeaturesStateListener;
import com.instabug.library.internal.crossplatform.InternalCore;
import com.instabug.library.featuresflags.model.IBGFeatureFlag;
import com.instabug.library.internal.crossplatform.InternalCore;
import com.instabug.library.invocation.InstabugInvocationEvent;
import com.instabug.library.model.NetworkLog;
import com.instabug.library.screenshot.ScreenshotCaptor;
import com.instabug.library.ui.onboarding.WelcomeMessage;
import com.instabug.survey.Surveys;
import com.instabug.survey.callbacks.OnShowCallback;
Expand All @@ -72,6 +74,7 @@
import java.util.concurrent.Callable;

import io.flutter.plugin.common.BinaryMessenger;

import kotlin.jvm.functions.Function1;

import org.mockito.Mockito;
Expand Down Expand Up @@ -643,4 +646,12 @@ public void isW3CFeatureFlagsEnabled() {
assertEquals(isW3cCaughtHeaderEnabled, flags.get("isW3cCaughtHeaderEnabled"));

}

@Test
public void testSetScreenshotCaptor() {
InternalCore internalCore = spy(InternalCore.INSTANCE);

InstabugApi.setScreenshotCaptor(any(), internalCore);
verify(internalCore)._setScreenshotCaptor(any(ScreenshotCaptor.class));
}
}
1 change: 1 addition & 0 deletions packages/instabug_flutter/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 34
ndkVersion flutter.ndkVersion
namespace = "com.instabug.flutter.example"

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down
6 changes: 6 additions & 0 deletions packages/instabug_flutter/example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ subprojects {
}
subprojects {
project.evaluationDependsOn(':app')
tasks.withType(Test) {
// Prevent tests in moduleA from running
if (project.name == 'video_player_android') {
exclude '**/*'
}
}
}

tasks.register("clean", Delete) {
Expand Down
Binary file added packages/instabug_flutter/example/assets/img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/instabug_flutter/example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!

pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/feature-flutter-private-views-base/14.0.0/Instabug.podspec'
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

Expand Down
22 changes: 19 additions & 3 deletions packages/instabug_flutter/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,46 @@ PODS:
- instabug_flutter (14.0.0):
- Flutter
- Instabug (= 14.0.0)
- instabug_private_views (0.0.1):
- Flutter
- instabug_flutter
- OCMock (3.6)
- video_player_avfoundation (0.0.1):
- Flutter
- FlutterMacOS

DEPENDENCIES:
- Flutter (from `Flutter`)
- Instabug (from `https://ios-releases.instabug.com/custom/feature-flutter-private-views-base/14.0.0/Instabug.podspec`)
- instabug_flutter (from `.symlinks/plugins/instabug_flutter/ios`)
- instabug_private_views (from `.symlinks/plugins/instabug_private_views/ios`)
- OCMock (= 3.6)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)

SPEC REPOS:
trunk:
- Instabug
- OCMock

EXTERNAL SOURCES:
Flutter:
:path: Flutter
Instabug:
:podspec: https://ios-releases.instabug.com/custom/feature-flutter-private-views-base/14.0.0/Instabug.podspec
instabug_flutter:
:path: ".symlinks/plugins/instabug_flutter/ios"
instabug_private_views:
:path: ".symlinks/plugins/instabug_private_views/ios"
video_player_avfoundation:
:path: ".symlinks/plugins/video_player_avfoundation/darwin"

SPEC CHECKSUMS:
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
Instabug: a0beffc01658773e2fac549845782f8937707dc4
Instabug: 9d2b06afbadfbd4630bc0116dc27d84360ed70b0
instabug_flutter: ff8ab5ff34a476b1d2d887478ec190cda962b973
instabug_private_views: df53ff3f1cc842cb686d43e077099d3b36426a7f
OCMock: 5ea90566be239f179ba766fd9fbae5885040b992
video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3

PODFILE CHECKSUM: 8f7552fd115ace1988c3db54a69e4a123c448f84
PODFILE CHECKSUM: 32bd1b5b0a93d31b74cc581a86b5fa93c1cc923f

COCOAPODS: 1.14.3
4 changes: 4 additions & 0 deletions packages/instabug_flutter/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:instabug_flutter/instabug_flutter.dart';
import 'package:instabug_flutter_example/src/screens/private_view_page.dart';
import 'package:instabug_http_client/instabug_http_client.dart';
import 'package:instabug_flutter_example/src/app_routes.dart';
import 'package:instabug_flutter_example/src/widget/nested_view.dart';
import 'package:instabug_private_views/instabug_private_view.dart';

import 'src/native/instabug_flutter_example_method_channel.dart';
import 'src/widget/instabug_button.dart';
Expand Down Expand Up @@ -56,6 +58,8 @@ void main() {
Zone.current.handleUncaughtError(details.exception, details.stack!);
};

enableInstabugMaskingPrivateViews();

runApp(const MyApp());
},
CrashReporting.reportCrash,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ class _MyHomePageState extends State<MyHomePage> {
BugReporting.setInvocationEvents([InvocationEvent.floatingButton]);
}

void disableInstabug() {
Instabug.setEnabled(false);
}

void setOnDismissCallback() {
BugReporting.setOnDismissCallback((dismissType, reportType) {
showDialog(
Expand Down Expand Up @@ -161,6 +165,16 @@ class _MyHomePageState extends State<MyHomePage> {
);
}

void _navigateToPrivateViewPage() {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const PrivateViewPage(),
settings: const RouteSettings(name: ComplexPage.screenName),
),
);
}

@override
Widget build(BuildContext context) {
return Page(
Expand All @@ -178,6 +192,10 @@ class _MyHomePageState extends State<MyHomePage> {
onPressed: restartInstabug,
text: 'Restart Instabug',
),
InstabugButton(
onPressed: disableInstabug,
text: 'Disable Instabug',
),
const SectionTitle('Primary Color'),
InstabugTextField(
controller: primaryColorController,
Expand Down Expand Up @@ -306,6 +324,10 @@ class _MyHomePageState extends State<MyHomePage> {
onPressed: _navigateToComplex,
text: 'Complex',
),
InstabugButton(
onPressed: _navigateToPrivateViewPage,
text: 'Private views',
),
const SectionTitle('Sessions Replay'),
InstabugButton(
onPressed: getCurrentSessionReplaylink,
Expand Down
Loading