Cezar Alexandru Vancea
Cezar Alexandru Vancea

Reputation: 580

Android Facebook API - sending an app invite to a friend

I managed to login to Facebook / get permissions.. retrieve friends data, names/ids etc.

The issue is that I cannot send an app invite to my friends. I'd like to send the invite without a dialog to a single person. But it seems that's wishful thinking. Now I'd settle for anything. It seems nothing will do the job!

I tried the dialog provided by Facebook Graph API but it tells me that the display is not supported (error 103). Also tried the fix modifying the url inside the Facebook SDK to not point to the mobile version and set the display as popup. Still no good (same error);

Any thoughts on this? Thank you in advance.

(BTW, it seems to me like Facebook is a very unreliable service!)

Upvotes: 3

Views: 6784

Answers (1)

AbePralle
AbePralle

Reputation: 992

This code will bring up an app invite dialog (and I don't know how to send an invite without a dialog). Note: assumes that facebook has been successfully authorized/logged in:

Facebook facebook = new Facebook( MY_APP_ID );
...
Bundle parameters = new Bundle();
parameters.putString( "message", "Check this out!" );
facebook.dialog( activity, "apprequests", parameters,
  new Facebook.DialogListener()
  {
    public void onComplete() { ... }
    public void onFacebookError( FacebookError e ) { ...  }
    public void onError(DialogError e) { ...  }
    public void onCancel() { ...  }
  } );

Upvotes: 8

Related Questions