{"message":"Required fields are missing or invalid.","errors": {"session.redirect_url": ["Invalid redirect url" ],"sms.to": ["Invalid phone number" ],"vehicle.vin": ["VIN is too short, it must be 17 characters" ] }}
According to Google, 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.”
Handle URLs
There are two ways to handle URLs that open your app.
1. If the app is already open, the app is foregrounded and a Linking 'url' event is fired
You can handle these events with Linking.addEventListener('url', callback) - it calls callback({ url }) with the linked URL
2. If the app is not already open, it is opened and the url is passed in as the initialURL
You can handle these events with Linking.getInitialURL() - it returns a Promise that resolves to the URL, if there is one.
Example
App.js
/* This is the example code */import React, {useEffect, useState} from'react';import {Linking} from'react-native';import {View, Text} from'react-native';constApp= () => {const [url,setUrl] =useState('');useEffect(() => {Linking.getInitialURL().then(url =>handleURL({url})).catch(console.error);Linking.addEventListener('url', handleURL); }, []);functionhandleURL(event) {/***********************************//* HANDLE THE URL IN THIS FUNCTION *//***********************************/setUrl(event.url);console.log('url ======> '+event.url); }return ( <Viewstyle={{justifyContent:'center', flex:1, alignItems:'center'}}> <Text>PAVE DEEP LINK: {url}</Text> </View> );};exportdefault App;
Result
After PAVE Capture successfully and tap on CLOSE button, you will redirect to your app.
Test
iOS
You can try deeplinking into your app by firing up Safari in your simulator and enter URL in there (i.e. pave://).
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://
Android
Execute deeplinks from the command line while your simulator is running with this command here:
adb shell am start -a android.intent.action.VIEW -d "pave:\\" <your-app-package-name>