How do I use onActivityResult if FB's SDK is eatin...
# compose
j
How do I use onActivityResult if FB's SDK is eating the intent and I cant use
Copy code
rememberLauncherForActivityResult
because there's no intent to send into the launcher
Copy code
val activity = user.context as Activity
FacebookSdk.sdkInitialize(user.context)
val mCallbackManager = CallbackManager.Factory.create()
val mFacebookCallback: FacebookCallback<LoginResult> = object :FacebookCallback<LoginResult> {
    override fun onSuccess(loginResult: LoginResult ) {
        // App code
        print("hello")
    }
    override fun onCancel() {
        // App code
    }
    override fun onError(exception: FacebookException) {
        // App code
    }
}
var loginManager = LoginManager.getInstance()
loginManager.registerCallback(mCallbackManager, mFacebookCallback)
loginManager.logInWithReadPermissions(activity, listOf("email"))
This will open up the web browser but the callbacks never hit probably because they aren't registered with
Copy code
val facebookLauncher = rememberLauncherForActivityResult(
    contract = ActivityResultContracts.StartIntentSenderForResult()
) {
    mCallbackManager.onActivityResult(it.describeContents(), it.resultCode, it.data);
}
and in order to launch it I need
Copy code
facebookLauncher.launch(<need intent here>)
🤷‍♂️