Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

How can I access the values passed into my app via a custom url scheme from within my C# code

$
0
0

Hello,

I'm working on a Xamarin Forms application. It has an Entry field for the visit code on the initial page. I need to extend its functionality so that the application will open when a custom url scheme myscheme://visitcode is encountered, and the Entry will have its Text value prepopulated with the value of visitcode.

I've had success with getting the application to launch.

I added my scheme to the info.plist file in my iOS project, and it properly launches the app when I click on my custom url scheme in Safari on an iPhone.

I added the following line above my MainActivity in my Droid project:

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

It properly launches the app when I click on my custom url scheme in Chrome on an Android phone.

The only remaining obstacle is to retrieve the value and populate the Entry field with it.

Can someone help me?


Viewing all articles
Browse latest Browse all 77050

Trending Articles