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
139 stars 126 forks source link

[Changed] List<String> as to in sendSms function #69

Closed AyeshaIftikhar closed 3 years ago

AyeshaIftikhar commented 3 years ago

Hi there! I hope you are doing fine. I am Ayesha Iftikhar a flutter developer from Pakistan and I have recently used your `Telephony package. Although it is a great package and saves a lot of time and effort for setting up custom platform channels to send or call with minimum user interaction. I find a little issue, in case if the application is saving all the contacts in a list of Strings and it wasn't giving that option to use as receiver address. So, I just made a little effort and change it and it works fine so I thought to share it with others too. I would be delighted if you accept/merge my pull request and allow others to have the benefit from that work too. Thanks and Regards, Ayesha Iftikhar

shounakmulay commented 3 years ago

Hey @AyeshaIftikhar

Thank you for the PR.

I checked it out locally, but unfortunately it's not working for me. I see that you have changed the to address of the sendSms functions to be an array of string. I don't think that will work as these arguments are received on the android side of the plugin where it expects to receive a String. That causes the plugin to throw java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String.

Also if you see the SmsManager.sendTextSms method, which the plugin calls eventually, requires the address to be a String.

I will leave this PR open for now if you want to try and find a solution for this.