Is there any public API apple provides to detect Lockdown Mode in iOS 16?

Hi,

I was testing the lockdown mode in iOS 16 and would like to know whether we can detect the lockdown mode status using any public API that Apple provides.

I really appreciate any help you can provide.

Answered by DTS Engineer in 846699022

Normally I disclaim any ability to predict the future, but it seems that in this case my predictions came true )-:


any update on the bug ?

FB13152209 was closed as ‘not to be fixed’.

Normally, once I see an enhancement request come back this way, I recommend that folks stop filing ERs. However, in this case I have reason to believe that new ERs would be welcome. So, I’m going to repeat my earlier advice: If you continue to need this API, please file an enhancement request explaining your requirements.

IMPORTANT It’s really important to explain how this API would fit into your overall product design. Filing an ER that says “I need this!” is unlikely to get traction. It needs to be “I need this because my app does X and I want to use this API to modify that behaviour to do Y because Z.”

If you do file an ER, please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

When Lockdown mode is enabled, LDMGlobalEnabled default is set in NSGlobalDomain. You can query this with

let isLockdownModeEnabled = (UserDefaults.standard.object(forKey: "LDMGlobalEnabled") as? Bool) ?? false

Ref : https://stackoverflow.com/questions/72956425/is-there-any-public-api-to-detect-lockdown-mode-in-ios-16beta-3#

Do not use undocumented user defaults properties as API. Such properties can and do change over time.

If you have a good reason to know whether Lockdown Mode is enabled, file a enhancement requesting a proper API for this, making sure to include an explanation of what you plan to do with it.

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Is this user default property "LDMGlobalEnabled" to detect lockdown mode has been documented in apple developer documentation as iOS 16 is being released ?

AFAIK nothing has changed in this space since my previous post. If someone had filed a bug and posted the number, I could check on its state, but no one has )-:

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Stumbled upon this today. Thank you, Quinn; happy to file a suggestion for this API: FB13152209.

@eskimo any update on the bug ? any API available to know whether Lockdown Mode enabled or not in device ?

Just an FYI for anyone reading this, for a small number of users, checking for LDMGlobalEnabled fails to properly detect when Lockdown Mode is enabled. iOS 17 and 18, latest versions of both. Never seemed to be an issue with iOS 16, at least no one ever complained the app wasn't detecting it properly.

Normally I disclaim any ability to predict the future, but it seems that in this case my predictions came true )-:


any update on the bug ?

FB13152209 was closed as ‘not to be fixed’.

Normally, once I see an enhancement request come back this way, I recommend that folks stop filing ERs. However, in this case I have reason to believe that new ERs would be welcome. So, I’m going to repeat my earlier advice: If you continue to need this API, please file an enhancement request explaining your requirements.

IMPORTANT It’s really important to explain how this API would fit into your overall product design. Filing an ER that says “I need this!” is unlikely to get traction. It needs to be “I need this because my app does X and I want to use this API to modify that behaviour to do Y because Z.”

If you do file an ER, please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Is there any public API apple provides to detect Lockdown Mode in iOS 16?
 
 
Q