Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: FacebookAuthorizationException appears sometimes

Since couple of weeks this exception appears sometimes on my App:

Non-fatal Exception: com.facebook.FacebookAuthorizationException: CONNECTION_FAILURE: TigonError(2): TigonLigerErrorDomain(2) AsyncSocketException: connect failed (immediately), type = Socket not open, errno = 101 (Network is unreachable)
       at com.facebook.login.LoginManager.onActivityResult(LoginManager.java:218)
       at com.facebook.login.LoginManager$1.onActivityResult(LoginManager.java:173)
       at com.facebook.internal.CallbackManagerImpl.onActivityResult(CallbackManagerImpl.java:95)
       at com.myapp.util.connect.FacebookConnect.onActivityResult(FacebookConnect.java:338)

Facebook SDK: 4.27.0 Android version's impacted: 4.4.2 and 7 (Crashlytics informations)

Have you got some ideas guys about this exception?

Thank you very much

UPDATE

I wrote a ticket on Facebook support, and after several messages, the last is:

Hi Anthony, thanks for the additional details. Looking at the data for your app, there don't seem to be any failed API calls logged for your app. This indicates that the login attempts failed before they reached our servers, and confirms that this was indeed due to network errors.

I agree that it's not the ideal experience for users to have to retry their login attempt, but in the case of network-related issues like this, this is the best approach. I would recommend prompting the user to check their device connectivity and initialize the login flow again.

From debugging this, it's unlikely that this is due to compatibility issues with Retrofit, though I can't rule it out with certainty. It's more likely that the affected users simply experienced a temporary drop in connectivity.

I'll mark this as closed since there doesn't seem to be a bug within the Facebook SDK, but if you're able to get any information that would indicate otherwise (for example, a way to consistently reproduce the error on a device that has full internet connectivity), please let me know and I'll be glad to help look into this again.

like image 752
anthony Avatar asked Nov 05 '17 10:11

anthony


1 Answers

This exception means that user of your app is experiencing problems with his Internet connection. It is a problem that all the developers should care when making network calls, but it is especially important for mobile devices (the quality of mobile internet can be significantly low). Unfortunately netwok errors cannot be eliminated completely.

The common way of solving such a problem is making retries: either on the side of the app (retrying, showing user an error only after several network errors), either on the side of the user (suggesting user to try once more).

like image 83
Eugene Primako Avatar answered Oct 21 '22 11:10

Eugene Primako