When I tap on one of the buttons in the ShieldAction extension I want open the parent app Is there any way of doing this using the Screen Time API?
class ShieldActionExtension: ShieldActionDelegate {
override func handle(action: ShieldAction, for application: ApplicationToken, completionHandler: @escaping (ShieldActionResponse) -> Void) {
// Handle the action as needed.
switch action {
case .primaryButtonPressed:
if let appURL = URL(string: "xxxx://") {
//open parent app
}
completionHandler(.none)
case .secondaryButtonPressed:
completionHandler(.close)
@unknown default:
fatalError()
}
}
.....
}
This tells me it can’t be done
Open parent app from ShieldAction extension in iOS
https://apps.apple.com/us/app/app-lock/id6448239603
But This app does it. Does anyone know how to do it
i try use UIApplication.share.openURL, but not support
New contributor
can zhou is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.