Access native functionalities in .Net MAUI Blazor app with embedded Angular application

Varpe, Nitin 0 Reputation points
2023-01-24T09:12:41.6566667+00:00

Hi,

We are working on creating a mobile application using .Net MAUI Blazor as technology. We were trying different approach

  1. Load dist folder of Angular application build into Blazor application
  2. Load direct angular application through weburl

We were trying to find how we can access native functionality with above two approaches e.g. Finger Print support, opening up camera from application. Will be be able to access such native functionalities with these approaches?

Other approaches are to use either MAUI XAML native app or MAUI Blazor Hybrid app. With these two approaches what all native functionalities we will be able to use?

Thanks,

Nitin Varpe

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,374 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,390 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,868 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
765 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,021 Reputation points
    2023-01-24T18:06:09.0266667+00:00

    a Blazor application is either hosted on the server or browser WASM sandbox. in neither case does it have direct access to the browser api. it calls javascript to interface with the browser api. this mean it has no more browser capabilities than javascript or your current angular code.

    most mobile browsers have some access to the camera, but bio metrics has limited support.

    media:
    [https://developer.mozilla.org/en-US/docs/Web/API/Media_Capabilities_API
    payment android:
    [https://developer.mozilla.org/en-US/docs/Web/API/Media_Capabilities_API
    payment apple: [https://developer.apple.com/documentation/apple_pay_on_the_web/choosing_an_api_for_implementing_apple_pay_on_your_website

    if you need native api support, you will need to create a mobile application. a common approach is to host the html/css/javascript code in webview. this is how hybrid blazor works.

    you can look at NativeScript or ionic frameworks for building a hybrid angualar app.

    [https://nativescript.org/
    [https://ionicframework.com/

    note: My team has used this approach before and also native react. We found keeping the tool chains current and running more work than actually using the native toolkits (swift/swiftui & kotlin/jetpack).

    0 comments No comments