This is one that I'm beginning to think is a bug, please, Please prove me wrong:
I want to programmatically friend a user on Facebook; they are only and most certainly someone the person knows IRL.
The following three solutions all have the same result: a successful friends dialog--meaning the profile name, picture, statement indicating the action( to friend someone ), and refusal/confirm buttons; pressing 'confirm' is the problem: it leads to a Facebook error presented in the standard fb UI saying "Sorry, something went wrong We're working on getting this fixed as soon as we can". My user is logged in and the fb app id( fb_app_id ) is golden, or the fragment's parent activity would not be called, my to-be-friended user id ( Id ) is also golden, confirmed by their profile picture showing up both in my app and in the friends dialog, the action "friends/" is correct--'friends/?' gives me a good ol' "not found" error--and the OnCompleteListener works fine even around the message.
First way is with the SDK, my preferred if it worked:
Bundle params = new Bundle( );
params.putString( "id", Id );
WebDialog requestsDialog = (
new WebDialog.Builder( this.getActivity( ),
getString( R.string.fb_app_id ),
"friends/", params )
.setOnCompleteListener( new CompleteListener( ) )
.build( ) );
requestsDialog.show( );
Save the explicit action call, that looks good, doesn't it? It certainly gets me to the confirmation dialog; second way is quick and dirty, but it should work:
String requestUrl = "https://www.facebook.com/dialog/friends/?id="+
Id+"&app_id="+getString( R.string.fb_app_id )+
"&redirect_uri=http://www.facebook.com";
WebDialog requestDialog = new WebDialog( this.getActivity( ), requestUrl );
requestDialog.show( );
But it doesn't; same quasi-successful result. The third way was me just checking to make sure I wasn't an idiot, and is essentially the suggestion in this post Facebook friends dialog returns "Unknown method" error but with WebDialogs ( my OnCompleteListener implementation ) instead of the deprecated library. Same thing, same message.
It's not really an error message that's /for/ me, you know? Is this a deprecated API call? Is the error message literally correct and the good folks at fb are aware of this? Is there some param i'm actually missing here? It's not like they aren't signed in! I'm kind of at my wit's end on this one, thanks in advance for the help/advice/calming words. -AnB
P.S. 'friended' looks really funny when you write it out. AB