Launch your App via link

If you want to start your App directly via a link, then the contentDock SDK will help you to handle it for you.

Example: sdkOpenTest://abcabs/path?x=abc&y=123

  • sdkOpenTest is set in the target settings of your xCode project in the field URL Schemes. This is defined in the Settings tab Info for the URL Types.

You can access the parameters in your functions as follows:


SDK function: host

Returns the host value as a string from the link.

Example for get the host
if let host = CDockSDK.host() {
    s = "HOST: " + host + "\n"
}
// Print s: HOST: abcabs

SDK function: path

Returns the path value as a string from the link.

Example for get the path
if let path = CDockSDK.path() {
    s = "PATH: " + path + "\n"
}
// Print s: PATH: /path

SDK function: arrParams

Returns the parameter values as an array from the link.

Example for get the parameters
if let params = CDockSDK.arrParams() as? [NSURLQueryItem] {
    let params = params.compactMap{ $0.name + ":" + ($0.value ?? "")}.joined(separator: " , ")
    s = s + "PARAMS: " + params + "\n"
}
// Print s: PARAMS: x=abc , y=123

Feedback or Questions

We are always happy to help you with questions about the code or other questions.

Was this page helpful? Yes No

Topics on this page