Explore Library
React NativeSecurity Best Practices

63 items

1

Protecting Data at Rest with Encryption

Slides / Video
2

Handling Runtime Permissions Securely

Slides / Video
3

Detecting Jailbroken/Rooted Devices

Slides / Video
4

Token Lifecycle: Expiry, Refresh & Revocation

Slides / Video
5

Safe Deep Link Handling & Validation

Slides / Video
6

Securing WebView & JS Bridge

Slides / Video
7

Preventing Injection in WebView

Slides / Video
8

Validating & Sanitizing User Input

Slides / Video
9

Certificate Pinning Against MITM

Slides / Video
10

Your JS Bundle Is Not Secret

Slides / Video
11

Managing Secrets with Env Variables

Slides / Video
12

Never Hardcode Secrets in the Bundle

Slides / Video
13

Auditing Dependencies for Vulnerabilities

Slides / Video
14

Parsing JSON Without eval

Code Quiz
15

WebView Origin Allowlist

Code Quiz
16

Blocking Screenshots on Android

Code Quiz
17

Blur Overlay in App Switcher

Code Quiz
18

Root/Jailbreak Detection Check

Code Quiz
19

Gating Access with Biometrics

Code Quiz
20

Clearing Data on Logout

Code Quiz
21

Storing Auth Tokens Securely

Code Quiz
22

Opening URLs Safely

Code Quiz
23

Trusting Deep Link Params

Code Quiz
24

Sanitizing User Input

Code Quiz
25

iOS App Transport Security Setup

Code Quiz
26

Blocking Android Cleartext Traffic

Code Quiz
27

Certificate Pinning Configuration

Code Quiz
28

Avoiding Hardcoded Secrets

Flashcard
29

Enforcing HTTPS and TLS

Flashcard
30

SSL/Certificate Pinning

Flashcard
31

App Transport Security (iOS)

Flashcard
32

Clipboard Security

Flashcard
33

Input Validation and Sanitization

Flashcard
34

Securing WebView Usage

Flashcard
35

Deep Link Validation

Flashcard
36

Preventing Log Data Leakage

Flashcard
37

Biometric Authentication

Flashcard
38

Dependency Vulnerability Scanning

Flashcard
39

Securing OTA Updates

Flashcard
40

Encrypting Data at Rest

Flashcard
41

Preventing Screen Capture

Flashcard
42

Detecting Rooted/Jailbroken Devices

Flashcard
43

Storing an API Secret with react-native-config

Code Quiz
44

Logging During a Login Request

Code Quiz
45

Handling a Redirect from a Deep Link

Code Quiz
46

Verifying an OTA Update Signature

Code Quiz
47

Secure Token Handling

Quiz
48

Preventing Injection in WebViews

Quiz
49

Auditing Third-Party Dependencies

Quiz
50

Hardcoding API Keys in the Bundle

Quiz
51

Disabling Debugging in Production

Quiz
52

Securing Over-the-Air Updates

Quiz
53

Validating User Input

Quiz
54

Jailbreak / Root Detection

Quiz
55

Clipboard Security

Quiz
56

Screen Capture Protection

Quiz
57

Secure Deep Link Validation

Quiz
58

Biometric Authentication

Quiz
59

The JS Bundle Can Be Reverse-Engineered

Quiz
60

WebView Security Configuration

Quiz
61

Code Obfuscation and Hardening

Quiz
62

Preventing Sensitive Data in Logs

Quiz
63

SSL / Certificate Pinning

Quiz
Code QuizIntermediate

Blur Overlay in App Switcher

Finding why a privacy overlay never hides sensitive content in the background.

Codejavascript
import { AppState } from 'react-native';

function usePrivacyOverlay(setBlurred) {
  useEffect(() => {
    const sub = AppState.addEventListener('change', (state) => {
      if (state === 'active') {
        setBlurred(true);
      } else {
        setBlurred(false);
      }
    });
    return () => sub.remove();
  }, []);
}

What is the bug in this app-switcher privacy code?