0
我使用this例如,試圖發送一個FB好友請求,其中我知道Facebook的ID的用戶(我硬編碼我的FB ID在應用程序)Facebook好友請求返回成功,但與empy束
這是我在做什麼:
fbId = "100000265744136";
Bundle params = new Bundle();
params.putString("message", res.getString(R.string.social_media_fb_friend_request_message));
params.putString("to", fbId);
try {
WebDialog requestsDialog = (new WebDialog.RequestsDialogBuilder(ctx, Session.getActiveSession(), params)).setOnCompleteListener(new OnCompleteListener() {
@Override
public void onComplete(Bundle values, FacebookException error) {
if (error != null) { // ERROR
if (error instanceof FacebookOperationCanceledException) {
callback.onSocialMediaError(SocialMediaActions.ACTION_FB_FRIEND_REQUEST, SocialMediaErrorCodes.CANCELLED_BY_USER, "request cancelled by pressing Back");
hideLoader();
} else {
callback.onSocialMediaError(SocialMediaActions.ACTION_FB_FRIEND_REQUEST, SocialMediaErrorCodes.NETWORK_ERROR, "request cancelled");
hideLoader();
}
} else { // SUCCESS || CANCELLED
final String requestId = values.getString("request");
if (requestId != null) {
callback.onSocialMediaSuccess(SocialMediaActions.ACTION_FB_FRIEND_REQUEST, null);
hideLoader();
} else {
// IT ALWAYS GOES HERE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
callback.onSocialMediaError(SocialMediaActions.ACTION_FB_FRIEND_REQUEST, SocialMediaErrorCodes.CANCELLED, "cancelled");
hideLoader();
}
}
}
}).build();
requestsDialog.show();
} catch (Exception e) {
if (callback != null) {
callback.onSocialMediaError(SocialMediaActions.ACTION_FB_FRIEND_REQUEST, SocialMediaErrorCodes.UNKNOWN, "dialog: " + e.getMessage());
}
hideLoader();
}
正如你可以在上面看到,該requestId
總是空的,其實接收Bundle
總是空單。
我會做什麼錯?我積極Session
我給對話是一個有效的(我已經檢查出來,它似乎沒關係,它是開放的,一切)
想法?
您是否知道Facebook API已更改?你有沒有考慮到這一點?我想知道未來FB是否會用用戶ID來支持你 - 這應該只適用於你在今年4月之前用FB註冊你的應用程序,它只會在2015年前後才能運行。 – Skynet 2014-09-01 12:18:59
嗯......'不知道。我會進一步研究這個問題。謝謝。 – AndreiBogdan 2014-09-01 12:48:22