firebase / snippets-android

Android snippets for firebase.google.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Depreciated method - please update documentation

wuujcik opened this issue · comments

// Create and launch sign-in intent
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setAvailableProviders(providers)
.build(),
RC_SIGN_IN)
// [END auth_fui_create_intent]

startActivityForResult(Intent,int) is deprecated, please update your snippet and documentation

Thanks for the feedback @wuujcik! As far as I know the startActivityForResult() method is not actually deprecated:
https://developer.android.com/reference/android/app/Activity#startActivityForResult(android.content.Intent,%20int)

Although you're correct that it's no longer recommended:
https://developer.android.com/training/basics/intents/result

I think what we need to do here is ship an ActivityResultContract in the FirebaseUI library which would enable developers to safely use the shiny new API!

@samtstern the startActivityForResult and onActivityResult methods have been deprecated in the androidx.activity library v1.2.0. I only see deprecation warnings in projects using that library.

@wuujcik Thanks for bringing this up. As @samtstern mentioned, this should be done in the FirebaseUI library and might come out in the next release of that library (see firebase/FirebaseUI-Android#1918 )

// Create and launch sign-in intent
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setAvailableProviders(providers)
.build(),
RC_SIGN_IN)
// [END auth_fui_create_intent]

startActivityForResult(Intent,int) is deprecated, please update your snippet and documentation

Delete

Any updates on the deprecation of startActivityForResult()?

I think this has been solved by #303