-
Notifications
You must be signed in to change notification settings - Fork 497
Web Authenticator not returning back to App in Android 12, when user sharing(Intent.ActionSend) #2081
Description
Description:
We developed a mobile app, where users can share documents and pictures from Mobile App.
When user shares a picture/document with our Mobile App, the app will ask the user to log in. We are using WebAuthenticator to login and logout from our app.
Once the login has been made, from the browser it is not redirected back to the APP. We found it is happening only on Android devices, and when we are sharing, the Intent action will be Intent.ActionSend
Steps to Reproduce
-
Create a sample content page with a button(let's call it as login button).
-
In MainActivity.cs -> Add a code to support sharing -> [[IntentFilter(new[] { Intent.ActionSend }, Categories = new[] { Intent.CategoryDefault }, DataMimeTypes = new[]
{
"image/",
"image/bmp",
"image/jpg",
"image/png",
"text/plain",
"application/vnd.oasis.opendocument.text",
"application/vnd.oasis.opendocument.image",
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"application/vnd.openxmlformats-officedocument.spreadsheetml.template",
"application/msword",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/vnd.openxmlformats-officedocument.wordprocessingml.template",
"application/pdf",
"application/vnd.ms-powerpoint",
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
"application/vnd.openxmlformats-officedocument.presentationml.template",
"video/",
"video/mp4"})]]
-
On login button click, add a code for the web authenticator something like the below:
[ await WebAuthenticator.AuthenticateAsync(new WebAuthenticatorOptions
{
Url = new Uri($"{_baseUrl}/auth/mobile"),
CallbackUrl = new Uri("trimapp://")
});] -
Open your gallery, share any image -> Select the app you have developed. It will show an login button
-
Click on the login button -> Web authenticator will take you to the chrome browser to login to the app.
-
After the successful login, it is not getting redirected to the APP.
Expected Behavior
App should be redirected without any issues.
Actual Behavior
App stays in browser page, but in background i can see the Application instance got opened, but the redirection was not happening.
Basic Information
- Version with issue:
- Last known good version: Android 11
- IDE:
- Platform Target Frameworks:
- iOS:
- Android:
- UWP:
- Android Support Library Version:
- Nuget Packages: 1.7.0(Xamarin.Essentials)
- Affected Devices: Android 12