Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Sdk Login with new Activity Result API

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)
like image 728
clouddy Avatar asked Nov 27 '20 08:11

clouddy


People also ask

How do I update my Facebook SDK?

Login into Facebook and navigate to https://developers.facebook.com/apps/ Select the App you want to upgrade (you might have access to multiple apps) Click Settings > Advanced. Select the latest version under the Upgrade API Version section for both “Upgrade All Calls” and “Upgrade Calls for App Roles”

What is the latest Facebook SDK version?

The current version of the Facebook SDK for Android is version 14.1. 1 and requires the Android API 15. Code and samples for the Facebook SDK for Android are available on GitHub. When you use the Facebook SDK for Android, follow the Facebook Open Source Terms of Use and Privacy Policy.


1 Answers

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.

like image 50
Augusto Herbel Avatar answered Oct 23 '22 23:10

Augusto Herbel