maui
maui copied to clipboard
Read SMS in MAUI (on Android / iOS)
Description
In SMS-related scenarios such as auto authentication and auto accounting, we may need to read SMS sent from specific number and parse the message to automatically process certain workflows.
Current MAUI SMS can only send message to specific number, but not being able to read any message.
Public API Changes
string recipient = "000-000-0000"; SmsMessage messages = await Sms.Default.ReadAsync(recipient);
foreach (var msg in messages) { // parse the message based on msg.Body, msg.Recipients, msg.Time, etc.
}
Intended Use-Case
Scenarios including auto authentication and auto accounting.
App read certain number's SMS, parse it to get verification code / transaction detail automatically, in order to avoid manually repeat such boring operations over and over again. This automatic process can be done in a Timer.
Implementation solutions such as xamarin-forms-send-and-receive-sms which worked in Xamarin don't work in MAUI anymore.
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
This is not an API that is feasible across platforms given the available API's on the underlying platforms. Also, Android has made permission to do this increasingly restricted.
Thanks for the suggestion, but unfortunately this out of scope for MAUI/Essentials and we will not be adding the feature.
OK, I see. Thanks for the reply.