PHPackages                             macrotom/screen-privacy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. macrotom/screen-privacy

ActiveNativephp-plugin[Security](/categories/security)

macrotom/screen-privacy
=======================

Prevent screenshots and screen recordings using native platform protections for NativePHP Mobile

v1.0.0(3mo ago)01↓90.9%MITPHPPHP ^8.2

Since Mar 31Pushed 3mo agoCompare

[ Source](https://github.com/MacroTom/screen-privacy)[ Packagist](https://packagist.org/packages/macrotom/screen-privacy)[ RSS](/packages/macrotom-screen-privacy/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Screen Privacy Plugin for NativePHP Mobile
==========================================

[](#screen-privacy-plugin-for-nativephp-mobile)

Prevent screenshots and screen recordings of sensitive content using native platform protections (FLAG\_SECURE on Android, secure overlay on iOS).

Installation
------------

[](#installation)

```
composer require macrotom/screen-privacy
```

Usage
-----

[](#usage)

### PHP (Livewire/Blade)

[](#php-livewireblade)

```
use MacroTom\ScreenPrivacy\Facades\ScreenPrivacy;

// Initialize screen privacy (registers callbacks on Android 14+)
ScreenPrivacy::init();

// Enable screen privacy protection
ScreenPrivacy::enable();

// Disable screen privacy protection
ScreenPrivacy::disable();

// Check if screen privacy is currently active
$isEnabled = ScreenPrivacy::isEnabled(); // returns bool

// Check if the screen is being recorded (iOS only)
$isRecording = ScreenPrivacy::isRecording(); // returns bool
```

### JavaScript (Vue/React/Inertia)

[](#javascript-vuereactinertia)

```
import { screenPrivacy } from '@macrotom/screen-privacy';

// Initialize on mount
await screenPrivacy.init();

// Enable/disable protection
await screenPrivacy.enable();
await screenPrivacy.disable();

// Check status
const enabled = await screenPrivacy.isEnabled();
const recording = await screenPrivacy.isRecording();
```

Events
------

[](#events)

```
use Native\Mobile\Attributes\OnNative;
use MacroTom\ScreenPrivacy\Events\ScreenCaptureDetected;
use MacroTom\ScreenPrivacy\Events\ScreenRecordingDetected;
use MacroTom\ScreenPrivacy\Events\ScreenPrivacyEnabled;
use MacroTom\ScreenPrivacy\Events\ScreenPrivacyDisabled;

#[OnNative(ScreenCaptureDetected::class)]
public function handleScreenCapture()
{
    // A screenshot attempt was detected
}

#[OnNative(ScreenRecordingDetected::class)]
public function handleScreenRecording(bool $isRecording)
{
    // Screen recording started or stopped
}

#[OnNative(ScreenPrivacyEnabled::class)]
public function handlePrivacyEnabled()
{
    // Screen privacy was enabled
}

#[OnNative(ScreenPrivacyDisabled::class)]
public function handlePrivacyDisabled()
{
    // Screen privacy was disabled
}
```

Platform Behavior
-----------------

[](#platform-behavior)

FeatureAndroidiOSScreenshot blockingFLAG\_SECURE (hardware-level)Secure overlay via UITextFieldScreenshot detectionAndroid 14+ (API 34) callback`userDidTakeScreenshotNotification`Recording detectionNot supported (returns `false`)`UIScreen.isCaptured`Minimum versionAPI 26iOS 13.0Important Notes
---------------

[](#important-notes)

- Call `init()` once during app initialization before using other methods.
- Android uses `FLAG_SECURE` which hardware-blocks all screen captures while enabled.
- iOS detects screenshots after they occur and applies a secure overlay to block recordings.
- Screen recording detection (`isRecording()`) is only available on iOS. On Android it always returns `false`.

License
-------

[](#license)

MIT

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance82

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

91d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8f4f7e17c0286a868ee5b184fbe5b948e0bf4c157736a2389dd1f394b75b20f7?d=identicon)[MacroTom](/maintainers/MacroTom)

---

Top Contributors

[![MacroTom](https://avatars.githubusercontent.com/u/37224358?v=4)](https://github.com/MacroTom "MacroTom (4 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/macrotom-screen-privacy/health.svg)

```
[![Health](https://phpackages.com/badges/macrotom-screen-privacy/health.svg)](https://phpackages.com/packages/macrotom-screen-privacy)
```

###  Alternatives

[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k18.0M138](/packages/mews-purifier)[paragonie/ecc

PHP Elliptic Curve Cryptography library

24772.0k36](/packages/paragonie-ecc)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
