mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-26 11:05:20 +00:00
Fix voice recording and notification issues
- Fix mic button gesture handling by removing Button wrapper - Use direct gesture on ZStack for more reliable touch detection - Add debug logging for recording start/stop - Fix notification delivery on iOS - Change from checking .background to checking != .active - Notifications now work when app is inactive or background - Add NSUserNotificationsUsageDescription to Info.plist - Improve voice note fragment transmission - Reduce fragment size from 400 to 200 bytes for better reliability - Simplify fragment timing from batch-based to linear 100ms delays - Lower packet size threshold from 512 to 400 bytes for fragmentation - Add peripheral connection state checking before writes - Better error logging throughout transmission pipeline - Add comprehensive debug logging for troubleshooting - Log audio file size and duration - Log peripheral connection states during broadcast - Log fragment send progress with timing info
This commit is contained in:
@@ -25,11 +25,14 @@ class NotificationService {
|
||||
|
||||
func sendLocalNotification(title: String, body: String, identifier: String) {
|
||||
#if os(iOS)
|
||||
guard UIApplication.shared.applicationState == .background else {
|
||||
print("[NOTIFICATIONS] App is in foreground, skipping notification")
|
||||
// Send notification if app is not active (background or inactive)
|
||||
guard UIApplication.shared.applicationState != .active else {
|
||||
print("[NOTIFICATIONS] App is active/foreground, skipping notification")
|
||||
return
|
||||
}
|
||||
|
||||
print("[NOTIFICATIONS] App state: \(UIApplication.shared.applicationState.rawValue), sending notification")
|
||||
|
||||
let content = UNMutableNotificationContent()
|
||||
content.title = title
|
||||
content.body = body
|
||||
|
||||
Reference in New Issue
Block a user