expo-screen-capture 7.1.5-canary-20250612-338ef55 → 7.2.0-canary-20250613-b29d676-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/android/build.gradle +2 -2
- package/build/ScreenCapture.d.ts +9 -0
- package/build/ScreenCapture.d.ts.map +1 -1
- package/build/ScreenCapture.js +17 -0
- package/build/ScreenCapture.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/{7.1.5-canary-20250612-338ef55/expo.modules.screencapture-7.1.5-canary-20250612-338ef55.module → 7.2.0-canary-20250613-b29d676-1/expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1.module} +7 -7
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/7.2.0-canary-20250613-b29d676-1/expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/7.2.0-canary-20250613-b29d676-1/expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/7.2.0-canary-20250613-b29d676-1/expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/7.2.0-canary-20250613-b29d676-1/expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/{7.1.5-canary-20250612-338ef55/expo.modules.screencapture-7.1.5-canary-20250612-338ef55.pom → 7.2.0-canary-20250613-b29d676-1/expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1.pom} +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/7.2.0-canary-20250613-b29d676-1/expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/7.2.0-canary-20250613-b29d676-1/expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/7.2.0-canary-20250613-b29d676-1/expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/7.2.0-canary-20250613-b29d676-1/expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1.pom.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/maven-metadata.xml +4 -4
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/maven-metadata.xml.sha512 +1 -1
- package/package.json +3 -3
- package/src/ScreenCapture.ts +19 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/7.1.5-canary-20250612-338ef55/expo.modules.screencapture-7.1.5-canary-20250612-338ef55.module.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/7.1.5-canary-20250612-338ef55/expo.modules.screencapture-7.1.5-canary-20250612-338ef55.module.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/7.1.5-canary-20250612-338ef55/expo.modules.screencapture-7.1.5-canary-20250612-338ef55.module.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/7.1.5-canary-20250612-338ef55/expo.modules.screencapture-7.1.5-canary-20250612-338ef55.module.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/7.1.5-canary-20250612-338ef55/expo.modules.screencapture-7.1.5-canary-20250612-338ef55.pom.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/7.1.5-canary-20250612-338ef55/expo.modules.screencapture-7.1.5-canary-20250612-338ef55.pom.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/7.1.5-canary-20250612-338ef55/expo.modules.screencapture-7.1.5-canary-20250612-338ef55.pom.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/7.1.5-canary-20250612-338ef55/expo.modules.screencapture-7.1.5-canary-20250612-338ef55.pom.sha512 +0 -1
- /package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/{7.1.5-canary-20250612-338ef55/expo.modules.screencapture-7.1.5-canary-20250612-338ef55-sources.jar → 7.2.0-canary-20250613-b29d676-1/expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1-sources.jar} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/{7.1.5-canary-20250612-338ef55/expo.modules.screencapture-7.1.5-canary-20250612-338ef55-sources.jar.md5 → 7.2.0-canary-20250613-b29d676-1/expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1-sources.jar.md5} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/{7.1.5-canary-20250612-338ef55/expo.modules.screencapture-7.1.5-canary-20250612-338ef55-sources.jar.sha1 → 7.2.0-canary-20250613-b29d676-1/expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1-sources.jar.sha1} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/{7.1.5-canary-20250612-338ef55/expo.modules.screencapture-7.1.5-canary-20250612-338ef55-sources.jar.sha256 → 7.2.0-canary-20250613-b29d676-1/expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1-sources.jar.sha256} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/{7.1.5-canary-20250612-338ef55/expo.modules.screencapture-7.1.5-canary-20250612-338ef55-sources.jar.sha512 → 7.2.0-canary-20250613-b29d676-1/expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1-sources.jar.sha512} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/{7.1.5-canary-20250612-338ef55/expo.modules.screencapture-7.1.5-canary-20250612-338ef55.aar → 7.2.0-canary-20250613-b29d676-1/expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1.aar} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/{7.1.5-canary-20250612-338ef55/expo.modules.screencapture-7.1.5-canary-20250612-338ef55.aar.md5 → 7.2.0-canary-20250613-b29d676-1/expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1.aar.md5} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/{7.1.5-canary-20250612-338ef55/expo.modules.screencapture-7.1.5-canary-20250612-338ef55.aar.sha1 → 7.2.0-canary-20250613-b29d676-1/expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1.aar.sha1} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/{7.1.5-canary-20250612-338ef55/expo.modules.screencapture-7.1.5-canary-20250612-338ef55.aar.sha256 → 7.2.0-canary-20250613-b29d676-1/expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1.aar.sha256} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/{7.1.5-canary-20250612-338ef55/expo.modules.screencapture-7.1.5-canary-20250612-338ef55.aar.sha512 → 7.2.0-canary-20250613-b29d676-1/expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1.aar.sha512} +0 -0
package/CHANGELOG.md
CHANGED
package/android/build.gradle
CHANGED
|
@@ -4,13 +4,13 @@ plugins {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
group = 'host.exp.exponent'
|
|
7
|
-
version = '7.
|
|
7
|
+
version = '7.2.0-canary-20250613-b29d676-1'
|
|
8
8
|
|
|
9
9
|
android {
|
|
10
10
|
namespace "expo.modules.screencapture"
|
|
11
11
|
defaultConfig {
|
|
12
12
|
versionCode 7
|
|
13
|
-
versionName '7.
|
|
13
|
+
versionName '7.2.0-canary-20250613-b29d676-1'
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
package/build/ScreenCapture.d.ts
CHANGED
|
@@ -74,6 +74,15 @@ export declare function addScreenshotListener(listener: () => void): EventSubscr
|
|
|
74
74
|
* ```
|
|
75
75
|
*/
|
|
76
76
|
export declare function removeScreenshotListener(subscription: EventSubscription): void;
|
|
77
|
+
/**
|
|
78
|
+
* A React hook that listens for screenshots taken while the component is mounted.
|
|
79
|
+
*
|
|
80
|
+
* @param listener A function that will be called whenever a screenshot is detected.
|
|
81
|
+
*
|
|
82
|
+
* This hook automatically starts listening when the component mounts, and stops
|
|
83
|
+
* listening when the component unmounts.
|
|
84
|
+
*/
|
|
85
|
+
export declare function useScreenshotListener(listener: () => void): void;
|
|
77
86
|
/**
|
|
78
87
|
* Checks user's permissions for detecting when a screenshot is taken.
|
|
79
88
|
* > Only Android requires additional permissions to detect screenshots. On iOS devices, this method will always resolve to a `granted` permission response.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenCapture.d.ts","sourceRoot":"","sources":["../src/ScreenCapture.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAClB,gBAAgB,EAEhB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAU3B;;;;;GAKG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,CAEzD;AAGD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,yBAAyB,CAAC,GAAG,GAAE,MAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAStF;AAGD;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAAC,GAAG,GAAE,MAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CASpF;AAGD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,GAAE,MAAkB,GAAG,IAAI,CAQrE;AAGD;;;;;;;;;;;;;;GAcG;AACH,w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AAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,IAAI,QAQzD;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAKvE;AAED;;;;KAIK;AACL,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAK3E;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,4JAGzB,CAAC;AASH,OAAO,EACL,iBAAiB,IAAI,YAAY,EACjC,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,GACtB,CAAC"}
|
package/build/ScreenCapture.js
CHANGED
|
@@ -113,6 +113,23 @@ export function addScreenshotListener(listener) {
|
|
|
113
113
|
export function removeScreenshotListener(subscription) {
|
|
114
114
|
subscription.remove();
|
|
115
115
|
}
|
|
116
|
+
// @needsAudit
|
|
117
|
+
/**
|
|
118
|
+
* A React hook that listens for screenshots taken while the component is mounted.
|
|
119
|
+
*
|
|
120
|
+
* @param listener A function that will be called whenever a screenshot is detected.
|
|
121
|
+
*
|
|
122
|
+
* This hook automatically starts listening when the component mounts, and stops
|
|
123
|
+
* listening when the component unmounts.
|
|
124
|
+
*/
|
|
125
|
+
export function useScreenshotListener(listener) {
|
|
126
|
+
useEffect(() => {
|
|
127
|
+
const subscription = addScreenshotListener(listener);
|
|
128
|
+
return () => {
|
|
129
|
+
removeScreenshotListener(subscription);
|
|
130
|
+
};
|
|
131
|
+
}, [listener]);
|
|
132
|
+
}
|
|
116
133
|
/**
|
|
117
134
|
* Checks user's permissions for detecting when a screenshot is taken.
|
|
118
135
|
* > Only Android requires additional permissions to detect screenshots. On iOS devices, this method will always resolve to a `granted` permission response.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenCapture.js","sourceRoot":"","sources":["../src/ScreenCapture.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAEnB,gBAAgB,EAChB,oBAAoB,GAGrB,MAAM,mBAAmB,CAAC;AAC3B,OAA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issionResponse,\n PermissionStatus,\n createPermissionHook,\n PermissionHookOptions,\n EventSubscription,\n} from 'expo-modules-core';\nimport { useEffect } from 'react';\n\nimport ExpoScreenCapture from './ExpoScreenCapture';\n\nconst activeTags: Set<string> = new Set();\n\nconst onScreenshotEventName = 'onScreenshot';\n\n// @needsAudit\n/**\n * Returns whether the Screen Capture API is available on the current device.\n *\n * @returns A promise that resolves to a `boolean` indicating whether the Screen Capture API is available on the current\n * device.\n */\nexport async function isAvailableAsync(): Promise<boolean> {\n return !!ExpoScreenCapture.preventScreenCapture && !!ExpoScreenCapture.allowScreenCapture;\n}\n\n// @needsAudit\n/**\n * Prevents screenshots and screen recordings until `allowScreenCaptureAsync` is called or the app is restarted. If you are\n * already preventing screen capture, this method does nothing (unless you pass a new and unique `key`).\n *\n * > On iOS, this will only prevent screen recordings, and is only available on iOS 11 and newer. On older\n * iOS versions, this method does nothing.\n *\n * @param key Optional. If provided, this will help prevent multiple instances of the `preventScreenCaptureAsync`\n * and `allowScreenCaptureAsync` methods (and `usePreventScreenCapture` hook) from conflicting with each other.\n * When using multiple keys, you'll have to re-allow each one in order to re-enable screen capturing.\n *\n * @platform android\n * @platform ios 11+\n */\nexport async function preventScreenCaptureAsync(key: string = 'default'): Promise<void> {\n if (!ExpoScreenCapture.preventScreenCapture) {\n throw new UnavailabilityError('ScreenCapture', 'preventScreenCaptureAsync');\n }\n\n if (!activeTags.has(key)) {\n activeTags.add(key);\n await ExpoScreenCapture.preventScreenCapture();\n }\n}\n\n// @needsAudit\n/**\n * Re-allows the user to screen record or screenshot your app. If you haven't called\n * `preventScreenCapture()` yet, this method does nothing.\n *\n * @param key This will prevent multiple instances of the `preventScreenCaptureAsync` and\n * `allowScreenCaptureAsync` methods from conflicting with each other. If provided, the value must\n * be the same as the key passed to `preventScreenCaptureAsync` in order to re-enable screen\n * capturing.\n */\nexport async function allowScreenCaptureAsync(key: string = 'default'): Promise<void> {\n if (!ExpoScreenCapture.preventScreenCapture) {\n throw new UnavailabilityError('ScreenCapture', 'allowScreenCaptureAsync');\n }\n\n activeTags.delete(key);\n if (activeTags.size === 0) {\n await ExpoScreenCapture.allowScreenCapture();\n }\n}\n\n// @needsAudit\n/**\n * A React hook to prevent screen capturing for as long as the owner component is mounted.\n *\n * @param key If provided, this will prevent multiple instances of this hook or the\n * `preventScreenCaptureAsync` and `allowScreenCaptureAsync` methods from conflicting with each other.\n * This argument is useful if you have multiple active components using the `allowScreenCaptureAsync`\n * hook.\n */\nexport function usePreventScreenCapture(key: string = 'default'): void {\n useEffect(() => {\n preventScreenCaptureAsync(key);\n\n return () => {\n allowScreenCaptureAsync(key);\n };\n }, [key]);\n}\n\n// @needsAudit\n/**\n * Adds a listener that will fire whenever the user takes a screenshot while the app is foregrounded.\n *\n * Permission requirements for this method depend on your device’s Android version:\n * - **Before Android 13**: Requires `READ_EXTERNAL_STORAGE`.\n * - **Android 13**: Switches to `READ_MEDIA_IMAGES`.\n * - **Post-Android 13**: No additional permissions required.\n * You can request the appropriate permissions by using [`MediaLibrary.requestPermissionsAsync()`](./media-library/#medialibraryrequestpermissionsasync).\n *\n * @param listener The function that will be executed when the user takes a screenshot.\n * This function accepts no arguments.\n *\n * @return A `Subscription` object that you can use to unregister the listener, either by calling\n * `remove()` or passing it to `removeScreenshotListener`.\n */\nexport function addScreenshotListener(listener: () => void): EventSubscription {\n return ExpoScreenCapture.addListener(onScreenshotEventName, listener);\n}\n\n// @needsAudit\n/**\n * Removes the subscription you provide, so that you are no longer listening for screenshots.\n * You can also call `remove()` on that `Subscription` object.\n *\n * @param subscription Subscription returned by `addScreenshotListener`.\n *\n * @example\n * ```ts\n * let mySubscription = addScreenshotListener(() => {\n * console.log(\"You took a screenshot!\");\n * });\n * ...\n * mySubscription.remove();\n * // OR\n * removeScreenshotListener(mySubscription);\n * ```\n */\nexport function removeScreenshotListener(subscription: EventSubscription) {\n subscription.remove();\n}\n\n/**\n * Checks user's permissions for detecting when a screenshot is taken.\n * > Only Android requires additional permissions to detect screenshots. On iOS devices, this method will always resolve to a `granted` permission response.\n * @return A promise that resolves to a [`PermissionResponse`](#permissionresponse) object.\n */\nexport async function getPermissionsAsync(): Promise<PermissionResponse> {\n if (ExpoScreenCapture.getPermissionsAsync) {\n return ExpoScreenCapture.getPermissionsAsync();\n }\n return defaultPermissionsResponse;\n}\n\n/**\n * Asks the user to grant permissions necessary for detecting when a screenshot is taken.\n * > Only Android requires additional permissions to detect screenshots. On iOS devices, this method will always resolve to a `granted` permission response.\n * @return A promise that resolves to a [`PermissionResponse`](#permissionresponse) object.\n * */\nexport async function requestPermissionsAsync(): Promise<PermissionResponse> {\n if (ExpoScreenCapture.requestPermissionsAsync) {\n return ExpoScreenCapture.requestPermissionsAsync();\n }\n return defaultPermissionsResponse;\n}\n\n/**\n * Check or request permissions necessary for detecting when a screenshot is taken.\n * This uses both [`requestPermissionsAsync`](#screencapturerequestpermissionsasync) and [`getPermissionsAsync`](#screencapturegetpermissionsasync) to interact with the permissions.\n *\n * @example\n * ```js\n * const [status, requestPermission] = ScreenCapture.usePermissions();\n * ```\n */\nexport const usePermissions = createPermissionHook({\n getMethod: getPermissionsAsync,\n requestMethod: requestPermissionsAsync,\n});\n\nconst defaultPermissionsResponse: PermissionResponse = {\n granted: true,\n expires: 'never',\n canAskAgain: true,\n status: PermissionStatus.GRANTED,\n};\n\nexport {\n EventSubscription as Subscription,\n PermissionResponse,\n PermissionStatus,\n PermissionHookOptions,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"ScreenCapture.js","sourceRoot":"","sources":["../src/ScreenCapture.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAEnB,gBAAgB,EAChB,oBAAoB,GAGrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,MAAM,UAAU,GAAgB,IAAI,GAAG,EAAE,CAAC;AAE1C,MAAM,qBAAqB,GAAG,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AAW,EAAE,IAAI;IACjB,MAAM,EAAE,gBAAgB,CAAC,OAAO;CACjC,CAAC;AAEF,OAAO,EAGL,gBAAgB,GAEjB,CAAC","sourcesContent":["import {\n UnavailabilityError,\n PermissionResponse,\n PermissionStatus,\n createPermissionHook,\n PermissionHookOptions,\n EventSubscription,\n} from 'expo-modules-core';\nimport { useEffect } from 'react';\n\nimport ExpoScreenCapture from './ExpoScreenCapture';\n\nconst activeTags: Set<string> = new Set();\n\nconst onScreenshotEventName = 'onScreenshot';\n\n// @needsAudit\n/**\n * Returns whether the Screen Capture API is available on the current device.\n *\n * @returns A promise that resolves to a `boolean` indicating whether the Screen Capture API is available on the current\n * device.\n */\nexport async function isAvailableAsync(): Promise<boolean> {\n return !!ExpoScreenCapture.preventScreenCapture && !!ExpoScreenCapture.allowScreenCapture;\n}\n\n// @needsAudit\n/**\n * Prevents screenshots and screen recordings until `allowScreenCaptureAsync` is called or the app is restarted. If you are\n * already preventing screen capture, this method does nothing (unless you pass a new and unique `key`).\n *\n * > On iOS, this will only prevent screen recordings, and is only available on iOS 11 and newer. On older\n * iOS versions, this method does nothing.\n *\n * @param key Optional. If provided, this will help prevent multiple instances of the `preventScreenCaptureAsync`\n * and `allowScreenCaptureAsync` methods (and `usePreventScreenCapture` hook) from conflicting with each other.\n * When using multiple keys, you'll have to re-allow each one in order to re-enable screen capturing.\n *\n * @platform android\n * @platform ios 11+\n */\nexport async function preventScreenCaptureAsync(key: string = 'default'): Promise<void> {\n if (!ExpoScreenCapture.preventScreenCapture) {\n throw new UnavailabilityError('ScreenCapture', 'preventScreenCaptureAsync');\n }\n\n if (!activeTags.has(key)) {\n activeTags.add(key);\n await ExpoScreenCapture.preventScreenCapture();\n }\n}\n\n// @needsAudit\n/**\n * Re-allows the user to screen record or screenshot your app. If you haven't called\n * `preventScreenCapture()` yet, this method does nothing.\n *\n * @param key This will prevent multiple instances of the `preventScreenCaptureAsync` and\n * `allowScreenCaptureAsync` methods from conflicting with each other. If provided, the value must\n * be the same as the key passed to `preventScreenCaptureAsync` in order to re-enable screen\n * capturing.\n */\nexport async function allowScreenCaptureAsync(key: string = 'default'): Promise<void> {\n if (!ExpoScreenCapture.preventScreenCapture) {\n throw new UnavailabilityError('ScreenCapture', 'allowScreenCaptureAsync');\n }\n\n activeTags.delete(key);\n if (activeTags.size === 0) {\n await ExpoScreenCapture.allowScreenCapture();\n }\n}\n\n// @needsAudit\n/**\n * A React hook to prevent screen capturing for as long as the owner component is mounted.\n *\n * @param key If provided, this will prevent multiple instances of this hook or the\n * `preventScreenCaptureAsync` and `allowScreenCaptureAsync` methods from conflicting with each other.\n * This argument is useful if you have multiple active components using the `allowScreenCaptureAsync`\n * hook.\n */\nexport function usePreventScreenCapture(key: string = 'default'): void {\n useEffect(() => {\n preventScreenCaptureAsync(key);\n\n return () => {\n allowScreenCaptureAsync(key);\n };\n }, [key]);\n}\n\n// @needsAudit\n/**\n * Adds a listener that will fire whenever the user takes a screenshot while the app is foregrounded.\n *\n * Permission requirements for this method depend on your device’s Android version:\n * - **Before Android 13**: Requires `READ_EXTERNAL_STORAGE`.\n * - **Android 13**: Switches to `READ_MEDIA_IMAGES`.\n * - **Post-Android 13**: No additional permissions required.\n * You can request the appropriate permissions by using [`MediaLibrary.requestPermissionsAsync()`](./media-library/#medialibraryrequestpermissionsasync).\n *\n * @param listener The function that will be executed when the user takes a screenshot.\n * This function accepts no arguments.\n *\n * @return A `Subscription` object that you can use to unregister the listener, either by calling\n * `remove()` or passing it to `removeScreenshotListener`.\n */\nexport function addScreenshotListener(listener: () => void): EventSubscription {\n return ExpoScreenCapture.addListener(onScreenshotEventName, listener);\n}\n\n// @needsAudit\n/**\n * Removes the subscription you provide, so that you are no longer listening for screenshots.\n * You can also call `remove()` on that `Subscription` object.\n *\n * @param subscription Subscription returned by `addScreenshotListener`.\n *\n * @example\n * ```ts\n * let mySubscription = addScreenshotListener(() => {\n * console.log(\"You took a screenshot!\");\n * });\n * ...\n * mySubscription.remove();\n * // OR\n * removeScreenshotListener(mySubscription);\n * ```\n */\nexport function removeScreenshotListener(subscription: EventSubscription) {\n subscription.remove();\n}\n\n// @needsAudit\n/**\n * A React hook that listens for screenshots taken while the component is mounted.\n *\n * @param listener A function that will be called whenever a screenshot is detected.\n *\n * This hook automatically starts listening when the component mounts, and stops\n * listening when the component unmounts.\n */\nexport function useScreenshotListener(listener: () => void) {\n useEffect(() => {\n const subscription = addScreenshotListener(listener);\n\n return () => {\n removeScreenshotListener(subscription);\n };\n }, [listener]);\n}\n\n/**\n * Checks user's permissions for detecting when a screenshot is taken.\n * > Only Android requires additional permissions to detect screenshots. On iOS devices, this method will always resolve to a `granted` permission response.\n * @return A promise that resolves to a [`PermissionResponse`](#permissionresponse) object.\n */\nexport async function getPermissionsAsync(): Promise<PermissionResponse> {\n if (ExpoScreenCapture.getPermissionsAsync) {\n return ExpoScreenCapture.getPermissionsAsync();\n }\n return defaultPermissionsResponse;\n}\n\n/**\n * Asks the user to grant permissions necessary for detecting when a screenshot is taken.\n * > Only Android requires additional permissions to detect screenshots. On iOS devices, this method will always resolve to a `granted` permission response.\n * @return A promise that resolves to a [`PermissionResponse`](#permissionresponse) object.\n * */\nexport async function requestPermissionsAsync(): Promise<PermissionResponse> {\n if (ExpoScreenCapture.requestPermissionsAsync) {\n return ExpoScreenCapture.requestPermissionsAsync();\n }\n return defaultPermissionsResponse;\n}\n\n/**\n * Check or request permissions necessary for detecting when a screenshot is taken.\n * This uses both [`requestPermissionsAsync`](#screencapturerequestpermissionsasync) and [`getPermissionsAsync`](#screencapturegetpermissionsasync) to interact with the permissions.\n *\n * @example\n * ```js\n * const [status, requestPermission] = ScreenCapture.usePermissions();\n * ```\n */\nexport const usePermissions = createPermissionHook({\n getMethod: getPermissionsAsync,\n requestMethod: requestPermissionsAsync,\n});\n\nconst defaultPermissionsResponse: PermissionResponse = {\n granted: true,\n expires: 'never',\n canAskAgain: true,\n status: PermissionStatus.GRANTED,\n};\n\nexport {\n EventSubscription as Subscription,\n PermissionResponse,\n PermissionStatus,\n PermissionHookOptions,\n};\n"]}
|
package/expo-module.config.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "host.exp.exponent",
|
|
5
5
|
"module": "expo.modules.screencapture",
|
|
6
|
-
"version": "7.
|
|
6
|
+
"version": "7.2.0-canary-20250613-b29d676-1",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
{
|
|
27
|
-
"name": "expo.modules.screencapture-7.
|
|
28
|
-
"url": "expo.modules.screencapture-7.
|
|
27
|
+
"name": "expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1.aar",
|
|
28
|
+
"url": "expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1.aar",
|
|
29
29
|
"size": 28245,
|
|
30
30
|
"sha512": "5d693f6a83cc09074f42ae55d49f7cccfc0c2e1f024e43d866c285e18f0e37648ff966eb7507567538355f6d9f1b6c7d51f6eb45456dbe191ad41f3ae896f930",
|
|
31
31
|
"sha256": "8a9e3dca21a096209a62e8ce26c3733e57135f9d59a41eb237636ae81c744345",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
],
|
|
61
61
|
"files": [
|
|
62
62
|
{
|
|
63
|
-
"name": "expo.modules.screencapture-7.
|
|
64
|
-
"url": "expo.modules.screencapture-7.
|
|
63
|
+
"name": "expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1.aar",
|
|
64
|
+
"url": "expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1.aar",
|
|
65
65
|
"size": 28245,
|
|
66
66
|
"sha512": "5d693f6a83cc09074f42ae55d49f7cccfc0c2e1f024e43d866c285e18f0e37648ff966eb7507567538355f6d9f1b6c7d51f6eb45456dbe191ad41f3ae896f930",
|
|
67
67
|
"sha256": "8a9e3dca21a096209a62e8ce26c3733e57135f9d59a41eb237636ae81c744345",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
},
|
|
81
81
|
"files": [
|
|
82
82
|
{
|
|
83
|
-
"name": "expo.modules.screencapture-7.
|
|
84
|
-
"url": "expo.modules.screencapture-7.
|
|
83
|
+
"name": "expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1-sources.jar",
|
|
84
|
+
"url": "expo.modules.screencapture-7.2.0-canary-20250613-b29d676-1-sources.jar",
|
|
85
85
|
"size": 3601,
|
|
86
86
|
"sha512": "080676e6818f1d063d27b7b460c49e34d7ebeae5e6a6e4c071840008b10a6beaafe0022467b6f556a1a190b22ae6b04ef87de7e7c2a74364b5af845efa1a6b05",
|
|
87
87
|
"sha256": "d2c5b19e0bb1ad883b35525cdce5c665213505bea5b758f0c0c44b735fc960eb",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
6e82bb959353cecb8f7440c9f201e1c9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
375a260c87546456f786d2fc1897385892446f2f
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
19530766a4f5d9f685a091600dcf82ede229b897375531ddae2c00b9c8b23991
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
125657293cc31823a7fede174f61858f4b1cb89b1314355751d77693cec4c08ab12901243b8396592cf94b2e37d9d7b7a58b47ce8f7cded45d0e70881ac124e6
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>host.exp.exponent</groupId>
|
|
11
11
|
<artifactId>expo.modules.screencapture</artifactId>
|
|
12
|
-
<version>7.
|
|
12
|
+
<version>7.2.0-canary-20250613-b29d676-1</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.screencapture</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7d9f47f0f158b04e43b8c7a4aff24e3f
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5850e0aa38b47f0534e3900d540f04ef4e610d70
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0d25c6749590ec5fc0ed2a1a2076e7a75996058cab50bc8c7e85c19266b45ec1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0e80f676edf265d31d153277903015500420b80b14af1e76354aa5b6748152626a6cb36ac71a0930152ff3647bf3087bd7a9d733c6a985600f5d864e2862703d
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>host.exp.exponent</groupId>
|
|
4
4
|
<artifactId>expo.modules.screencapture</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>7.
|
|
7
|
-
<release>7.
|
|
6
|
+
<latest>7.2.0-canary-20250613-b29d676-1</latest>
|
|
7
|
+
<release>7.2.0-canary-20250613-b29d676-1</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>7.
|
|
9
|
+
<version>7.2.0-canary-20250613-b29d676-1</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20250613142649</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/maven-metadata.xml.md5
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
72cd1ee8e5ebc87e51e897931840877d
|
package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/maven-metadata.xml.sha1
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
6810a5bbb10d6c70f9a264dcc0696d6feb13b734
|
package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/maven-metadata.xml.sha256
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
e81d002c6907873b93c4e6e98d09fe3ce8227732e946eb9c14362c7c6333c3e7
|
package/local-maven-repo/host/exp/exponent/expo.modules.screencapture/maven-metadata.xml.sha512
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
e0e3e773a4203a795c807f4c06b71359fd7ce9b33d3794dac3868e56ac3e5acd545e38713d3b790ade462d387475397b835986697e40f736d631494930e6f3d9
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-screen-capture",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0-canary-20250613-b29d676-1",
|
|
4
4
|
"description": "Protects screens in your app from being captured or recorded, and notifies if a screenshot is taken.",
|
|
5
5
|
"main": "build/ScreenCapture.js",
|
|
6
6
|
"types": "build/ScreenCapture.d.ts",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"dependencies": {},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@testing-library/react-native": "^13.1.0",
|
|
38
|
-
"expo-module-scripts": "4.1.8-canary-
|
|
38
|
+
"expo-module-scripts": "4.1.8-canary-20250613-b29d676-1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"expo": "54.0.0-canary-
|
|
41
|
+
"expo": "54.0.0-canary-20250613-b29d676-1",
|
|
42
42
|
"react": "*"
|
|
43
43
|
}
|
|
44
44
|
}
|
package/src/ScreenCapture.ts
CHANGED
|
@@ -133,6 +133,25 @@ export function removeScreenshotListener(subscription: EventSubscription) {
|
|
|
133
133
|
subscription.remove();
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
// @needsAudit
|
|
137
|
+
/**
|
|
138
|
+
* A React hook that listens for screenshots taken while the component is mounted.
|
|
139
|
+
*
|
|
140
|
+
* @param listener A function that will be called whenever a screenshot is detected.
|
|
141
|
+
*
|
|
142
|
+
* This hook automatically starts listening when the component mounts, and stops
|
|
143
|
+
* listening when the component unmounts.
|
|
144
|
+
*/
|
|
145
|
+
export function useScreenshotListener(listener: () => void) {
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
const subscription = addScreenshotListener(listener);
|
|
148
|
+
|
|
149
|
+
return () => {
|
|
150
|
+
removeScreenshotListener(subscription);
|
|
151
|
+
};
|
|
152
|
+
}, [listener]);
|
|
153
|
+
}
|
|
154
|
+
|
|
136
155
|
/**
|
|
137
156
|
* Checks user's permissions for detecting when a screenshot is taken.
|
|
138
157
|
* > Only Android requires additional permissions to detect screenshots. On iOS devices, this method will always resolve to a `granted` permission response.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1361fb2bf3d421d5deee67d48f0a5685
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
96c3741f0579125b67d9b5b80b3cedd1f0ded53f
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
354e3930a90983e8e3e0c17e65351fce76a3051313a4437835827be6d52243e4
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
745dd0664e60a81ea79b8793bea76537173bd93c64ed0d5707a37dce2006d409111c23788fba491b3a6637062e1fcf022e47ba6e0421606e6bb0e1acf5c7e2ab
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
07265b0bf84e2cae47b5aafcc6ee2f85
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
16cda288f163f3a304a5650585c2760232741fee
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
560fbff7ca00002a67886d6662391c183328024a8b667965a63d2faa59d894e2
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
532ec8fa6cdc6171864e7af9095f041744b7b1250a61867e0bec50563880ac1725189d9c20f6e95aced443ce3c74d49c5ddf4e8fa05b0dc27205048b64ca026e
|
|
File without changes
|