Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public class FacebookProvider implements IdpProvider, FacebookCallback<LoginResu
private IdpCallback mCallbackObject;

public FacebookProvider(Context appContext, IdpConfig idpConfig) {
appContext = appContext.getApplicationContext();
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to do this or only call getApplicationContext when we are passing it into the Facebook initializer?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Either way would have been fine.


if (appContext.getResources().getIdentifier(
"facebook_permissions", "array", appContext.getPackageName()) != 0) {
Log.w(TAG, "DEVELOPER WARNING: You have defined R.array.facebook_permissions but that"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import android.util.Log;

import com.firebase.ui.auth.IdpResponse;
import com.firebase.ui.auth.R;
import com.google.firebase.auth.AuthCredential;
Expand All @@ -30,7 +30,7 @@ public TwitterProvider(Context appContext) {
TwitterAuthConfig authConfig = new TwitterAuthConfig(
appContext.getString(R.string.twitter_consumer_key),
appContext.getString(R.string.twitter_consumer_secret));
Fabric.with(appContext, new Twitter(authConfig));
Fabric.with(appContext.getApplicationContext(), new Twitter(authConfig));
mTwitterAuthClient = new TwitterAuthClient();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
return;
}

if (provider.equalsIgnoreCase(FacebookAuthProvider.PROVIDER_ID)) {
mIdpProvider = new FacebookProvider(getContext(), providerConfig);
} else if (provider.equalsIgnoreCase(GoogleAuthProvider.PROVIDER_ID)) {
if (provider.equalsIgnoreCase(GoogleAuthProvider.PROVIDER_ID)) {
mIdpProvider = new GoogleProvider(getActivity(), providerConfig, email);
} else if (provider.equalsIgnoreCase(FacebookAuthProvider.PROVIDER_ID)) {
mIdpProvider = new FacebookProvider(getContext(), providerConfig);
} else if (provider.equalsIgnoreCase(TwitterAuthProvider.PROVIDER_ID)) {
mIdpProvider = new TwitterProvider(getContext());
}
Expand Down