πŸ“– Documentation - GrupoIE Assistance

πŸ“Œ Important: This app does not replace official emergency services like fire department, police, or public ambulance. Its use is limited to private or internal networks configured by the user, and it does not guarantee immediate attention from official services.


  • Created: March 7, 2025
  • Last Updated: 27 Agust, 2025
  • Compatibility:
  • βœ… Android - βœ… iOS

If you have any questions that are beyond the scope of this help file, feel free to email us through the Support Page.


πŸ›  Technologies Used

  • Flutter (UI and application logic)
  • Dart (Programming language)
  • Firebase (Crashlytics for error logging)
  • Geolocator (To obtain real-time location)
  • Permission Handler (To manage permissions)
  • MethodChannel (To make calls and send SMS on Android)
  • Twilio API (To send assistance messages via SMS and WhatsApp)
  • Url Launcher (To open the phone dialer)

πŸ“‚ Project Structure


πŸš€ Installation and Configuration



Prerequisites



Dependencies

Make sure to include the following dependencies in your pubspec.yaml

dependencies:
  flutter:
    sdk: flutter
  geolocator: ^10.1.0
  permission_handler: ^11.0.1
  firebase_core: ^3.0.0
  firebase_crashlytics: ^4.0.0
  url_launcher: ^6.2.5
  http: ^0.13.5

πŸ“² Permission Setup on Android and iOS



πŸ”Ή Android

In the android/app/src/main/AndroidManifest.xml file, add the following permissions inside <manifest>

<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>

Also, in <application>, add this configuration if using Twilio

<uses-cleartext-traffic="true"/>

And in android/app/build.gradle, inside defaultConfig

minSdkVersion 21


🍏 iOS

In the ios/Runner/Info.plist file, add the following keys to request permissions from the user:

<key>NSLocationWhenInUseUsageDescription</key>
<string>This app needs access to your location to send alerts.</string>

You must also enable the Permissions option in the Podfile (ios/Podfile)

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
        '$(inherited)',
        'PERMISSION_PHONE=1',
        'PERMISSION_LOCATION=1',
        'PERMISSION_SMS=1'
      ]
    end
  end
end

🎯 Main Features



πŸ“Œ 1. Permission Request

Future _requestPermissions() async {
   Map statuses = await [
    Permission.phone,
    Permission.sms,
    Permission.locationWhenInUse,
  ].request();
}

The app requests permissions to access phone, SMS, and location.


πŸ“Œ 2. Assistance Call

Future _makeEmergencyCall() async {
  if (Platform.isAndroid) {
    try {
      await _callChannel.invokeMethod('realizarLlamada', {'numero': _emergencyNumber});
    } catch (e) {
      _launchPhoneDialer(_emergencyNumber);
    }
  } else {
    _launchPhoneDialer(_emergencyNumber);
  }
}

Makes an assistance call using MethodChannel on Android and url_launcher on iOS.


πŸ“Œ 3. Send Assistance Messages

Future _sendEmergencyMessage() async {
  Position position = await Geolocator.getCurrentPosition();
  String message = "🚨 assistance! My location: https://www.google.com/maps?q=${position.latitude},${position.longitude}";
                
  if (Platform.isAndroid) {
    await _sendSMSChannel(message, _smsNumber);
    await _sendSMSTwilio(message, _whatsappNumber);
  } else {
    await _sendSMSTwilio(message, _smsNumber);
  }
                
  await _sendWhatsAppTwilio(message, _whatsappNumber);
}

Gets the current location and sends a message with the location via SMS and WhatsApp.


πŸ“Œ 4. User Interface

Scaffold(
  appBar: AppBar(
    title: Image.asset("assets/images/logo.png", height: 55),
  ),
  body: Center(
    child: GestureDetector(
      onTap: isButtonDisabled ? null : () {
        _makeEmergencyCall();
        _sendEmergencyMessage();
      },
      child: Container(
        width: 120,
        height: 120,
        decoration: BoxDecoration(
          color: isButtonDisabled ? Colors.blueGrey : Colors.red,
          shape: BoxShape.circle,
        ),
        child: Center(
          child: isLoading ? CircularProgressIndicator() : Text("CALL"),
        ),
      ),
    ),
  ),
)              

The assistance button triggers the call and sends the location.


πŸ›  Errors and Solutions



Error Cause Solution
PlatformException in calls Missing configuration in AndroidManifest.xml <uses-permission android:name="android.permission.CALL_PHONE"/>
GeolocationStatus.denied Location permission not granted Manually request permission from Settings
Twilio API Unauthorized Incorrect credentials Check accountSid and authToken

❓ Frequently Asked Questions (FAQ)

The app needs these permissions to make assistance calls and send messages with the user's location in critical situations.
Go to Settings β†’ Apps β†’ Select the app β†’ Permissions and enable the necessary ones.
Yes, but only for calls and SMS. WhatsApp messages and using Twilio require an internet connection.
It works on most devices with Android 5.0+ and iOS 11+. However, some specific models may have permission restrictions.
Currently, the numbers are predefined in the code, but it can be modified to allow users to input a custom number.

πŸ“œ Sources and Credits

Developed by Phixi Labs πŸš€


πŸ“ Changelog

v1.1.000 (27-08-2025)

πŸ”Ή Update of Call and SMS MethodChannel; was functioning incorrectly (Android only). 
πŸ”Ή Design updated to dark mode style, changed app icons and logos. 
πŸ”Ή Application texts updated to comply with store requirements. 
πŸ”Ή Bug fix for Dial not opening (iOS only). 
πŸ”Ή Updated the information collected by Firebase Crashlytics and Firebase Analytics for correct data collection without errors. 

v1.0.000 (BETA) (2025-03-23)

πŸ”Ή Implemented assistance call with MethodChannel. 
πŸ”Ή Sent location via SMS and WhatsApp using Twilio API. 
πŸ”Ή Assistance button animation. 
πŸ”Ή Permission handling on Android and iOS. 
πŸ”Ή Integration with Firebase Crashlytics and Firebase Analytics for error handling and data collection.