Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
YouTube Security VideosAnonymous Official: I'm begging you to understand this..(20.09.2026 um 21:30 Uhr)
Sichere ProgrammierungHow to Monitor Cron Jobs with a Simple HTTP Health Check(20.09.2026 um 23:14 Uhr)
Sichere ProgrammierungWhy my builds don't run on my laptop(20.09.2026 um 23:15 Uhr)
Sichere ProgrammierungDesigning offline-first when there's no server(20.09.2026 um 23:16 Uhr)
Sichere ProgrammierungSearching for Better Game Recommendations with Jev(20.09.2026 um 23:19 Uhr)
Linux Tipps & HardeningUbuntu 26.10 stops low memory from killing your desktop session(20.09.2026 um 19:55 Uhr)
YouTube Security VideosAnonymous Official: I'm begging you to understand this..(20.09.2026 um 21:30 Uhr)
Sichere ProgrammierungHow to Monitor Cron Jobs with a Simple HTTP Health Check(20.09.2026 um 23:14 Uhr)
Sichere ProgrammierungWhy my builds don't run on my laptop(20.09.2026 um 23:15 Uhr)
Sichere ProgrammierungDesigning offline-first when there's no server(20.09.2026 um 23:16 Uhr)
Sichere ProgrammierungSearching for Better Game Recommendations with Jev(20.09.2026 um 23:19 Uhr)
Linux Tipps & HardeningUbuntu 26.10 stops low memory from killing your desktop session(20.09.2026 um 19:55 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

How to make a default SMS app in Flutter(Android)

Reagiere als Erste:r — dein Feedback zählt!

In our fast-paced world, SMS messages remain a vital means of communication, even with the rise of chat apps.

With Flutter, you can create beautiful, cross-platform applications, and today we’ll explore how to set your Flutter app as the default SMS application on Android. And it will be described the way how to receive the SMS from our app, the first step of the default SMS app.

Our tutorial starts by creating a new Flutter project using the command line:

flutter create sms_app

To begin, it is essential to include the SMS permission in the AndroidManifest.xml file. As you know, in Android access to sensitive resources such as SMS, storage, and media requires explicit user consent.

For the first, add RECEIVE_SMS permission in the manifest section of the AndroidManifest.xml file.
This permission is necessary for our app to receive incoming sms and this prompts Google Play about the permission used in our app.

<uses-permission android:name="android.permission.RECEIVE_SMS" />

What is the next step?

It is essential to register receivers and activities where we can receive sms, handle and compose for sending new sms in our app.

<receiver android:name=".SmsReceiver" android:permission="android.permission.BROADCAST_SMS" android:exported="true">
   <intent-filter>
    <action android:name="android.provider.Telephony.SMS_DELIVER" />
   </intent-filter>
  </receiver>
  <receiver android:name=".IncomingSmsReceiver" android:permission="android.permission.BROADCAST_SMS" android:exported="true">
   <intent-filter>
    <action android:name="android.provider.Telephony.SMS_RECEIVED" />
   </intent-filter>
  </receiver>
  <!-- BroadcastReceiver that listens for incoming MMS messages -->
  <receiver android:name=".MmsReceiver" android:permission="android.permission.BROADCAST_WAP_PUSH" android:exported="true">
   <intent-filter>
    <action android:name="android.provider.Telephony.WAP_PUSH_DELIVER" />
    <data android:mimeType="application/vnd.wap.mms-message" />
   </intent-filter>
  </receiver>
  <!-- Activity that allows the user to send new SMS/MMS messages -->
  <activity android:name=".ComposeSmsActivity" android:exported="true">
   <intent-filter>
    <action android:name="android.intent.action.SEND" />
    <action android:name="android.intent.action.SENDTO" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="sms" />
    <data android:scheme="smsto" />
    <data android:scheme="mms" />
    <data android:scheme="mmsto" />
   </intent-filter>
  </activity>
  <!-- Service that delivers messages from the phone "quick response" -->
  <service android:name=".HeadlessSmsSendService" android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE" android:exported="true">
   <intent-filter>
    <action android:name="android.intent.action.RESPOND_VIA_MESSAGE" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:scheme="sms" />
    <data android:scheme="smsto" />
    <data android:scheme="mms" />
    <data android:scheme="mmsto" />
   </intent-filter>
  </service>

Here we registered 2 receivers, 1 activity and 1 service and each of these is for receiving sms, mms and composing new sms.

Now we are at the step of composing MainActivity.kt file to set our app as a default SMS app. This is required because the SMS receiving function is only available if the user sets our app as a default SMS app.

Here we use MethodChannel class of Flutter plugin for Android to ensure communication between dart code and native Android code.

In native Android code, we register the channel where we wrote the kotlin code to set our app as a default SMS app and the dart code calls this channel function.

When the app is opened, the entry point is in the Dart code (main.dart), which calls this method channel to requests Android to prompt the native Android modal asking the user to set the app as the default SMS app.

request android to set my app as a default sms app

Finally, we jump to the step of composing the SmsReceiver.kt file to receive SMS in the background. As we configured SmsReceiver class as a receiver intent for the BROADCAST_SMS permission in AndroidManifest.xml file this class inherits BroadcastReceiver class which is a Base class for code that receives and handles broadcast intents sent by Context.sendBroadcast(Intent).

Toast with new sms arrival

debug log of new sms arrival

In conclusion, setting up a default SMS app in Flutter is a straightforward process that can greatly enhance the functionality of your mobile application.

By leveraging the available packages and best practices above, you can ensure a seamless and efficient messaging experience for your users.

Thanks for reading!!!

Full Source Code

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten How to make a default SMS app in Flutter(Android)

Thematisch verwandte Begriffe: make, default, FlutterAndroid · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-93956 | A flaw has been found in olivier-ls PHP-FTS up to 1.1.2. Affected by thi…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick