Using AppleID in Android with Firebase AuthUI
I am using Firebase AuthUI to allow for authentication in my app. The only method giving me problems is AppleID. Here is the activity start:
List<AuthUI.IdpConfig> providers = Arrays.asList(
new AuthUI.IdpConfig.FacebookBuilder().build(),
new AuthUI.IdpConfig.GoogleBuilder().build(),
new AuthUI.IdpConfig.AppleBuilder().build(),
new AuthUI.IdpConfig.EmailBuilder().build());
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setAvailableProviders(providers)
.setTosAndPrivacyPolicyUrls(getString(R.string.terms_of_use_url),
getString(R.string.privacy_policy_url))
.setTheme(R.style.CoreTheme)
.build(),
RC_SIGN_IN);
And here is onActivityResult:
else if (requestCode == RC_SIGN_IN) {
IdpResponse response = IdpResponse.fromResultIntent(data);
if (resultCode == RESULT_OK) {
mLoginStateController.logIn(response);
} else {
}
}
The problem is that when I log in in the AuthUI activity it takes me back to the page when I have to input the AppleID but it's grayed out. When I press back it takes me to the app and onActivityResult is called with token properly, but the browser should close on its own.
In firebase console I have Sign in with Apple enabled and Apple on Apple Developer console everything is setup too. The user can log in, it's just that logging in does not close the browser window in AuthUI.
@hbrtose could you provide a screenshot of where the browser flow gets stuck for you?

I'm having the same issue, although in my case, the flow never returns to the app and onActivityResult is never called unless I back out, in which case the result is that the flow was cancelled by the user, and thus I don't have a token. But I'm stuck at this exact same spot, with the flow going back to the initial Apple sign in screen after I've signed in, but the form is unfilled and the foreground is grayed out, just as this screenshot shows.
Logcat shows:
E/IdpSignInActivity: Could not do operation - unknown action: null
Everything works fine for me with Google and Facebook sign in on Android, as well as Google+Facebook+Apple on iOS and Google+Facebook+Apple on the web. This is the only combination that seems broken.
@hbrtose did you ever get this working?
I had issues getting returned from the Microsoft and Apple flows similar to what's described here. It turned out to be caused by a non-standard android:taskAffinity being set in AndroidManifest.xml so that's perhaps worth checking @ubragg
Thanks @organicinternet - unfortunately I'm not doing anything with android:taskAffinity so at least at first glance, that doesn't seem to be it for me.
I figured out my issue! It turns out that I had followed the advice of this StackOverflow post that suggests adding one of the internal activities to your manifest to suppress a build warning. Simply reverting that change got this working.
Unfortunately the build warning persists, but I'd rather have the warning and have things working:
Warning: activity#com.google.firebase.auth.internal.FederatedSignInActivity@android:launchMode was tagged at AndroidManifest.xml:24 to replace other declarations but no other declaration present