问题
My Android app integrates with Facebook using the SDK v 3.01. Login using the line below: Session.openActiveSession(m_activity, true, callback);
The first time a user tries to login to Facebook through the app, it takes a REALLY long time to get to the point where the user is expected to enter input (username / pass). I have measured cases of over a minute, but ~30 seconds is "normal".
99% of this time is just waiting for the Facebook SDK to open the Facebook login page. User sees an empty screen with a title bar with my application name on it, and in the center a progress bar turning and turning...
To reproduce:
- Clear data for my app
- Clear data for the Facebook app
- Run my app and execute the line of code above.
By the way, the login process (if you can spare the time) eventually works out, and future logins are very quick. But most users just don't get the white screen with the progress bar and hit 'back', hence never logging in with Facebook.
I have thought of the following options and ruled them out: - Implement my own login using OAuth: Ruled out because I think FB is going to remove support for login not through their API - Do this process in the background and only popup the login activity when it's 'read': Ruled out because I don't think it's possible... - Change the code: Ruled out because I couldn't find a 'better' way of logging in...
My guess is that either I'm doing something wrong, or there's at least one smart person out there that figured out a way around this.
Appreciate your help and a productive discussion.
回答1:
The simplest way to add Facebook Login to your app is to add LoginButton from the Facebook sdk
来源:https://stackoverflow.com/questions/17521516/facebook-sdk-for-android-first-login-is-very-slow-takes-a-very-long-time