FORUMS
Remove All Ads from XDA

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

132 posts
Thanks Meter: 8
 
By BackToAndroid, Senior Member on 16th September 2019, 12:29 PM
Post Reply Email Thread
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
16th September 2019, 01:10 PM |#2  
ktmom's Avatar
Senior Member
Thanks Meter: 2,269
 
More
Quote:
Originally Posted by BackToAndroid

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.
17th September 2019, 09:41 AM |#3  
OP Senior Member
Thanks Meter: 8
 
More
Quote:
Originally Posted by ktmom

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
17th September 2019, 01:44 PM |#4  
ktmom's Avatar
Senior Member
Thanks Meter: 2,269
 
More
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
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes