3

I have written two Apps, let's call them A and B.

When the user does a special action inside a fullscreen-displayed app A I want app B to automatically open in split screen next to app A.

In this WWDC session, I learned that this is now possible within one app with multiple scenes using this function: requestSceneActivation(_:userActivity:options:errorHandler)

But is this somehow possible to do using two apps?

heyfrank
  • 5,291
  • 3
  • 32
  • 46
  • No it isn’t. Why would it be? You are sandboxed. – matt Dec 09 '19 at 16:31
  • 1
    This would not impair sandboxing security. It could be like an app launching parameter that I can set in my app. If my app ist just a small utility app and I start it from the dock whilst another one is opened, it could be opened in splitscreen by default. And I could offer other apps to open my app in splitscreen by a custom url scheme for example. But maybe this is more like a feature request for iPadOS 14. It would make much more sense if apps could start in overlay mode or a small window from the homescreen. – heyfrank Dec 09 '19 at 17:17
  • Try creating a URL. Apps can call other apps this way. The only example I can think of at the moment is the `tel://` URL used to make a phone call within an app. Will see if I can find the details for you... – leanne Dec 16 '19 at 15:47

3 Answers3

1

Apple has Sandboxed all its apps. So you can't do it as of now! Maybe Apple will provide this functionality in future.

Thank you!

Om Rajpurkar
  • 33
  • 11
0

Apps are displayed in Views and you can only control what is happening in your view. Apps are sandboxed and are unable to open up other apps to be adjacent however you can call another app to replace your view.

Osian
  • 171
  • 1
  • 14
0

Search for information on "deep linking", "universal links", custom URLs, and "URL schemes".

Here's an SO question and answers related to the subject: url - iOS deep linking

Also, see the developer documentation "About Apple URL Schemes"

Or, Handling Universal Links

And, Allowing Apps and Websites to Link to Your Content

Another: Defining a Custom URL Scheme for Your App

I will try to update this answer with some examples in a bit, but I wanted to give you something to consider while I find them... (links accessed as of 16 Dec 2019)

Update: from the custom URL scheme article, first, you would create your own URL for clients to use when calling your app. Example:

myphotoapp:albumname?name=”albumname”
myphotoapp:albumname?index=1

Next, you would "register" your URL scheme in the "info" tab of your project's settings in Xcode, under the URL Types section. Here, you're relating your app to the URL scheme (eg, "myphotoapp").

Then, you would handle the incoming URL actions. Quote:

The system delivers the URL to your app by calling your app delegate’s application(_:open:options:) method. Add code to the method to parse the contents of the URL and take appropriate actions.

And, finally, check out the Always-Updated List of iOS App URL Scheme Names, again, last accessed 16 Dec 2019. Examples from that site are Apple-created deep links that include:

  • make a phone call from your app:
contact = tel://TheirPhoneNumber
contact = telprompt://TheirPhoneNumber
  • opening Notes:
Open = mobilenotes://

Update 2: SO help for finding URL schemes of other apps: iOS - Find the URL scheme of an app on my iPhone - might work for iPadOS, too... Suggestions include using an app called "Iconical", using the device console and Springboard info, and more...

leanne
  • 7,940
  • 48
  • 77
  • This does not answer the question at all. The question is about opening another app in split view, not just opening another app. – JoniVR Mar 16 '23 at 07:30
  • @JoniVR: you're right... some of the other answers were saying that you couldn't access a separate app from within your own because of sandboxing. That isn't (and wasn't) true. So, if one could open the 2nd app from their own app, the next step would be to set it to split view. I didn't get around to covering that aspect way back then. And, at least in Unit Testing, using `Springboard` allows one to manipulate the device outside of one's app. Therefore, it might be a way to set up split view in this case, though I sadly never got around to trying it. – leanne Mar 16 '23 at 15:38
  • @JoniVR: it would make sense that `Springboard` couldn't be used in production apps. That would allow for malicious actions, I'm sure. There is a `SpitViewController`, but that's for splitting an apps own views. So, it looks like even now, in 2023, there's no way to actually open two apps in split view on the device itself. – leanne Mar 16 '23 at 15:56