Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAUI support #413

Closed
pekspro opened this issue Apr 16, 2022 · 14 comments · Fixed by #486
Closed

MAUI support #413

pekspro opened this issue Apr 16, 2022 · 14 comments · Fixed by #486
Assignees
Labels
Kiota Is solved by Kiota or will be addressed in Kiota Request: enhancement New feature or request
Milestone

Comments

@pekspro
Copy link

pekspro commented Apr 16, 2022

Currently, this SDK doesn't work well on Android with MAUI, see details here (and a workaround): dotnet/maui#3903

Is there any plans to add support for MAUI?

@ghost ghost added the ToTriage label Apr 16, 2022
@edoust
Copy link

edoust commented Apr 19, 2022

It also does not work on MacCatalyst

@dm-pr
Copy link

dm-pr commented May 9, 2022

Experiencing the same issue while targeting only Android and Windows in my MAUI app.

Workaround described in issue dotnet/maui#3903 still works, but the conclusion in that thread was that net6. iOS lib was the problem. I am targeting only Android and Windows and still issue exists.

System.TypeLoadException: 'Could not resolve type with token 01000023 from typeref (expected class 'System.Threading.Tasks.ValueTask`1' in assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e')'

This is my test code:



var pc = PublicClientApplicationBuilder.Create("--CLIENT--ID--")
		.WithAuthority("https://login.microsoftonline.com/--TENANT--ID--/")
		.WithDefaultRedirectUri()
		.Build();


	var t = await pc.AcquireTokenInteractive(new string[] { "User.Read" })
		.WithPrompt(Microsoft.Identity.Client.Prompt.ForceLogin)
#if ANDROID
		.WithParentActivityOrWindow(Platform.CurrentActivity)
#endif
		.ExecuteAsync();


	var graphClient = new GraphServiceClient("https://graph.microsoft.com/beta", null);


	graphClient.AuthenticationProvider = new DelegateAuthenticationProvider(async (request) => {
		request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", t.AccessToken);
		await Task.FromResult<object>(null);
	});


	var resp = await graphClient.Me.Request().GetAsync();

	uLabel.Text = resp.DisplayName;

this code works fine on Windows, but not on Android

@tipa
Copy link
Contributor

tipa commented Jun 12, 2022

Hitting the same issue. Any updates on this?

@tipa
Copy link
Contributor

tipa commented Jun 20, 2022

This is currently blocking me to migrate my projects to MAUI / Android for .NET - would appreciate a short comment so that I can decide if I should wait for a compatible SDK version or if I have to rewrite MS Graph HTTP access myself

@maisarissi
Copy link

@andrueastman can you take a look at this issue? Thanks.

@andrueastman
Copy link
Member

We will be looking into adding the net6.0-ios and MAUI build targets in the upcoming preview releases for Kiota.

@andrueastman andrueastman added this to the Kiota milestone Jul 18, 2022
@NPadrutt
Copy link

Is there an update or ETA for this?

@maisarissi maisarissi added the Kiota Is solved by Kiota or will be addressed in Kiota label Aug 18, 2022
@andrueastman andrueastman linked a pull request Aug 24, 2022 that will close this issue
@andrueastman
Copy link
Member

Closed via #486

@NPadrutt
Copy link

Is there a preview version for this planne? As far as I can see the latest preview is from last month and does not contain this yet.

@edoust
Copy link

edoust commented Sep 27, 2022

@andrueastman
Is there a planned release date for graph sdk v5 or any kind of roadmap that I could look at to track the progress?

@maisarissi
Copy link

Hi @NPadrutt . Microsoft Graph .NET SDK service library 5.0.0-preview.11 that take advantage of core 3.0.0-preview.13 has support for MAUI.

@NPadrutt
Copy link

@maisarissi thanks for the info. I actually tried to already update to the preview but it broke my WinUI app with weird build issues.
Given that and that I was blocked by the lack of MAUI support I went the route of replacing the Graph SDK and just consume the API directly.

@maisarissi
Copy link

We would love to get any feedback you might have after trying the 5.0.0-preview.11 if you may consider using the SDK.

@maisarissi
Copy link

@edoust the target is to GA before the end of the year :) We believe the version we have so far, it's robust and stable enough. We are validating some scenarios, but we should be good to go soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Kiota Is solved by Kiota or will be addressed in Kiota Request: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants