Fix BLE contact add failure

This commit is contained in:
Janez T
2026-03-15 09:24:41 +01:00
parent c2e0fa952e
commit 66eb32bf44
5 changed files with 293 additions and 14 deletions

View File

@@ -1358,6 +1358,22 @@ class ConnectionProvider with ChangeNotifier {
}
}
Future<void> importContactAdvert(Uint8List contactAdvertFrame) async {
if (!_activeService.isConnected) {
_error = 'Not connected to device';
notifyListeners();
return;
}
try {
_error = null;
await _activeService.importContact(contactAdvertFrame);
} catch (e) {
_error = 'Failed to import contact: $e';
notifyListeners();
}
}
/// Send text message to contact
///
/// Returns true if the message was successfully sent to the BLE service.