-
-
Notifications
You must be signed in to change notification settings - Fork 33
Feat/foreground service notifications #802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…re-mansion/react-native-audio-api into feat/fs_android_recording
michalsek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nitpicks, but overall great job, thanks for this! :)
| ## Example | ||
|
|
||
| ```tsx | ||
| // TO DO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
| ## Example | ||
|
|
||
| ```tsx | ||
| // TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
| fun setLockScreenInfo(info: ReadableMap?) { | ||
| lockScreenManager.setLockScreenInfo(info) | ||
| // No-op: Old system removed | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we want to keep them even when they do nothing?
| if (notificationId != -1 && notificationKey != null) { | ||
| startForegroundService(notificationId, notificationKey) | ||
| } else { | ||
| Log.w(TAG, "Invalid notification data received") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: log id and key? instead of data -> might be misleading towards invalid payload
| .Builder(context, channelId) | ||
| .setSmallIcon(android.R.drawable.ic_btn_speak_now) | ||
| .setContentTitle(title) | ||
| .setContentText("Ready to record") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| .setContentText("Ready to record") | |
| .setContentText(description) |
| unregisterReceiver() | ||
|
|
||
| // Reset state | ||
| title = "Audio Recording" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| title = "Audio Recording" | |
| title = "Audio Recording" | |
| description = "Ready to record" |
if we want to really fully reset the user content
| notificationBuilder?.setColor(Color.RED) | ||
| notificationBuilder?.setColorized(true) | ||
| } else { | ||
| notificationBuilder?.setColorized(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add linear issue to make it configure'able some day?
| // dummy subscription object with a no-op remove method | ||
| return { | ||
| remove: () => {}, | ||
| } as any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } as any; | |
| } as unknown as AudioEventSubscription; |
this would get rid of any warning and as well as match the AudioEventSubscription type
| On iOS, this method clears the metadata but does not hide the notification controls. To completely hide controls on iOS, you must suspend or close the AudioContext. | ||
| ::: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is sligthly invalid - notification can be dismissed by calling the (internal) .endReceivingRemoteControlEvents (or whatever is the exact name).
💀
Closes RNAA-310
TODO
Maybe TODO
NotificationReceiver for notification dissmised event can be centralized right now there are two receivers(not wanted)AudioManageryou should usePlaybackNotificationManagerIntroduced changes
RecordingNotificationManagerfor management of notification dedicated for recordingPlaybackNotificationManagerfor management of notification dedicated for playbackAudioManagerChecklist