Hello i am using the android code to connect facebook but getting "Facebook Server Error + 104 - Inc
- by Shalini Singh
Hello i am using the android code to connect facebook but getting "Facebook Server Error + 104 - Incorrect signature" exception at the place of onLoginSuccess function. code is given bellow ....
public class FacebookConnection extends Activity implements LoginListener {
private FBRocket fbRocket;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// You need to put in your Facebook API key here:
fbRocket = new FBRocket(this, "test", "e2c8deda78b007466c54f48e6359e02e");
// Determine whether there exists a previously-saved Facebook:
if (fbRocket.existsSavedFacebook()) {
String str =fbRocket.getAPIKey();
Log.e("Api key", str);
fbRocket.loadFacebook();
} else {
fbRocket.login(R.layout.main);
String str =fbRocket.getAPIKey();
Log.e("Api key", str);
}
}
public void onLoginFail() {
fbRocket.displayToast("Login failed!");
fbRocket.login(R.layout.main);
}
public void onLoginSuccess(Facebook facebook) {
fbRocket.displayToast("Login success!******************");
// Set the logged-in user's status:
try {
facebook.setStatus("I am using Facebook -- it's great!");
String uid = facebook.getFriendUIDs().get(0); // Just get the uid of the first friend returned...
fbRocket.displayDialog("Friend's name: " + facebook.getFriend(uid).name); // ... and retrieve this friend's name.
} catch (ServerErrorException e) {
// Check if the exception was caused by not being logged-in:
if (e.notLoggedIn()) {
// ...if it was, then login again:
fbRocket.login(R.layout.main);
} else {
System.out.println(e);
e.printStackTrace();
}
}
}