Send FB Invitation Message
Method
java
public void gamedreamerFBInviteFriends(Context context, GDFacebookInviteFrisContent facebookInviteFrisContent, FacebookInviteFriendsListener facebookInviteFriendsListener)Parameter Descriptioin
| Parameter | Descriptioin |
|---|---|
| context | Context object. |
| facebookInviteFrisContent | GDFacebookInviteFrisContent object. The attributes defined by the this class are as following iamge. Call the getter() method to get related attributes. Where invitedFriList is the player's list of friends that you want to invite. If you use the friend list page provided by FBSDK, the parameter invitedFriList is not passed. |
| facebookInviteFriendsListener | Send FB invitation message listener. |
- The attributes defined by the facebookInviteFrisContent class are as following image:

Callback Description
GamedreamerFacebookInviteFriendsListener.onFaceBookInviteFriendResult(GDFaceBookInviteFrisResult gdFaceBookInviteFrisResult) callback method description:
- Send FB invitation message callback method.
- The class GDFaceBookInviteFrisResult contains attributes as follows, through the attributes getter() method to obtain data:

- The attribute code is shown in the following table:
| code | Description |
|---|---|
| 200 | Invitation success. |
| 201 | Invitation success, there is a repeated invitation. |
| 202 | The invitation was successful and the local cache failed. |
| 300 | FB invitation failed, returned error with exception information. |
| 301 | FB invitation failed, the reason is unknown |
| 302 | The player canceled the invitation. |
| 4xx | Parameter is null. |
Example Code
java
List<GDFBFriend> gdfbFriendList=new ArrayList<GDFBFriend>();
if (mAdapter != null) {
HashMap<Integer, Boolean> checkedStateMap = mAdapter.checkedStateMap;
for (int i = 0; i < mItemDataSourseList.size(); i++) {
if (checkedStateMap.get(i) != null) {
gdfbFriendList.add(mItemDataSourseList.get(i).getGDFBFriends());
}
}
}
GDFacebookInviteFrisContent facebookInviteFrisContent = new GDFacebookInviteFrisContent();
facebookInviteFrisContent.setTitle("title");
facebookInviteFrisContent.setMessage("message");
facebookInviteFrisContent.setInvitedFriList(gdfbFriendList);
GDSDK.gamederamerFacebookInviteWithFriends(TestFbActivity.this, facebookInviteFrisContent, new GamedreamerFacebookInviteFriendsListener() {
@Override
public void onFaceBookInviteFriendResult(GDFaceBookInviteFrisResult gdFaceBookInviteFrisResult) {
Toast.makeText(getApplicationContext(), gdFaceBookInviteFrisResult.getMessage(),Toast.LENGTH_SHORT).show();
}
});