Initialize BlazorWebView on Android in the background

John Graumann 0 Reputation points
2024-02-15T16:47:04.3233333+00:00

We have a Blazor Hybrid application that uses WebRTC for voice calling. The WebRTC calling piece runs as javascript hosted in the BlazorWebView. We are attempting to connect calls when the app is not started/running. We have setup push notifications to notify the user of the incoming call, and the push notification successfully starts the application in the background. However, it looks like the BlazorWebView is not initialized until MainActivity is created, so we can't actually begin the process of connecting the call until the user opens the app and brings it to the foreground. Is there a way to initialize the BlazorWebView explicitly on app startup without requiring that MainActivity be created first?

Developer technologies .NET Blazor
Developer technologies .NET .NET MAUI
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2024-02-15T18:45:27.77+00:00

    no. the webview is a UI component and is created by the hosting foreground activity. A better design would be to have the hosting app access the telecom sdk, and expose to the Blazor app.

    https://developer.android.com/develop/connectivity/telecom/selfManaged


Your answer

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