RecordingNotificationManager Android
The RecordingNotificationManager provides system integration with AudioRecorder on Android.
It can send events about pausing and resuming to your application.
RecordingNotificationManager is not available on iOS. For a recording indicator on the Lock Screen and in the Dynamic Island, use a Live Activity built with expo-widgets.
Example
RecordingNotificationManager.show({
title: 'Recording app',
contentText: 'Recording...',
paused: false,
smallIconResourceName: 'icon_to_display',
pauseIconResourceName: 'pause_icon',
resumeIconResourceName: 'resume_icon',
color: 0xff6200,
});
const pauseEventListener = RecordingNotificationManager.addEventListener('recordingNotificationPause', () => {
console.log('Notification pause action received');
});
const resumeEventListener = RecordingNotificationManager.addEventListener('recordingNotificationResume', () => {
console.log('Notification resume action received');
});
pauseEventListener.remove();
resumeEventListener.remove();
RecordingNotificationManager.hide();
Methods
show
Shows the recording notification with the parameters.
Metadata is saved between calls, so after the initial pass to the show method, you need only call it with elements that are supposed to change.
| Parameter | Type | Description |
|---|---|---|
info | RecordingNotificationInfo | Initial notification metadata |
Returns Promise<void>.
For more details, go to android developer page. Resource name is a path to resource placed in res/drawable folder. It has to be either .png file or .xml file, name is indicated without file extension. (photo.png -> photo).
If nothing is displayed, even though your name is correct, try decreasing size of your resource. Notification can look vastly different on different android devices.
hide
Hides the recording notification.
Returns Promise<void>.
isActive
Checks if the notification is displayed.
Returns Promise<boolean>.
addEventListener
Adds an event listener for notification actions.
| Parameter | Type | Description |
|---|---|---|
eventName | RecordingNotificationEventName | The event to listen for |
callback | NotificationCallback | Callback function |
Returns AudioEventSubscription.
Remarks
RecordingNotificationInfo


Type definitions
interface RecordingNotificationInfo {
title?: string;
contentText?: string;
paused?: boolean; // flag indicating whether to display pauseIcon or resumeIcon
smallIconResourceName?: string;
largeIconResourceName?: string;
pauseIconResourceName?: string;
resumeIconResourceName?: string;
color?: number; //
}
RecordingNotificationEventName


Type definitions
interface EventEmptyType {}
interface RecordingNotificationEvent {
recordingNotificationPause: EventEmptyType;
recordingNotificationResume: EventEmptyType;
}
type RecordingNotificationEventName = keyof RecordingNotificationEvent;
NotificationCallback


Type definitions
type NotificationCallback<Name extends RecordingNotificationEventName> = (
event: RecordingNotificationEvent[Name]
) => void;