Closed PhilippRoessner closed 2 years ago
You're missing the namespace import (you could fully qualify it like below)
public class WebAuthenticatorCallbackActivity : global::Microsoft.Maui.Authentication.WebAuthenticatorCallbackActivity
@Redth thanks, I tried that but it's still not working with the same errors. What would be the namespace for the class attributes?
I have the same issue
Hi @PhilippRoessner,
I found the solution. You have to add
Exported = true in Activity attribute.
[Activity(NoHistory = true, LaunchMode = LaunchMode.SingleTop, Exported = true)]
[IntentFilter(new[] { Intent.ActionView }, Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable }, DataScheme = "yourscheme")]
public class WebAuthenticationCallbackActivity : WebAuthenticatorCallbackActivity
{
}```
@shurkin YES! Thanks, it's working now :-)
I still get this error using RC2. I just switched to copying the strings as literals
That being said it's still not working for me. i still get an error when trying to login:
System.InvalidOperationException: You must subclass the `WebAuthenticatorCallbackActivity` and create an IntentFilter for it which matches your `callbackUrl`.
at Microsoft.Maui.Authentication.WebAuthenticatorImplementation.AuthenticateAsync(WebAuthenticatorOptions webAuthenticatorOptions) in D:\a\_work\1\s\src\Essentials\src\WebAuthenticator\WebAuthenticator.android.cs:line 63
at App.Features.Login.WebAuthenticatorBrowser.InvokeAsync(BrowserOptions options, CancellationToken cancellationToken)
I don't understand do I need to link the activity somewhere on startup? why can I not find any docs on this?
Description
When subclassing the WebAuthenticatorCallbackActivity, I get a lot of errors like "The type or namespace name '....' could not be found(are you missing a using directive or an assembly reference?)
Steps to Reproduce
Version with bug
Release Candidate 1 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
12
Did you find any workaround?
no
Relevant log output
No response