this is my source code to send the request this code is working properly i want to get response when facebook friends accept invitation to use my app. Thanks in advance Please help me to solve this issue.
private void inviteFacebookFriends(FragmentActivity activity) {
Bundle params = new Bundle();
params.putString("message", "Come join me in the Baller Xtreme!!");
OnCompleteListener onCompleteListener = new OnCompleteListener() {
@Override
public void onComplete(Bundle values, FacebookException error) {
if (error != null) {
if (error instanceof FacebookOperationCanceledException) {
Toast.makeText(getActivity().getApplicationContext(),
"Please try again", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getActivity().getApplicationContext(),
"Network error", Toast.LENGTH_SHORT).show();
}
} else {
String reqId = values.getString("request");
if (reqId != null) {
new Send_request_id(getActivity(), reqId).execute();
Toast.makeText(getActivity().getApplicationContext(),
reqId, Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getActivity().getApplicationContext(),
"Request cancelled", Toast.LENGTH_SHORT).show();
}
}
}
};
(new WebDialog.RequestsDialogBuilder(activity,
Session.getActiveSession(), params))
.setOnCompleteListener(onCompleteListener).build().show();
}
0 comments:
Post a Comment