Deep Link AppDelegate.cs

KenNickersonKenNickerson USMember ✭✭✭

Hello -

I am trying to implement a deep linking option for our app. I have the server side pretty well understood. I read the article by @AdamP which helped tremendously. Below is the sample provided however, I cannot see how to interrogate the useractivitiy value for a specific value and from there navigate to the appropriate Xamarin forms view.

Thank you

Best Answer


  • KenNickersonKenNickerson USMember ✭✭✭

    public override bool ContinueUserActivity(UIApplication application, NSUserActivity userActivity, UIApplicationRestorationHandler completionHandler)
    return base.ContinueUserActivity(application, userActivity, completionHandler);

  • AdamPAdamP AUUniversity ✭✭✭✭✭

    @KenNickerson - which article are you referring to? Then I can probably help you out further.

  • KenNickersonKenNickerson USMember ✭✭✭

    Hi @AdamP

    I was referring to the IOS deep linking article:

    I had a question, although the IOS deep linking solution appears to be very straight forward. My question is in the ContinueUserActivity, what does the code look like to parse the URL for a specific string and if a specific string was found, however to navigate back to the PCL to open the desired back. I assume if you did nothing, it would just default to the home page.

    I need to do it for Android and that seems to be much more work. I have read through several articles. I found one where the intent was placed in the manifest XML and another where the intent was done in C#. Not sure if both are needed or one is preferred over the other. Beyond that, I am not sure what else is required. Where in project should that code be placed. I was hoping to find one place which showed the complete solution but not sure I have found that. I saw your article on the subject:

    What confused me there was the "Creating Deep Links" section. Where is that connected to the Website URL? The OnAppLinkRequestReceived seems more straight forward where by it would be placed in the App.xaml.cs. TI assume the URI can be parsed and from there it is a matter of Navigating to the appropriate View.

    Thank you Adam

Sign In or Register to comment.