Android Question SMS hyperlink opens application Messages but no new SMS appears.

hatzisn

Expert
Licensed User
Longtime User
Good evening everyone,

It's been a long time since I 've done this so I either don't remember correctly or because it is the first time I am doing it in Android 12 something has changed. I tried to send an sms using a hyperlink with PhoneIntents openbrowser command from the default SMS app. The code seems to work, the default application (Messages) opens but there is no precreated message in it. I instead see the screen with the SMSs and that's all. This is the code. Any suggestions anyone?

B4X:
    wait for (xui.Msgbox2Async("Send SMS with credentials?", "Verification", "Yes", "", "No", Null)) MsgBox_Result(iRet As Int)
    If iRet = xui.DialogResponse_Positive Then
        Dim p As PhoneIntents
        StartActivity(p.OpenBrowser($"sms:${txtPhoneMobile.Text}?body=Your credentials are..."$))
    End If
 
Last edited:

hatzisn

Expert
Licensed User
Longtime User
Based on: https://stackoverflow.com/a/64648096

Try to add:
B4X:
AddManifestText(
 <queries>
        <intent>
            <action android:name="android.intent.action.SENDTO" />
            <data android:scheme="smsto"/>
        </intent>
    </queries>
)

If it doesn't work then try it with smsto: instead of sms: (in the intent).

It works. Thanks.
 
Upvote 0
Top