Receive_sms not working on new build


just not work any more
it will send text but wont read incoming text any more

do you test in the companion app or after building using the apk file?
is this while your app is up and running or while your app is in the background?
which Android version are you using for your tests?


apk file
s9+ sum
android 10

on the main app
always on screen
no screen changes
no sleep no lock
app always open

testtexting.aia (2.9 KB)
is this helps

a little bit of backgorund i have a 7000 block app
that takes data from andrino sencers

users who are in the system can text that phone
and it will reply with data its collecting depending on what the user has askd.

but now the text messages are not being read. its just sending out data and now my users cant even use the "stop" text comand. kidna need some help

i have around 40 people we know dont have any control my only option is to close down the app till i can find a better way.
i use texting as ios users can allso interract

I tried your test app. On my Realme running android 13, it doesn't require the receive_sms permission at installation / first start and gets stuck there with the label saying the permission was denied.

I was able to manually give the permission though through the smartphone settings.

Or : on my phone, the app can be made to require the permission by adding a "set Texting1.RecevingEnable : always" in the screen.initialize .

It then requires the permission at first start and correctly receives the incoming sms, as long as the app is open / in the foreground.

Couldn't get it to send a notification when in the background though.


thanks, you are 100% right. now reading the SMS in that aia thanks

I ended up making a kodular app and running it on other phone

think I like it better as now im working through real-time DB and can now inject test messages as you cant send a text in ais companion and using 2 phones I can offload some of the blocks and speed up my ai2 block editor =)

but because you have found this I will replace my kodular app with a ai2

thanks for dabbling around with this

Good if it helped, even if I'm not sure to understand why the fact that companion can't send SMS is that big a problem, can't you compile the app ?

Anyway, it looks like a (minor) bug, as putting the "always" state directly in the declaration of the component in the designer view isn't enough to get the app ask for the necessary permission, whereas putting a block in the initialize block works.

1 Like

I will clear up what I mean

From my experience you can't send a direct text message from a block Being in the companion mode you have to do a full export and install APK.

User text
It checks there number for being approved.
Then reads the first 10 characters for the command
Then using if blocks
If message contains any of listed commands
Run if statement that matches

If I add a new command
Can take a wee while and a few tweeks and every test has to be a new export :unamused:

ah, a matter or time to debug the process, I understand. Why don't you switch to sendMessage block in debug mode instead sendMessageDirect, and check whether the sms is correctly formed, even in not sent, in the sms App ?

Ai2 don't like being minimised .as that loads up text message app and puts the companion app in the background

Some times it can take 2-8+mins to reload that days data if I lose conetion

And dose not like to change screens when using the file read block with list and local storage or it's a sensor timer execution problem as I have like 4 going on every few times a sec

but no prob when exported and running on phone. On screen 1.

Oh I see. Replacing the sendmessagedirect by a simple notifier showing number and message which would form the message for the debug phase ?

oh ! and why don't you use the u version of the companion, which if I understand correctly can sendmessagedirect as it is not the google play version ?

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.