[HELP] Xamarin Forms DeepLinking (iOS/Android)

edited January 2017 in Xamarin.Forms

Hi guys! I need some help on Xamarin Forms (IOS/ANDROID) about Applinks (deeplinking)...
I don't need to do any type of indexing using AppLinkEntry, i just need to do something if a URL on a mail or site is tapped. i've already installed the last build of XF and Applinks for android and setup the App.cs with the method OnAppLinkRequestReceived...

the link i want to react to is like appname://contents/type?id=56

I don't understand how to correctly register the url to react to this link firing the method above...then the parse of the uri and navigation to page it'll not be a problem.
I followed a lot of different example of intent, but it never worked for me...can someone explain how to setup this? and explain how to test it properly because probably i'm doing something wrong.

i have 2 activities on Android platform: SplashActivity.cs and MainActivity.cs...the splash activity launches the main than it finish execution. I've also added the applinks init after the forms init.
On iOS platform i didn't add additional code...

On Android i've added an intent like this in MainActivity.cs under the main activity tag description:

[IntentFilter(new[] { Intent.ActionView },
Categories = new[] {
DataScheme = "appname")

On iOS info.plist

key CFBundleURLTypes /key
key CFBundleURLName /key
string bundlename /string
key CFBundleURLTypes /key
string Viewer /string
key CFBundleURLSchemes /key
string appname /string

Thank you for your answers!

Sign In or Register to comment.