Maui Hybrid Power Bi embeded report ios issue

Sergey 5 Reputation points
2023-08-29T11:41:43.5266667+00:00

What is a proper way to configure power bi reports on ios for Maui blazor hybrid app.

My current solution works in web, win, android but not in IOS, on IOS it opens power bi report iframe in safary(instead of rendering in app web view) and does not show anything except loading icon.

i'm using PowerBIService from this example https://github.com/southworks/powerbi-samples/tree/main/samples/power-bi-embedded/src/Demo.Web

on client using powerbi-client v2.22.2 (powerbi.min.js)

my componet looks following way:

window.showMyPowerBI = function (reportContainerId, accessToken, embedUrl, embedReportId) {     
	var reportContainer = document.getElementById(reportContainerId);      
	// Get models. models contains enums that can be used.     
	var models = window['powerbi-client'].models;      
	var config = {         
		type: 'report',         
		tokenType: models.TokenType.Embed,         
		accessToken: accessToken,         
		embedUrl: embedUrl,         
		id: embedReportId,         
		permissions: models.Permissions.All,         
		settings: {             
			filterPaneEnabled: true,             
			navContentPaneEnabled: true         
		}     
	};      
	// Embed the report and display it within the div container.     
	powerbi.embed(reportContainer, config); 
};
@inject MauiApp1.Data.PbiEmbedService PbiService 
@inject IJSRuntime JS  

<div id="report-container" style="height:100%;"> </div>  

@code {     
	
	protected override async Task OnAfterRenderAsync(bool firstRender) {         
		if (firstRender) {             
			var reportInfo = PbiService.GetEmbedParams({myworkspaceid}, {myreportid});              

			await JS.InvokeVoidAsync("showMyPowerBI", "report-container", reportInfo.EmbedToken.Token, 		
		  		reportInfo.EmbedReport[0].EmbedUrl, reportInfo.EmbedReport[0].ReportId);         
		}     
	} 
} 

Thanks in advance for any help.

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,503 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,240 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Boorlagadda, Chaitanya 0 Reputation points
    2023-09-26T14:22:46.1866667+00:00

    HI Sergey,

    I am working to build a mobile app for powerbi embedded can you please share a sample code?

    0 comments No comments