Facebook Sdk Login with new Activity Result API

1.1k Views Asked by At

I couldn't manage to callback result with activity result API since Facebook SDK itself starts the activity for facebook login. When I try to write contract, I dont know what should I provide as a intent. I end up with opening a blank activity via contract and get result back when that activity is destroyed. In summary I dont know how to call the statement below with new Activity Result API. Any idea about that ? I also checked whether any updates from facebook API,but no luck for that.

mFacebookCallbackManager.onActivityResult(1001, resultCode, intent)
1

There are 1 best solutions below

1
On

I don't think you are going to succeed trying to integrate Facebook Login with the new Activity Contracts API.

The reason is very simple: Facebook request that you pass the requestCode into the call to callbackManager.onActivityResult(requestCode, resultCode, data) and the requestCode is managed by the ActivityContracts API, so you don't have access to it.

I don't know if Facebook have plans to integrate it Login API with this new Activity Contracts API (it would be awesome if they do) since they use that requestCode to track the instance of the CallbackManagerImpl that needs to be called after you pass the result in onActivityResult.