| Line 1: |
Line 1: |
| − | <span style="color: #0E9549; font-size: 24px;">'''About this restriction'''</span><br/> | + | <pre class="header-style">This constraint allows or prevents a macro/feature from running based on whether a selected app is currently running in the foreground.</pre> |
| | | | |
| − | This constraint can be used to allow/prevent functionality from running, depending whether one or more apps are or are not currently running.
| + | ''' Options ''' |
| | | | |
| − | <span style="color: #0E9549; font-size: 24px;">'''Please note that'''</span><br/> | + | * '''Running''': Constraint passes only when the selected app is running in the foreground |
| − | On Android 8+ due to restrictions you can only determine if the app is opened in foreground or not and not if it is actually running or not in the background.
| + | * '''Not running''': Constraint passes only when the selected app is not running in the foreground |
| | + | * '''Application''' - Choose the app to check |
| | + | |
| | + | ''' Example ''' |
| | + | |
| | + | ''Example 1: Launch a media app only if it is not already running'' |
| | + | <pre class="trigger-style">Triggers |
| | + | |
| | + | Bluetooth Event - Device Connected</pre> |
| | + | <pre class="action-style">Actions |
| | + | |
| | + | Launch Application: Spotify</pre> |
| | + | <pre class="constraint-style">Constraints |
| | + | |
| | + | Application Running - Not running (Spotify)</pre> |
| | + | |
| | + | ''' See Also ''' |
| | + | |
| | + | * [[Trigger: Application Launched/Closed|Application Launched/Closed Trigger]] |
| | + | * [[Action: Launch Application|Launch Application Action]] |