简体   繁体   English

Android Facebook API - 向朋友发送应用邀请

[英]Android Facebook API - sending an app invite to a friend

I managed to login to Facebook / get permissions.. retrieve friends data, names/ids etc.我设法登录到 Facebook / 获得权限.. 检索朋友数据、姓名/ID 等。

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).我尝试了 Facebook Graph API 提供的对话框,但它告诉我不支持显示(错误 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.还尝试了修改 Facebook SDK 内的 url 以不指向移动版本并将显示设置为弹出窗口的修复程序。 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!) (顺便说一句,在我看来 Facebook 是一项非常不可靠的服务!)

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 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() { ...  }
  } );

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM