I haven’t tried doing this myself, but I have previously come across the following answer:
See also the comment below that about how to do it on iOS.
I was searching for how to do this sort of thing in React Native, since it’s not included in the Expo SDK. If you do that you’ll also find various other possibly useful information.
Note, the libraries mentioned in the answer will not work in Expo Go or with the classic build system. You will need to use EAS Build and you can build a dev client to use instead of Expo Go.
react-native-android-sms-listener and react-native-sms-retriever both look like they should work with EAS Build. Do not run “react-native link” and ignore the “manual installation” steps. react-native-sms-retriever looks newer so if I were doing this I might start with that one.
react-native-get-sms-android looks like it’s for manually reading SMSes. I don’t think that will work these days.