Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SMS Receiving and Sending in Flutter Application

I am building a flutter app in which i want to capture incoming sms. I searched on pub.dev and found few packages offering similar functionality i.e. sms_maintained and sms_retreiver etc. I tried them but i am not satisfied with the provided functionality. I need more control such as listening to incoming sms messages while app is not running and manual control to start and stop listening for messages. So, i am thinking of writing own SMS handling code from scratch instead of using a package. I want guidance to achieve this. i.e. where to start??? I am new to flutter and mobile app dev, i don't know whether my question is worthy of being answered or not, that's why i am asking.

like image 589
Adnan Ahmed Avatar asked Jan 25 '23 03:01

Adnan Ahmed


1 Answers

You are going in a big project by implementing a package like that. But there is no door a dev can't open :-)

There are some thing you should know before starting your project:

  • Flutter is not able to do this by nature, Flutter is an UI SDK, every non-UI thing relay to the underlying platform (Android, iOS, Web, Desktop)
  • Flutter is able to communicate with the native platform to do specific platform things (in your case, manage SMS)

You have to learn how to create a native Flutter plugin, a plugin implemented in platform-specific code (Java/Kotlin, Swift/Objective-c, C/C++/Go) which communicate with some Flutter UI code (written in Dart) via Platform Channels.

There are some tutorials found over the web:

  • Platform Channels, Benefits and Limitations
  • Flutter Platform Channel (A pretty complete tutorial on Medium)
  • Method Channel In Flutter (A simple one with example for Android platform)

Hope this will help, and good luck!

like image 62
na2axl Avatar answered Feb 06 '23 13:02

na2axl