Jason Inbody
08/24/2021, 12:07 AMrememberLauncherForActivityResult
to hit. What I have gotten to work is to write my own activity class to handle the facebook callback and I'm able to get the token from facebook. The problem is I don't know how to pull the token out of an activity as I can't pass any callbacks into the activity... I was looking into maybe using a broad cast receiver to send the token out of the activity result back to the jetpack compose code. I'm newish to android so unsure if the broadcast receiver is the best way to do this? Is there better ways to send a string out of an activity than that?Jason Inbody
08/24/2021, 1:14 AMoverride fun onSuccess(loginResult: LoginResult?) {
val token = loginResult?.accessToken?.token
intent.putExtra("token", token)
}
I set the putExtra to token. In my compose code I start a thread waiting for the token to be set
Thread {
while (intent.getStringExtra("token") == "") {
val tok = intent.getStringExtra("token")
Thread.sleep(1000)
}
val token = intent.getStringExtra("token")
}.start()
I verify with break points that the token is being sent but when I set the break point back in my thread the token is never set...Jason Inbody
08/24/2021, 1:27 AM