π 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.
- Version: 1.1.000
- Author: Phixi Labs
- 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
- Have Flutter installed (Installation guide)
- Configure Firebase in the project (Configuration guide)
- Have a Twilio account to send SMS and WhatsApp
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)
π Sources and Credits
- Flutter - (flutter.dev)
- Geolocator - (pub.dev/packages/geolocator)
- Firebase - (firebase.google.com)
- Twilio API - (twilio.com)
- Permission Handler - (pub.dev/packages/permission_handler)
- Url Launcher - (pub.dev/packages/url_launcher)
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.