Documentation

Configure Universal Links

Set up Apple Universal Links by configuring AASA, deploying, and adding Associated Domains in Xcode.

Configure the Apple App Site Association (AASA) file so iOS opens specific URLs directly in your app.

Prerequisites: A deployed app site and your app’s Team ID + Bundle ID. See the Create & Deploy guide if you haven’t deployed yet.

Steps

  1. Save AASA configuration:

    curl -X PUT https://api.orbitkit.io/api/apps/$APP_ID/aasa \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "universalLinks": {
          "appIDs": ["A1B2C3D4E5.com.example.app"],
          "paths": [
            {"pattern": "/products/*", "exclude": false},
            {"pattern": "/admin/*", "exclude": true}
          ]
        }
      }'
    
    let aasa: [String: Any] = [
      "universalLinks": [
        "appIDs": ["A1B2C3D4E5.com.example.app"],
        "paths": [
          ["pattern": "/products/*", "exclude": false],
          ["pattern": "/admin/*", "exclude": true]
        ]
      ]
    ]
    var request = URLRequest(url: URL(string: "https://api.orbitkit.io/api/apps/\(appId)/aasa")!)
    request.httpMethod = "PUT"
    request.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
    request.setValue("application/json", forHTTPHeaderField: "Content-Type")
    request.httpBody = try JSONSerialization.data(withJSONObject: aasa)
    
    let (data, _) = try await URLSession.shared.data(for: request)
    
    const res = await fetch(
      `https://api.orbitkit.io/api/apps/${appId}/aasa`,
      {
        method: "PUT",
        headers: {
          Authorization: `Bearer ${token}`,
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          universalLinks: {
            appIDs: ["A1B2C3D4E5.com.example.app"],
            paths: [
              { pattern: "/products/*", exclude: false },
              { pattern: "/admin/*", exclude: true },
            ],
          },
        }),
      }
    );
    
  2. Deploy to publish the AASA file:

    curl -X POST https://api.orbitkit.io/api/apps/$APP_ID/deploy \
      -H "Authorization: Bearer $TOKEN"
    
    var request = URLRequest(url: URL(string: "https://api.orbitkit.io/api/apps/\(appId)/deploy")!)
    request.httpMethod = "POST"
    request.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
    
    let (data, _) = try await URLSession.shared.data(for: request)
    
    const res = await fetch(
      `https://api.orbitkit.io/api/apps/${appId}/deploy`,
      {
        method: "POST",
        headers: { Authorization: `Bearer ${token}` },
      }
    );
    

    The AASA file is served at https://your-site/.well-known/apple-app-site-association.

  3. Add the Associated Domains capability in Xcode:

    • Go to Signing & Capabilities > + Capability > Associated Domains
    • Add applinks:your-site-slug.orbitkit.io (or your custom domain)

Notes