How to get mobile text messaging working
Posted: Wed Dec 14, 2022 11:02 am
Dear LiveCoders,
I have been trying to get my app to trigger preparing a text message (SMS) on an android device. At first I tried with:
This starts the text messaging app on the android phone, selecting the name for the phone number in the tMobile variable, but it leaves the message empty. I have tried variations with the body parameter, to have a ';' instead of the '&' and other combinations. They didn't work. Then I came across the specific functions for this in the LiveCode Dictionary (mobileCanComposeTextMessage(), and mobileComposeTextMessage tMobile, tMessage). But these seem to fail too. With the following code I get the answer "Cannot send text messages" on my android phone when I press the button.
Are there some settings for the standalone or elsewhere that are needed to get this to work?
I have been trying to get my app to trigger preparing a text message (SMS) on an android device. At first I tried with:
Code: Select all
put "This is a test text" into tMessage
put URLEncode(tMessage) into tMessage
launch url "sms:" & tMobile & "&body=" & tMessage
Code: Select all
on mouseUp
if mobileCanComposeTextMessage() then
answer "Text Messages can be sent"
else
answer "Cannot send text messages"
end if
end mouseUp