maui icon indicating copy to clipboard operation
maui copied to clipboard

Read SMS in MAUI (on Android / iOS)

Open SunshineSpring666 opened this issue 3 years ago • 2 comments
trafficstars

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.

SunshineSpring666 avatar Sep 20 '22 07:09 SunshineSpring666

Implementation solutions such as xamarin-forms-send-and-receive-sms which worked in Xamarin don't work in MAUI anymore.

SunshineSpring666 avatar Sep 20 '22 07:09 SunshineSpring666

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.

ghost avatar Sep 21 '22 18:09 ghost

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.

Redth avatar Oct 14 '22 16:10 Redth

OK, I see. Thanks for the reply.

SunshineSpring666 avatar Oct 19 '22 07:10 SunshineSpring666