How to restrict access to your iPhone Apps with a Passcode

Nowadays, if you own a smartphone you’re probably used to inputting a passcode each time you open your iPhone – particularly so during the pandemic when our use of Face ID was hampered by wearing masks. However, you may not be aware that there’s also a trick you can use to lock certain apps too. This is particularly useful if you have children who you let play on your phone but whom you don’t want to have access to things like your social media, for example, or if you simply don’t want people snooping on the more private aspects of your life but would still like them to be able to access your phone on the whole. 

Writing the script to lock your apps is quite tricky to do but once it’s done it’s done and you’re in complete control about what you decide to restrict. The process is similar to how a mobile banking app works, verifying your identity when you login by forcing you to input a passcode. If you guess incorrectly, access is restricted. Interested to begin this process? Follow the step-by-step guide below.

How to make a passcode

  1. Firstly, go to the Shortcuts app on your iPhone and tap the ‘+’ button in the top right hand corner and then ‘Add Action’ to begin adding a new shortcut. 
  2. In the search bar type in ‘ask for input’, which you should then see as an option pop up in the middle of the screen next to a question mark icon.
  3. Apple will then show you another screen with a box that says ‘Ask for Text with Prompt’, followed by a drop down arrow. If you click on the word ‘Text’ you’ll be presented with a number of options as to what you can lock your apps with. What you’ll want to do here is select ‘Number’.
  4. Next, press the drop down arrow next to ‘Prompt’ and deselect both the options for ‘decimal numbers’ and ‘negative numbers’.
  5. After you’ve completed this step, tap on the word ‘Prompt’ and replace this manually by typing in ‘Enter Password’, followed by ‘Done’.
  6. Underneath the box you’re currently working in you’ll see the text ‘Next Action Suggestions’ followed by three options ‘Set Variable’, ‘Add to Variable’, and ‘If’. The next step is to tap on ‘If.’
  7. Once you’ve tapped ‘If’ Apple will add another box below the first that will say ‘If ‘Provided Input’ ‘Condition’. 
  8. Then, tap the word ‘Condition’, which will again bring up a menu of options. Here, you want to select ‘is’. 
  9. Finally, input the numerical sequence you want to use as a passcode in the ‘Number’ section in this box and tap ‘Done’ once you’ve chosen your new code. 

How to use this passcode to lock your apps

Following on from the steps above you can now choose which apps you want to lock with this passcode. 

  1. In the search bar underneath the two boxes you’ve been working on in the Shortcuts app you’ll see a search bar. Type ‘Open App’ into the search bar, which should appear as you search for it under a heading called ‘Scripting’.
  2. Once you tap ‘Open App’ this section will be added to your list of boxes at the bottom of the menu of options.
  3. Drag the section ‘Open App’ above the section labelled ‘Otherwise’ by holding down your finger on the screen.
  4. Next, tap on the ‘App’ section and select the app you’d like to lock with a passcode.
  5. Now add another ‘If’ just as you did before. Here, change the ‘If Result’ option to ‘Clear Variable’. This should change the wording of this box to If ‘Input’ ‘Condition’.
  6. Then, get rid of the box ‘Otherwise’ by tapping the ‘x’ on the far right hand side of the box. 
  7. Go back to the second ‘If’ box and tap on the word ‘Input’. This will bring up a menu of options again and you’ll want to choose ‘Select Magic Variable’. 
  8. Following this, tap on ‘Provided input’ this is in a smaller text between the boxes. 
  9. Change the ‘Condition’ to ‘is not’ and then tap the word ‘Number’ and retype the passcode you’ve chosen already before hitting ‘Done’.
  10. Finally, add another action called ‘Show Alert’ using the search bar again and drag this box to below the second ‘If’ box as you did previously by holding down your finger.
  11. Replace the text ‘Do you want to continue?’ to ‘Incorrect Passcode’ and then tap ‘Done’.
  12. Press the drop down arrow on the right next to ‘Incorrect passcode’ and deselect ‘show cancel button’.   

Adding the shortcut to the home screen

  1. If you’ve followed the steps so far, know that you’re nearly finished! All you have to do now is tap the blue icon of three lines in the top right hand corner of the screen and then tap ‘Add to Home Screen’. 
  2. Tap ‘New Shortcut’ to rename the shortcut the name of the app you’ve chosen – for example Netflix. Then tap the icon section highlighted in a blue box and select a photo icon for this app (it can be anything you’d like). If you want to use the regular icon for the app, you will need to save an image from the internet into your camera roll temporarily.  

Will you be using this tool? Let us know in the comments section below. And, if you have any questions or other technology queries, please tweet us at @techtroublesho1.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s