| Line 1: |
Line 1: |
| − | <pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;"> | + | <pre class="header-style">This trigger will fire when the screen is unlocked. It detects when the user successfully unlocks the device, whether by PIN, pattern, fingerprint, face recognition, or any other unlock method.</pre> |
| − | This trigger will fire when the screen is unlocked. | + | |
| − | </pre>
| + | ''' Options ''' |
| | + | |
| | + | This trigger has no configurable options. It simply fires whenever the device is unlocked by the user. |
| | + | |
| | + | ''' Examples ''' |
| | + | |
| | + | '''Example 1: Welcome message''' |
| | + | |
| | + | Display a greeting when you unlock your phone: |
| | + | |
| | + | <pre class="trigger-style">Triggers |
| | + | |
| | + | Screen Unlocked</pre> |
| | + | <pre class="action-style">Actions |
| | + | |
| | + | Speak Text: "Hello, welcome back"</pre> |
| | + | |
| | + | '''Example 2: Work mode activation''' |
| | + | |
| | + | Enable work profile and settings when unlocking during work hours: |
| | + | |
| | + | <pre class="trigger-style">Triggers |
| | + | |
| | + | Screen Unlocked</pre> |
| | + | <pre class="action-style">Actions |
| | + | |
| | + | Set Ringer Volume: Vibrate |
| | + | WiFi: Enable |
| | + | Launch Application: Slack</pre> |
| | + | <pre class="constraint-style">Constraints |
| | + | |
| | + | Time of Day: 9:00 AM - 5:00 PM |
| | + | Day of Week: Monday - Friday</pre> |
| | + | |
| | + | '''Example 3: Security logging''' |
| | + | |
| | + | Log all device unlock events for security monitoring: |
| | + | |
| | + | <pre class="trigger-style">Triggers |
| | + | |
| | + | Screen Unlocked</pre> |
| | + | <pre class="action-style">Actions |
| | + | |
| | + | Log to file: "Device unlocked at [date] [hour]:[minute]:[second]" |
| | + | Set Variable: [unlock_count] = [unlock_count] + 1</pre> |
| | + | |
| | + | ''' Notes ''' |
| | + | |
| | + | * This trigger uses the Android ACTION_USER_PRESENT intent to detect when the user has unlocked the device |
| | + | * The trigger fires after the user has successfully passed the lock screen, not when the screen simply turns on |
| | + | * If no lock screen security is configured, this trigger fires immediately when the screen turns on |
| | + | * For actions that should run when the screen turns on (before unlock), use the Screen On trigger instead |
| | + | * A static counter is maintained internally to optimize resource usage when multiple macros use this trigger |
| | + | |
| | + | ''' See Also ''' |
| | + | |
| | + | * [[Trigger:_Screen_On/Off|Screen On/Off]] |
| | + | * [[Constraint:_Device_Locked/Unlocked|Device Locked/Unlocked Constraint]] |