Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3857ded
fix: reverted recorder notification
poneciak57 Dec 23, 2025
1a7bf4d
feat: android refactor
poneciak57 Dec 23, 2025
b940f4b
chore: some leftovers
poneciak57 Jan 8, 2026
1952104
feat: alpha recording notification
mdydek Jan 9, 2026
e3a0f2b
feat: beta recording notification
mdydek Jan 12, 2026
4f01701
feat: beta recording notification
mdydek Jan 12, 2026
93cd5f0
feat: first part of feature code
mdydek Jan 12, 2026
0d4779f
Merge branch 'refactor/recording_notification' into feat/recording-no…
mdydek Jan 12, 2026
78d418b
feat: first working version
mdydek Jan 12, 2026
6c572f0
Merge branch 'main' into feat/recording-notification
mdydek Jan 12, 2026
8a42b40
docs: recording notification
mdydek Jan 13, 2026
8d54b76
feat: fully working
mdydek Jan 13, 2026
4061844
refactor: state in notification and comments
mdydek Jan 13, 2026
90d150c
refactor: jsdocs, docs, removed some unused code
mdydek Jan 14, 2026
2df954d
Merge branch 'main' into feat/recording-notification
mdydek Jan 14, 2026
e9eab5d
feat: last part of comments
mdydek Jan 14, 2026
9a1635c
Merge branch 'main' into feat/recording-notification
mdydek Jan 14, 2026
d1b8e36
Feat/base_merge_for_android_notifications (#879)
poneciak57 Jan 14, 2026
3f29e8d
feat: beta recording notification
mdydek Jan 12, 2026
2e79530
feat: first part of feature code
mdydek Jan 12, 2026
9537fb9
fix: reverted recorder notification
poneciak57 Dec 23, 2025
d2daec5
feat: android refactor
poneciak57 Dec 23, 2025
c234f64
chore: some leftovers
poneciak57 Jan 8, 2026
66e4e01
feat: alpha recording notification
mdydek Jan 9, 2026
b60430e
feat: beta recording notification
mdydek Jan 12, 2026
e7ded40
feat: first working version
mdydek Jan 12, 2026
ae917e7
docs: recording notification
mdydek Jan 13, 2026
34bf6ab
feat: fully working
mdydek Jan 13, 2026
0495251
refactor: state in notification and comments
mdydek Jan 13, 2026
117e4c5
refactor: jsdocs, docs, removed some unused code
mdydek Jan 14, 2026
09257b1
feat: last part of comments
mdydek Jan 14, 2026
89dac29
Merge branch 'feat/recording-notification' of https://github.com/soft…
poneciak57 Jan 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 42 additions & 1 deletion apps/common-app/src/demos/Record/Record.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC, useCallback, useEffect, useState } from 'react';
import { AudioManager } from 'react-native-audio-api';
import { AudioManager, RecordingNotificationManager } from 'react-native-audio-api';

import { Alert, StyleSheet, View } from 'react-native';
import { Container } from '../../components';
Expand All @@ -10,6 +10,7 @@ import RecordingTime from './RecordingTime';
import RecordingVisualization from './RecordingVisualization';
import Status from './Status';
import { RecordingState } from './types';
import { AudioEventSubscription } from 'react-native-audio-api/lib/typescript/events';

AudioManager.setAudioSessionOptions({
iosCategory: 'playAndRecord',
Expand All @@ -21,6 +22,42 @@ const Record: FC = () => {
const [state, setState] = useState<RecordingState>(RecordingState.Idle);
const [hasPermissions, setHasPermissions] = useState<boolean>(false);

useEffect(() => {
const pauseListener = RecordingNotificationManager.addEventListener(
'recordingNotificationPause',
() => {
console.log('Notification pause action received');
onPauseRecording();
}
);

const resumeListener = RecordingNotificationManager.addEventListener(
'recordingNotificationResume',
() => {
console.log('Notification resume action received');
onResumeRecording();
}
);

return () => {
RecordingNotificationManager.removeEventListener(pauseListener);
RecordingNotificationManager.removeEventListener(resumeListener);
RecordingNotificationManager.hide();
};
}, []);

const setNotification = (paused: boolean) => {
RecordingNotificationManager.show({
title: 'Recording Demo',
contentText: paused ? 'Paused recording' : 'Recording...',
paused,
smallIconResourceName: 'logo',
pauseIconResourceName: 'pause',
resumeIconResourceName: 'resume',
color: 0xff6200,
});
};

const onStartRecording = useCallback(async () => {
if (state !== RecordingState.Idle) {
return;
Expand All @@ -47,6 +84,7 @@ const Record: FC = () => {
}

const result = Recorder.start();
setNotification(false);

if (result.status === 'success') {
console.log('Recording started, file path:', result.path);
Expand All @@ -61,16 +99,19 @@ const Record: FC = () => {

const onPauseRecording = useCallback(() => {
Recorder.pause();
setNotification(true);
setState(RecordingState.Paused);
}, []);

const onResumeRecording = useCallback(() => {
Recorder.resume();
setNotification(false);
setState(RecordingState.Recording);
}, []);

const onStopRecording = useCallback(() => {
Recorder.stop();
RecordingNotificationManager.hide();
setState(RecordingState.ReadyToPlay);
}, []);

Expand Down
3 changes: 1 addition & 2 deletions apps/common-app/src/examples/AudioFile/AudioFile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ const AudioFile: FC = () => {

const setupNotification = async () => {
try {
await PlaybackNotificationManager.register();
const duration = AudioPlayer.getDuration();
await PlaybackNotificationManager.show({
title: 'Audio file',
Expand All @@ -87,7 +86,7 @@ const AudioFile: FC = () => {
setup();
return () => {
AudioPlayer.reset();
PlaybackNotificationManager.unregister();
PlaybackNotificationManager.hide();
};
}, [fetchAudioBuffer]);

Expand Down
Loading