shounakmulay / Telephony

Flutter plugin for telephony features like query device sms directory, listen for incoming messages, retrieve various network parameters, etc.
https://telephony.shounakmulay.dev
MIT License
140 stars 132 forks source link

Fail to send SMS (SmsManager problem) #183

Open sdyomin opened 1 year ago

sdyomin commented 1 year ago

Android-9, Samsung Galaxy S9+

Error thrown while sending SMSes (foreground). The reason: file SmsController.kt, the call

val smsManager = getSystemService(context, SmsManager::class.java)

returns null.

I've replaced it (locally) by

SmsManager.getDefault()

and that works on my devices.

vigneshtnj commented 1 year ago

SmsManager problem occurs below android 12, no problem on android 12 and 13

btw, where is this file "SmsController.kt," located ?

Belveloper commented 1 year ago

Same here smsManager works perfectly on android 12 13 but not working on android 11

And also i found that the plugin is no longer maintained Check their docs https://telephony.shounakmulay.dev/

vigneshtnj commented 1 year ago

The answer is from https://github.com/shounakmulay/Telephony/issues/149 above link solved my problem

suhardik commented 1 year ago

try this solution

https://github.com/shounakmulay/Telephony/issues/149#issuecomment-1212695720

hope this help :)