mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-26 14:05:22 +00:00
Add network availability notifications when bitchatters are nearby
- Show notification when network transitions from empty to having peers - Single notification per session, resets when network becomes empty - Background Bluetooth modes enabled for iOS - Generic message: 'bitchatters nearby\! 1 person around' or 'X people around'
This commit is contained in:
@@ -77,10 +77,18 @@ class NotificationService {
|
||||
}
|
||||
|
||||
func sendFavoriteOnlineNotification(nickname: String) {
|
||||
let title = "⭐ \(nickname) is online"
|
||||
let title = "⭐ \(nickname) is online!"
|
||||
let body = "wanna get in there?"
|
||||
let identifier = "favorite-online-\(UUID().uuidString)"
|
||||
|
||||
sendLocalNotification(title: title, body: body, identifier: identifier)
|
||||
}
|
||||
|
||||
func sendNetworkAvailableNotification(peerCount: Int) {
|
||||
let title = "👥 bitchatters nearby!"
|
||||
let body = peerCount == 1 ? "1 person around" : "\(peerCount) people around"
|
||||
let identifier = "network-available"
|
||||
|
||||
sendLocalNotification(title: title, body: body, identifier: identifier)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user