You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -124,161 +124,6 @@ if (permissionStatus === FrameCapture.PermissionStatus.GRANTED) {
124
124
}
125
125
```
126
126
127
-
## API Reference
128
-
129
-
### Permission Management
130
-
131
-
#### `requestPermission()`
132
-
133
-
Requests **MediaProjection permission** (screen capture/screen sharing) from the user. This opens the Android system dialog asking the user to allow screen recording.
134
-
135
-
```typescript
136
-
const status =awaitFrameCapture.requestPermission();
**Note:** This is a runtime permission that must be granted before starting capture. The permission dialog is shown by the Android system, not your app.
144
-
145
-
#### `checkPermission()`
146
-
147
-
Checks if MediaProjection permission (screen capture) has been previously granted without showing the permission dialog.
148
-
149
-
```typescript
150
-
const status =awaitFrameCapture.checkPermission();
151
-
```
152
-
153
-
**Returns:**`Promise<PermissionStatus>`
154
-
155
-
**Note:** Returns `NOT_DETERMINED` if permission was never requested, `GRANTED` if previously granted. MediaProjection permission cannot be checked programmatically on Android, so this only verifies if permission data exists from a previous grant.
156
-
157
-
#### `checkNotificationPermission()`
158
-
159
-
Checks if notification permission is granted (Android 13+).
160
-
161
-
```typescript
162
-
const status =awaitFrameCapture.checkNotificationPermission();
Manually cleans up all temporary frame files stored in the app's cache directory.
239
-
240
-
```typescript
241
-
awaitFrameCapture.cleanupTempFrames();
242
-
```
243
-
244
-
**Returns:**`Promise<void>`
245
-
246
-
**What it does:**
247
-
248
-
- Deletes all frames from the cache directory (`/data/data/[package]/cache/captured_frames/`)
249
-
- Only affects temporary frames (when `saveFrames: false`)
250
-
- Automatically called on app startup
251
-
- Useful for freeing up storage space after processing frames
252
-
253
-
**When to use:**
254
-
255
-
- After uploading frames to a server
256
-
- After processing frames in your app
257
-
- When you want to free up cache storage manually
258
-
259
-
#### `addListener(eventType, callback)`
260
-
261
-
Adds an event listener for capture events.
262
-
263
-
```typescript
264
-
const subscription =FrameCapture.addListener(
265
-
FrameCapture.CaptureEventType.FRAME_CAPTURED,
266
-
(event) => {
267
-
console.log('Frame:', event.filePath);
268
-
}
269
-
);
270
-
271
-
// Remove listener when done
272
-
subscription.remove();
273
-
```
274
-
275
-
**Parameters:**
276
-
277
-
-`eventType`: `CaptureEventType` - Event type to listen for
278
-
-`callback`: `CaptureEventCallback` - Function to call when event is emitted
279
-
280
-
**Returns:**`EventSubscription`
281
-
282
127
## Configuration
283
128
284
129
### CaptureOptions
@@ -906,6 +751,161 @@ if (Platform.Version >= 33) {
906
751
-**Kotlin:** Native Android implementation
907
752
-**TypeScript:** Type-safe JavaScript API
908
753
754
+
## API Reference
755
+
756
+
### Permission Management
757
+
758
+
#### `requestPermission()`
759
+
760
+
Requests **MediaProjection permission** (screen capture/screen sharing) from the user. This opens the Android system dialog asking the user to allow screen recording.
761
+
762
+
```typescript
763
+
const status =awaitFrameCapture.requestPermission();
**Note:** This is a runtime permission that must be granted before starting capture. The permission dialog is shown by the Android system, not your app.
771
+
772
+
#### `checkPermission()`
773
+
774
+
Checks if MediaProjection permission (screen capture) has been previously granted without showing the permission dialog.
775
+
776
+
```typescript
777
+
const status =awaitFrameCapture.checkPermission();
778
+
```
779
+
780
+
**Returns:**`Promise<PermissionStatus>`
781
+
782
+
**Note:** Returns `NOT_DETERMINED` if permission was never requested, `GRANTED` if previously granted. MediaProjection permission cannot be checked programmatically on Android, so this only verifies if permission data exists from a previous grant.
783
+
784
+
#### `checkNotificationPermission()`
785
+
786
+
Checks if notification permission is granted (Android 13+).
787
+
788
+
```typescript
789
+
const status =awaitFrameCapture.checkNotificationPermission();
0 commit comments