I am using Universal linking in my application.
I want the functionality like this:-
Enable Associated domains in both Xcode and developer account.
Xcode associated domain contains: applinks:laundry.com
Push apple-app-site-association into server with code :
{"applinks": {"apps": [],
"details": [{"paths": ["*"],
"appID": "Sm4Gn629J2.com.LaundryLive"}]}}
This is the code used in AppDelegate class, but it is not working. Please help me.
//Universal links in swift delegatemethod.
func application(_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([Any]?) -> Void) -> Bool
{
if userActivity.activityType == NSUserActivityTypeBrowsingWeb {
let url = userActivity.webpageURL!
let userurl = url.absoluteString
// print(url.absoluteString)
//handle url
if userurl != "", defaultValues.value(forKey: accessToken) != nil
{
print("user url is:",userurl)
let mainStoryboard: UIStoryboard = UIStoryboard(name: "Pickup", bundle: nil)
let innerPage: PickupController = mainStoryboard.instantiateViewController(withIdentifier: "PickupController") as! PickupController
innerPage.selectedfrom = "Deeplink"
self.window?.rootViewController = innerPage
}else{
setRootControllerBeforeLogin()
}
}
return true
}