Hi,
I've been attempting to implement a customised shield based on the WWDC contents and documentation; however, while my configuration appears correct only the default "Restricted - You cannot use X app because it's restricted" ever displays.
A quick summary of what I have done:
Created a ShieldConfigurationExtension
Ensured suitable Info.plist values - below
Defined custom Shield within the configuration() methods - application example below
Any suggestions on what might not be implemented correctly?
Info.plist
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.ManagedSettingsUI.shield-configuration-service</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).ShieldConfigurationExtension</string>
</dict>
</dict>
</plist>
Configuration
import ManagedSettings
import ManagedSettingsUI
import UIKit
class ShieldConfigurationExtension: ShieldConfigurationDataSource {
override func configuration(shielding application: Application) -> ShieldConfiguration {
// Customize the shield as needed for applications.
return ShieldConfiguration(
backgroundBlurStyle: UIBlurEffect.Style.systemThickMaterial,
backgroundColor: UIColor.white,
icon: UIImage(systemName: "stopwatch"),
title: ShieldConfiguration.Label(text: "No app for you", color: .yellow),
subtitle: ShieldConfiguration.Label(text: "Sorry, no apps for you", color: .white),
primaryButtonLabel: ShieldConfiguration.Label(text: "Ask for a break?", color: .white),
secondaryButtonLabel: ShieldConfiguration.Label(text: "Quick Quick", color: .white)
)
}
}