user1126515
user1126515

Reputation: 1163

Facebook, onActivityResult() called with requestCode=32665

This is a little strange.

I have an old version of the Facebook SDK built into my android app - 3.0.1

I use Facebook for authentication.

I have an onActivityResult() method in the Activity used to get the results of startActivityForResult() for an Activity that has NOTHING to do with Facebook authentication.

The weird thing that I've noticed is, if I authenticate with Facebook my onActivityResult() method gets invoked with a requestCode = 32665

I have verified my startActivityForResult() has NOT been invoked and that when it is, the request code it uses is NOT 32665

Does anyone know what's going on?

Upvotes: 1

Views: 440

Answers (1)

Artem
Artem

Reputation: 966

Facebook uses onActivityResult callback as part of it login flow, and you need to call onActivityResult method of one of the Facebook classes Session or CallbackManager (depends on sdks version).

So, to handle this situation, you can check whether this call from Facebook SDK or from your code by using method isFacebookRequestCode. Docs here https://developers.facebook.com/docs/reference/android/current/class/FacebookSdk/#isFacebookRequestCode

Upvotes: 1

Related Questions