jaqxues
03/17/2021, 5:29 PMregisterForActivityResult
. I see the result when I override it in Activity, but the callback of the register.... function is not executing. The Intent in question is a GoogleSignInIntent.jaqxues
03/17/2021, 5:30 PM@Composable
fun Screen() {
val signInLauncher =
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
viewModel.processActivityResult(it, ctx as Activity)
}
AndroidView(factory = {
return@AndroidView SignInButton(it).apply {
setOnClickListener {
signInLauncher.launch(viewModel.signInIntent)
}
setColorScheme(colorScheme)
}
}, Modifier.padding(16.dp))
}
jaqxues
03/17/2021, 5:36 PMzhuinden
03/17/2021, 6:18 PMIan Lake
03/17/2021, 6:31 PMnglauber
03/17/2021, 6:39 PMjaqxues
03/17/2021, 6:49 PMIan Lake
03/17/2021, 7:18 PMIan Lake
03/17/2021, 7:19 PMGoogleSignIn
APIs for requestPermissions that explicitly take an Activity or Fragment are not at all set up to work in Composejaqxues
03/17/2021, 7:20 PMIan Lake
03/17/2021, 7:21 PMjaqxues
03/17/2021, 7:21 PMjaqxues
03/17/2021, 7:24 PMIan Lake
03/17/2021, 7:35 PMjaqxues
03/17/2021, 7:36 PMjaqxues
03/17/2021, 8:35 PMregisterForActivityResult
is executed twice (initialized -> onDispose -> initialize). I logged this:
• Registering with a key (the UUID key always stays the same) -> gets assigned request code 1666007090
• Deleting key from registry
• Adding key again -> gets assigned request code 1573315457
The intent request Code that gets launched is however 1666007090, which does not workIan Lake
03/17/2021, 8:47 PMIan Lake
03/17/2021, 8:48 PMjaqxues
03/17/2021, 8:48 PMjaqxues
03/17/2021, 8:51 PMjaqxues
03/17/2021, 8:52 PMregisterForActivityResult
directlyIan Lake
03/17/2021, 8:55 PMdependencies
task to actually see what the resolved version isjaqxues
03/17/2021, 8:59 PM./gradlew app:dependencies help | grep "activity"
does only show 1.3.0-alpha04 being resolved