mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 20:05:19 +00:00
iOS: keep mesh alive in background; remove stopServices() on scenePhase .background so incoming messages can still arrive and trigger notifications.
This commit is contained in:
@@ -44,8 +44,8 @@ struct BitchatApp: App {
|
|||||||
.onChange(of: scenePhase) { newPhase in
|
.onChange(of: scenePhase) { newPhase in
|
||||||
switch newPhase {
|
switch newPhase {
|
||||||
case .background:
|
case .background:
|
||||||
// Send leave message when going to background
|
// Keep BLE mesh running in background; BLEService adapts scanning automatically
|
||||||
chatViewModel.meshService.stopServices()
|
break
|
||||||
case .active:
|
case .active:
|
||||||
// Restart services when becoming active
|
// Restart services when becoming active
|
||||||
chatViewModel.meshService.startServices()
|
chatViewModel.meshService.startServices()
|
||||||
|
|||||||
Reference in New Issue
Block a user