问题
i am about to complete my application but i am facing few problems with facebook and twitter.
1). I have downloaded and installed facebook application in my device but now when my app redirects on facebook as per it's flow, it open ups that installed facebook app instead of my FB official SDK login screen. Any solution to this?
2). I am using Fb Official SDK and twitter4j 2.1.7 which was working perfectly, but after upgrading my device to Android 2.1update1.. Both Fb and Twitter has stopped working with Device whereas works fine in emulator of the same update or later.
Please do help in these regard asap.
Thanks in advance.
回答1:
in the Facebook.java
public void authorize(Activity activity, String[] permissions,
int activityCode, final DialogListener listener) {
boolean singleSignOnStarted = false;
mAuthDialogListener = listener;
// Prefer single sign-on, where available.
if (activityCode >= 0) {
singleSignOnStarted = startSingleSignOn(activity, mAppId,
permissions, activityCode);
}
// Otherwise fall back to traditional dialog.
if (!singleSignOnStarted) {
startDialogAuth(activity, permissions);
}
}
change it to
public void authorize(Activity activity, String[] permissions,
int activityCode, final DialogListener listener) {
boolean singleSignOnStarted = false;
mAuthDialogListener = listener;
startDialogAuth(activity, permissions);
}
来源:https://stackoverflow.com/questions/4814699/downloaded-facebook-app-replaces-my-apps-facebook-login-page