Skip to content

Commit

Permalink
Merge pull request #29 from ggiordan/incorporate_updates
Browse files Browse the repository at this point in the history
fix: Fix build for Android, make work on iOS-17
  • Loading branch information
fonkamloic authored Jul 15, 2024
2 parents 522b413 + c7e21dc commit 8f2be51
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
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

0 comments on commit 8f2be51

Please sign in to comment.