using Justice.Helpers; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace Justice.Services { public class SosService { public async Task SendSosAlertAsync(List recipients) { try { // Fetch location and address (double latitude, double longitude, string address) = await GeolocationHelper.GetCurrentLocationAsync(); // Prepare the SOS message string message = $"SOS Alert! I need help. My location:\n" + $"Latitude: {latitude}, Longitude: {longitude}\n" + $"Address: {address}\n\n"; // Send the SMS await SmsHelper.SendSmsAsync(message, recipients); } catch (Exception ex) { throw new Exception($"SOS Alert failed: {ex.Message}"); } } } }