I have implemented deep linking for Android and iOS, below method works perfectly with android but I am facing problem with iOS.
It navigates to the page of app link but comes back to main screen automatically.
Below is the implementation of my method. I have followed everything from MSDN for deep linking.
protected override async void OnAppLinkRequestReceived(Uri uri)
{
string appDomain = "https://" + "mydomain.com".ToLowerInvariant() + "/";
if (!uri.ToString().ToLowerInvariant().StartsWith(appDomain, StringComparison.Ordinal))
return;
string pageUrl = uri.ToString().Replace(appDomain, string.Empty).Trim();
var parts = pageUrl.Split('?');
string page = parts[0];
string pageParameter = parts[1].Replace("id=", string.Empty);
var formsPage = Activator.CreateInstance(Type.GetType(page));
var jobItemPage = formsPage as JobDetail;
if (jobItemPage != null)
{
jobItemPage.BindingContext = new JobDetailViewModel(int.Parse(pageParameter));
await MainPage.Navigation.PushAsync(formsPage as Page);
}
base.OnAppLinkRequestReceived(uri);
}
Below is my apple-app-site-association file:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "MyTeamIdPrefix.com.deepLinking",
"paths": [ "*" ]
}
]
}
}