I try to add facebook auth in my Xamarin App (Google already done)
On facebook i add https://www.facebook.com/connect/login_success.html
as URI for redirection OAuth valid, all my auth parameter is on.
On Xamarin :
public static string AndroidRedirectUrl = "https://www.facebook.com/connect/login_success.html"
in Constants_Facebook class,
On Click :
string clientId = null;
string redirectUri = null;
if (Device.RuntimePlatform == Device.iOS)
{
clientId = Constants_Facebook.iOSClientId;
redirectUri = Constants_Facebook.iOSRedirectUrl;
}
else if (Device.RuntimePlatform == Device.Android)
{
clientId = Constants_Facebook.AndroidClientId;
redirectUri = Constants_Facebook.AndroidRedirectUrl;
}
var AuthorizeUrl = new Uri(Constants_Facebook.AuthorizeUrl);
var AndroidRedirectUrl = new Uri(Constants_Facebook.AndroidRedirectUrl);
var AccessTokenUrl = new Uri(Constants_Facebook.AccessTokenUrl);
var authenticator = new OAuth2Authenticator(
clientId,
string.Empty,
Constants_Facebook.Scope,
AuthorizeUrl,
AndroidRedirectUrl,
AccessTokenUrl,
null,
true);
authenticator.Completed += OnAuthCompleted_fb;
AuthenticationState.Authenticator = authenticator;
var presenter = new Xamarin.Auth.Presenters.OAuthLoginPresenter();
presenter.Login(authenticator);
Activity in Android part :
[Activity(Label = "ActivityCustomUrlSchemeInterceptor", NoHistory = true, LaunchMode = LaunchMode.SingleTop)]
[IntentFilter
(
actions: new[] { Intent.ActionView },
Categories = new[]
{
Intent.CategoryDefault,
Intent.CategoryBrowsable
},
DataScheme = "https",
DataHost = "www.facebook.com",
DataPath = "/connect/login_success.html"
)]
On app, after login, i only see
Success , warning message about safety
So i think the problem is either in my intent filter declaration or in facebook part
anyone have an idea ?