Web Analytics
Skip to main content

registerWithBlurView

Activate screenguard with a blurred effect view after captured.

Blurview on Android using Blurry.

v2.0.0+ Requirement

You must call initSettings() before using this function.

Parameters

Accepted a JS object with following parameters:

NameRequiredTypeDefault valueDescription
radiusYesnumberBlur radius value in range [15, 50]. Throws warning if < 15 or > 50, exception if < 1 or NaN
timeAfterResumeNonumber1000⚠️ Removed in v2.0.0 - Use initSettings() instead

v2.0.0 Migration: In v1.x, timeAfterResume was passed directly to registerWithBlurView(). Starting from v2.0.0, set it in initSettings() instead.

Blur Radius Recommendation

Set blur radius smaller than 15 won't help much, as content still looks very clear and easy to read. Same with bigger than 50 but content will be shrunk and vanished inside the view, blurring is meaningless. So, between 15 and 50 is recommended.

Example code

import ScreenGuardModule from 'react-native-screenguard';

// Initialize first (required in v2.0.0+)
await ScreenGuardModule.initSettings({
displayScreenGuardOverlay: true,
timeAfterResume: 2000,
});

// Activate with blur effect
await ScreenGuardModule.registerWithBlurView({
radius: 35,
});
Android Note

On Android, if displayScreenguardOverlayAndroid is set to false in initSettings(), calling registerWithBlurView() will automatically switch to registerWithoutEffect() and show a warning.

Demo

iOS

Android