Share via

launch application with xamarin forms from html asp.net core

sh hamidi 46 Reputation points
2022-04-28T17:59:55.187+00:00

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

Developer technologies | .NET | Xamarin
0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2022-04-29T07:26:38.307+00:00

    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.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.