How to open parent app from `ShieldActionDelegate`

Hello,

I think it is quite a common use-case to open the parent app that owns the ShieldActionDelegate when the user selects an action in the Shield.

There are only three options available that we can do in response to an action:

  • ShieldActionResponse.none
  • ShieldActionResponse.close
  • ShieldActionResponse.defer

It would be great if this new one would be added as well:

  • ShieldActionResponse.openParentApp

While finding a workaround for now, the problem is that the ShieldActionDelegate is not a normal app extension. That means, normal tricks do not work to open the parent app from here.

For example, UIApplication.shared.open(url) does not work because we can’t access UIApplication from the ShieldActionDelegate unfortunately.

NSExtensionContext is also not available in the ShieldActionDelegate unfortunately, so that’s also not possible.

There are apps however, that managed to find a workaround, in my research I stumbled across these two:

Please find a screen recording (gif) attached.

Their workaround is 100% what I’m looking for, so there MUST be a way to do so that is compliant with the App Store guidelines (after all, the apps are available on the App Store!).

I had documented my feature request more than 2 years ago in this radar as well: FB10393561

Answered by Engineer in 810713022

There is not a supported way to do this. Some apps may have figured out ways to call up private API that should be rejected in App Review. The best course would be to file an Enhancement Request for API to do this.

I am having the same issue. Can anyone explain how are these apps doing it?

There is not a supported way to do this. Some apps may have figured out ways to call up private API that should be rejected in App Review. The best course would be to file an Enhancement Request for API to do this.

This company is now selling this exact functionality as an SDK: https://www.wellspent.so

It seems a little silly to pay a company for an sdk of functionality that is a 10 minute WWDC video.

That said, the opening the parent app with a button tap seems to be one piece of functionality that doesn't seem to be available out of the box in the Screen Time apis.

Were you ever able to find a work-around? It seems like there might be something possible from within the DeviceActivityMonitorExtension instead of the ShieldActionDelegate?

company is now selling this exact functionality as an SDK

Is the "Open Parent App" functionality included – without using a local push notification?

For them it’s easy to distribute private API because they don’t have to deal with app review or are risking their developer account from being banned.

This is the feedback I have received from Apple:

  1. There is private API to do this (and it works)
  2. But you will have your developer account banned when app review discovers this.
  3. There are apps on the store using this private API for many years – without consequences.

I would recommend to wait until there’s an official API (maybe next month at WWDC??)

@Quappi It seems like in the app they have on the App Store they are able to do this without push notification permissions. Tapping on the button immediately opens the parent app. That said, you're right they might be using some private API that has the potential to get rejected.

If I did go the push notification route it seems like what would happen is the user taps on a button on the shield, then a push notification would come up for them and they would tap on that to open the app. Is there a way to implement local push notifications so the app get's opened immediately instead of the user needing to see a push notification and tap on it?

I agree, we'll likely wait until next month anyway just to see if the API or sdk changes significantly during WWDC.

How to open parent app from `ShieldActionDelegate`
 
 
Q