-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[WebAuthenticator] NullReferenceException on CallbackResult #3760
Comments
Same problem occurs:
[Activity(NoHistory = true, LaunchMode = LaunchMode.SingleTop)]
[IntentFilter(new[] { Android.Content.Intent.ActionView },
Categories = new[] { Android.Content.Intent.CategoryDefault, Android.Content.Intent.CategoryBrowsable },
DataScheme = CALLBACK_SCHEME)]
public class MyWebAuthenticatorCallbackActivity : Microsoft.Maui.Essentials.WebAuthenticatorCallbackActivity
{
const string CALLBACK_SCHEME = "myapp";
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
}
}
Logs doesn't help. There is no stacktrace in logs. Also I've tried to check to find what can be null, I saw savedInstanceState is null but it doesn't matter because there is a check for that here: maui/src/Essentials/src/WebAuthenticator/WebAuthenticatorIntermediateActivity.android.cs Line 21 in cf6896e
|
Hi @Hantse I've found a solution while reviewing source code of WebAuthenticator It uses CustomTabs:
So adding following part into your AndroidManifest.xml solved my problem: <queries>
<intent>
<action android:name="android.support.customtabs.action.CustomTabsService" />
</intent>
</queries> It should be between After adding it, NullReferenceException was solved 👍 |
Hello, I try your solution thx :) |
Could someone please confirm this is still an issue in the current releases? |
It's working on all platforms with preview.14 right now. Only Windows has a problem and it has own issue: (#2702) |
Perfect, thanks @enisn! Then I'm going to assume most of this works now unless someone tells me otherwise :) |
Description
I create new MAUI Application and i try to use WebAuthenticator.
I initialise everything i see in sample app in repository.
I launch app, click on button and arrive to page for authenticate on web.
Authentication work, and callback is launch to app.
App try to launch, i pass in WebAuthenticationCallbackActivity constructor, but after the application crash, with "NullReferenceException", log are not enough clear to see where that's come.
Repository :
https://github.com/Hantse/maui-webauthenticator
Steps to Reproduce
Version with bug
Preview 10 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android, Windows
Affected platform versions
Android
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: