Skip to content
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

fix: Fix build for Android, make work on iOS-17 #29

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
.buildlog/
.history
.svn/
.vscode/*
migrate_working_dir/

# fvm related
.fvmrc

# IntelliJ related
*.iml
*.ipr
Expand All @@ -28,3 +32,6 @@ migrate_working_dir/
.dart_tool/
.packages
build/

# FVM Version Cache
.fvm/
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@ Updated readme and added sample usage.

## 0.0.1+6

- Removed the non implemented override functions in android life-cycle
- Removed the non implemented override functions in android life-cycle

## 0.0.1+7

- Set the namespace for android
- Specify a more current version of ScreenProtectorKit. This resolves iOS17 issues.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ If you want to prevent user from taking screenshot or recording of your app. You

```dart
class _MyHomePageState extends State<MyHomePage> with WidgetsBindingObserver {
final _noScreenshot = NoScreenshot();
final _noScreenshot = NoScreenshot.instance;

AppLifecycleState? _notification;
@override
Expand Down
2 changes: 2 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {

namespace "com.flutterplaza.no_screenshot"
compileSdkVersion 31

compileOptions {
Expand Down
2 changes: 1 addition & 1 deletion ios/no_screenshot.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ A new Flutter plugin project.
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
s.dependency 'ScreenProtectorKit', '~> 1.2.0'
s.dependency 'ScreenProtectorKit', '~> 1.3.*'
s.platform = :ios, '10.0'

# Flutter.framework does not contain a i386 slice.
Expand Down
3 changes: 3 additions & 0 deletions lib/no_screenshot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ class NoScreenshot implements NoScreenshotPlatform {
final _instancePlatform = NoScreenshotPlatform.instance;
NoScreenshot._();

@Deprecated("Using this may cause issue\nUse instance directly\ne.g: 'NoScreenshot.instance.screenshotOff()'")
NoScreenshot();

/// Made `NoScreenshot` class a singleton
static NoScreenshot get instance => NoScreenshot._();

Expand Down
Loading