Is there a way to use intent filters with Forms

I would like to launch a particular content page from an intent filter. Any ideas how I can do this?

Thanks

Posts

  • adamkempadamkemp USInsider, Developer Group Leader mod

    Xamarin.Forms currently uses a single Activity so it would be difficult. I think you may be able to look at the intent and decide which page to use as your "main page", though. I'm not sure what would happen if your app was already running, though. You may end up with two activities running with the same UI. That could be weird.

  • RyanHatfieldOldRyanHatfieldOld USMember, Insider ✭✭✭
    edited November 2014

    I use the Device.OpenUri(Uri uri) with good results ... passing in things like "mailto:[email protected]" or "tel:1234568903" .. I think you can do local files the same way and let each device handle them as if they were opening the file from a browser.

    Aside from that, you'll need to make a Dependency Service

    Totally misunderstood the question.

    You'll need to catch the intent filter from each platform on platform specific code then pass the page you want to shared code. For that I don't have any code examples.

    Ryan

  • RyanHatfieldOldRyanHatfieldOld USMember, Insider ✭✭✭

    You may end up with two activities running with the same UI. That could be weird.

    You can get around this in Android by adding a LaunchMode to your Activity Annotation

    [Activity( { ... normal stuff ... }, LaunchMode = LaunchMode.SingleInstance)]
    

    Ryan

  • adamkempadamkemp USInsider, Developer Group Leader mod

    Ah, good tip! Thanks!

  • uwantfriesuwantfries GBBeta ✭✭

    Thanks for the hints. I shall have a look and try and get it working.

Sign In or Register to comment.