LogoLogo
  • PAVE OpenAPI Overview
  • How PAVE Works
    • Capture Link
    • Guided Capture
    • Customer Disclosures
    • Identified Vehicle Information
    • Captured Photos
    • Text Notifications
    • Inspection Results
    • Condition Report (PDF)
    • Detected Damages
    • Grading
    • Languages
    • Accuracy & Limitations
  • INTEGRATIONS
    • Developer Docs
      • Authentication
        • Generate Access Token
      • Sessions
        • POST Create Session
        • GET Session Data
        • GET Session Photos
        • GET Session Notes
        • GET Session Results
        • PUT Update Session
        • DELETE Session
      • Webhooks
        • GET All Callbacks
        • GET View a Callback
        • POST Create New Callback
        • PUT Update a Callback
        • DELETE a Callback
      • Deep Linking
        • Deep Link with React Native App
        • Deep Link Native App
        • Deep Linking with Shareable Links
      • Pass-Through Additional User Information
      • Tracking Your Sessions
      • User Session Lifecycle
      • Developer Testing
    • Account Optional Add-ons
      • Capture Only Theme (CAPT)
        • Skip Pictures
      • Right-Hand-Drive Capture Flow
  • MANAGING YOUR ACCOUNT
    • Your Guide to PAVE's Account and Enterprise Dashboards
  • Hotspots
    • PAVE Hotspots API
    • Activating PAVE Hotspots
    • Developer Docs
      • Authentication
        • Generate Access Token
      • Sessions
        • POST Create Session
        • POST Upload Photos
        • GET Results
  • OTHER RESOURCES
    • PAVE Capture Troubleshooting Guide
      • iPhone (iOS) Issues
        • Does my mobile phone work with PAVE?
        • Can't Access Camera - Incorrect Web Browser Usage
        • Can't Access Camera - Camera Permission Not Enabled
        • Camera Screen is Locked and won't Rotate
        • Inspection Get's Stuck
        • Inspection Won't Begin or Complete
        • Getting Back to an In-Progress Inspection
        • Why do I keep getting asked to retake pictures?
      • Android Phone Issues
        • Does my mobile phone work with PAVE?
        • Can't Access Camera - Incorrect Web Browser Usage
        • Can't Access Camera - Camera Permission Not Enabled
        • Camera Screen is Locked and won't Rotate
        • Inspection Gets Stuck
        • Inspection Won't Begin or Complete
        • Getting Back to an In-Progress Inspection
        • Why do I keep getting asked to retake pictures?
    • Policies
      • Service Level Agreement and Standards
      • Service Delivery Sub-Processors & Processors
      • API Strategy and Architecture
      • Information Security Policy
        • Data Quality Guideline
        • Data Retention Policy
        • Backup and Disaster Recovery
        • Data Residency
        • Data Access Control
Powered by GitBook
On this page
  • Setting up for iOS
  • 1. Adding a URL scheme
  • 2. Define your deep links
  • 3. Handle URLs
  • 4. Test
  • Setting up for Android
  • 1. Add intent filters for incoming links
  • 2. Read data from incoming intents
  1. INTEGRATIONS
  2. Developer Docs
  3. Deep Linking

Deep Link Native App

Follow the steps to set up deep-linking for your app.

PreviousDeep Link with React Native AppNextDeep Linking with Shareable Links

Last updated 2 years ago

Setting up for iOS

1. Adding a URL scheme

Open up your project and go to Targets > Info > URL Types and add the following:

Change com.discoveryloft.pavejs to your project's identifier

2. Define your deep links

We are going to support two deep links into the app:

  • pave://home

  • pave://detail

And we will represent the host part of the URL in an enum.

DeepLink.swift

import Foundation

enum DeepLink: String {
    case home
    case detail
}

3. Handle URLs

To handle the URL we need to go into our AppDelegate.swift and parse the incoming request, and convert it into a DeepLink that we can hand off to our MainViewController for processing.

AppDelegate.swift

 func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {  
        // Process the URL.
        guard let components = NSURLComponents(url: url, resolvingAgainstBaseURL: true),
              let host = components.host else {
            print("Invalid URL")
            return false
        }
                
        print("components: \(components)")
        
        // Create the deep link
        guard let deeplink = DeepLink(rawValue: host) else {
            print("Deeplink not found: \(host)")
            return false
        }

        // Hand off to mainViewController
        mainViewController.handleDeepLink(deeplink)
        
        return true
    }

Once in the MainViewController with the deeplink we can do whatever we want. Here we just manually navigate to the view controller in the tab bar we want to present.

MainViewController.swift

// MARK: Deep Link

extension MainViewController {
    func handleDeepLink(_ deepLink: DeepLink) {
        switch deepLink {
            case .home:
                // handle show your app's home screen here
            case .detail:
                // handle show your app's detail screen here
            default:
                // handle the PAVE's Session ID here
        }
    }
}

4. Test

You can try deeplinking into your app by firing up Safari in your simulator and enter URL in there (i.e. pave://home).

Or an even better way is to execute deeplinks from the command line while your simulator is running with this command here:

xcrun simctl openurl booted pave://home

Setting up for Android

1. Add intent filters for incoming links

To create a link to your app content, add an intent filter that contains these elements and attribute values in your manifest:

 <application
        ...>

        <activity
            android:name=".MainActivity"
            android:label="MainActivity" >
            
             <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            
            <intent-filter android:label="PAVE Filter">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!-- Accepts URIs that begin with "pave://...” -->
                <data android:scheme="pave" />

            </intent-filter>
        </activity>

   </application>

2. Read data from incoming intents

Here’s a snippet that shows how to retrieve data from an Intent:

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.main)

    val appLinkAction: String? = intent?.action
    val appLinkData: Uri? = intent?.data
    
    if (Intent.ACTION_VIEW == appLinkAction && appLinkData != null) {
      val sessionId = appLinkData.getQueryParameter("sessionId")
      if (sessionId.isNullOrBlank().not()) {
        // handle the PAVE's Session ID here
      }
      
    }
}

, the autoVerify attribute “allows your app to designate itself as the default handler of a given type of link. So when the user clicks on an Android App Link, your app opens immediately if it's installed — the disambiguation dialog doesn't appear.”

According to Google