From the course: iOS Development: Architecture

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Passing parameters between apps

Passing parameters between apps

From the course: iOS Development: Architecture

Start my 1-month free trial

Passing parameters between apps

- [Instructor] Besides opening an app from the browser or from another app, URL schemes let us pass basic data to the target app. We can pass parameters along with the custom URL in the form of a query string. Query strings may be familiar to you. There are fields added to the base URL. The question mark denotes the beginning of a query string. Notable query parameters are separated by the ampersand sign. So we're going to enhance both the Invoker and the ListenerApp. That will allow them to send and receive query parameters. First, the InvokerApp. Let's switch to the View Controller and I add a message parameter to the base URL like this. The space can be part of a URL, so I had to URL encode it. We're not finished yet. The ListenerApp requires some additional coding to retrieve the parameters. So let's switch to the ListenerApp. We need to implement the application open URL method in the app delegate. The system cause this delegate method whenever a URL is sent to the app. So here's…

Contents