question

shhamidi-2358 avatar image
0 Votes"
shhamidi-2358 asked LeonLu-MSFT edited

launch application with xamarin forms from html asp.net core

hi
how can i launch application from browser when pay complete.

dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LeonLu-MSFT avatar image
0 Votes"
LeonLu-MSFT answered LeonLu-MSFT edited

Hello,​

Do you want to click the hyper link in the HTML page, then invoke your application? Am I right?

If yes.

For Android, you can use IntentFilter and set DataScheme to achieve it. For example, my android package name is com.companyname.app24, I add a IntentFilter above MainActivity like following code. Set the package name to DataScheme, set Categories for CategoryBrowsable, it means that Activities that can be safely invoked from a browser

[IntentFilter(new[] { Android.Content.Intent.ActionView }, 
    Categories = new[] { Android.Content.Intent.CategoryDefault, Android.Content.Intent.CategoryBrowsable }, 
    DataScheme = "com.companyname.app24")]
    public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity

Then you can add a hyper link set the href property in your html page like following code.

href="com.companyname.app24://host/"

For iOS, you can try to set Custom URL Scheme , it could achieve the same result.

Best Regards,

Leon Lu



If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.




· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@shhamidi-2358 May I know if you have got any chance to check my answer? I am glad to help if you have any other questions

0 Votes 0 ·