Reputation: 381
OnCreate:
MainActivity (auth.GetUI (this));
Login();
https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=code
I installed xamarin.OAuth on nuget. and here is code :
public void Login()
{
auth = new OAuth2Authenticator (
clientId: "3b5a1",
scope: "",
authorizeUrl: new Uri ("https://api.instagram.com/oauth/authorize"),
redirectUrl: new Uri ("http://Instagramcallback.com/callback")
);
auth.Completed+= (sender, e) => {
//DismissViewController(true,null);
if(e.IsAuthenticated)
{
}
else
{
// errors be showing at here
}
};
}
Fail: I don't see any popup be show on screen.
Upvotes: 0
Views: 323
Reputation: 74144
After you get your auth
object, you are not showing the login UI (see the guide in the link below):
PresentViewController (auth.GetUI (), true, null);
(The GetUI method returns UINavigationControllers
on iOS)
The following code to present the UI from OnCreate:
StartActivity (auth.GetUI (this));
https://github.com/xamarin/Xamarin.Auth/blob/master/GettingStarted.md
Upvotes: 1