How to open a app if received SMS contains "some sentence"?

Search This thread

ktmom

Retired Forum Moderator
Apr 22, 2015
5,176
3,387
Deep Space Station K7
I tried Event received any SMS -> Trigger open app if %SMSRF ~ "sentence"

But this didn't work, I tried sending SMS or even when I click play button within tasks
You need to use %SMSRB for the body text of an SMS message. %SMSRF contains the sender information.

You may have to use regex to do the sentence match if it could contain capital letters one time and not the next time, or stray punctuation, ect. Minimally, I would surround it with *. For example, *your sentence here* An asterisk * matches zero or more characters.

You could also do this logic in the profile event. On the content line put your key words surrounded by *. Again, the trick is, you need to capture the possibility of capitalization or punctuation if others may send this text. Easier to use regex if you don't have control over the sending of the message

Then you can simply use an launch app action in the task.
 
Last edited:

BackToAndroid

Senior Member
Apr 5, 2017
162
16
Samsung Galaxy Z Flip 4
You need to use %SMSRB for the body text of an SMS message. %SMSRF contains the sender information.

You may have to use regex to do the sentence match if it could contain capital letters one time and not the next time, or stray punctuation, ect. Minimally, I would surround it with *. For example, *your sentence here* An asterisk * matches zero or more characters.

You could also do this logic in the profile event. On the content line put your key words surrounded by *. Again, the trick is, you need to capture the possibility of capitalization or punctuation if others may send this text. Easier to use regex if you don't have control over the sending of the message

Then you can simply use an launch app action in the task.

I actually did use %SMSRB and not %SMSRF so my text will contain a fixed URL like notification.appname.com

Code:
<TaskerData sr="" dvi="1" tv="5.8.3">
	<Task sr="task21">
		<cdate>1568554172916</cdate>
		<edate>1568709445218</edate>
		<id>21</id>
		<nme>Upi Icici</nme>
		<pri>100</pri>
		<Action sr="act0" ve="7">
			<code>20</code>
			<App sr="arg0">
				<appClass>com.csam.icici.bank.imobile.IMOBILE</appClass>
				<appPkg>com.csam.icici.bank.imobile</appPkg>
				<label>iMobile</label>
			</App>
			<Str sr="arg1" ve="3"/>
			<Int sr="arg2" val="0"/>
			<Int sr="arg3" val="1"/>
			<ConditionList sr="if">
				<Condition sr="c0" ve="3">
					<lhs>%SMSRB</lhs>
					<op>2</op>
					<rhs>mobile.icicibank.com/upiPushNotifications</rhs>
				</Condition>
			</ConditionList>
		</Action>
	</Task>
</TaskerData>

This is what my XML looks like
 

ktmom

Retired Forum Moderator
Apr 22, 2015
5,176
3,387
Deep Space Station K7
It looks like you haven't surrounded the package name with * as I described.

Exporting as xml is to enable importing a task into a different device. It's not particularly helpful to show a problem. It's better to expiry the description. See here