當前位置: 首頁>>代碼示例>>Java>>正文


Java HttpMethod.GET屬性代碼示例

本文整理匯總了Java中com.facebook.HttpMethod.GET屬性的典型用法代碼示例。如果您正苦於以下問題:Java HttpMethod.GET屬性的具體用法?Java HttpMethod.GET怎麽用?Java HttpMethod.GET使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.facebook.HttpMethod的用法示例。


在下文中一共展示了HttpMethod.GET屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: execute

protected void execute() {
    if (sessionManager.isLoggedIn()) {
        AccessToken accessToken = sessionManager.getAccessToken();
        Bundle bundle = updateAppSecretProof();
        GraphRequest request = new GraphRequest(accessToken, getGraphPath(),
                bundle, HttpMethod.GET);
        request.setVersion(configuration.getGraphVersion());
        runRequest(request);
    } else {
        String reason = Errors.getError(Errors.ErrorMsg.LOGIN);
        Logger.logError(getClass(), reason, null);
        if (mSingleEmitter != null) {
            mSingleEmitter.onError(new FacebookAuthorizationException(reason));
        }
    }
}
 
開發者ID:WassimBenltaief,項目名稱:ReactiveFB,代碼行數:16,代碼來源:RequestAction.java

示例2: requestFacebookCoverPhoto

public void requestFacebookCoverPhoto(AccessToken accessToken, final FacebookGetLoginUserCallback callback) {
    if (NetworkUtils.getInstance().isOnline()) {
        Bundle params = new Bundle();
        params.putString("fields", "cover");
        GraphRequest request = new GraphRequest(
                accessToken,
                "me",
                params,
                HttpMethod.GET,
                new GraphRequest.Callback() {
                    public void onCompleted(GraphResponse response) {
                        try {
                            JSONObject coverResponse = response.getJSONObject().getJSONObject("cover");
                            String coverUrl = coverResponse.getString("source");
                            UserModel.getInstance().addFacebookCoverUrl(coverUrl);
                            callback.onSuccess();

                        } catch (JSONException e) {
                            e.printStackTrace();
                        }
                    }
                }
        );
        request.executeAsync();
    }
}
 
開發者ID:agpyaephyo,項目名稱:Movie-Maniac-Android,代碼行數:26,代碼來源:FacebookUtils.java

示例3: requestFacebookProfilePhoto

public void requestFacebookProfilePhoto(AccessToken accessToken, final FacebookGetLoginUserCallback callback) {
    if (NetworkUtils.getInstance().isOnline()) {
        Bundle params = new Bundle();
        params.putString("redirect", "false");
        params.putString("type", "large");
        GraphRequest request = new GraphRequest(
                accessToken,
                "me/picture",
                params,
                HttpMethod.GET,
                new GraphRequest.Callback() {
                    public void onCompleted(GraphResponse response) {
                        try {
                            String profilePhotoUrl = response.getJSONObject().getJSONObject("data").getString("url");
                            UserModel.getInstance().addFacebookProfileUrl(profilePhotoUrl);
                            callback.onSuccess();

                        } catch (JSONException e) {
                            e.printStackTrace();
                        }
                    }
                }
        );
        request.executeAsync();
    }
}
 
開發者ID:agpyaephyo,項目名稱:Movie-Maniac-Android,代碼行數:26,代碼來源:FacebookUtils.java

示例4: requestAccounts

/**
 * Asynchronously requests the Page accounts associated with the linked account. Requires an opened active {@link Session}.
 *
 * @param callback a {@link Callback} when the request completes.
 * @return true if the request is made; false if no opened {@link Session} is active.
 */
boolean requestAccounts(Callback callback) {
    boolean isSuccessful = false;

    Session session = Session.getActiveSession();
    if (session != null && session.isOpened()) {
        // Construct fields to request.
        Bundle params = new Bundle();
        params.putString(ACCOUNTS_LISTING_FEILDS_KEY, ACCOUNTS_LISTING_FIELDS_VALUE);

        // Construct and execute albums listing request.
        Request request = new Request(session, ACCOUNTS_LISTING_GRAPH_PATH, params, HttpMethod.GET, callback);
        request.executeAsync();

        isSuccessful = true;
    }
    return isSuccessful;
}
 
開發者ID:groundupworks,項目名稱:wings,代碼行數:23,代碼來源:FacebookEndpoint.java

示例5: requestAlbums

/**
 * Asynchronously requests the albums associated with the linked account. Requires an opened active {@link Session}.
 *
 * @param id       may be {@link #ME} or a Page id.
 * @param callback a {@link Callback} when the request completes.
 * @return true if the request is made; false if no opened {@link Session} is active.
 */
boolean requestAlbums(String id, Callback callback) {
    boolean isSuccessful = false;

    Session session = Session.getActiveSession();
    if (session != null && session.isOpened()) {
        // Construct fields to request.
        Bundle params = new Bundle();
        params.putString(ALBUMS_LISTING_LIMIT_KEY, ALBUMS_LISTING_LIMIT_VALUE);
        params.putString(ALBUMS_LISTING_FEILDS_KEY, ALBUMS_LISTING_FIELDS_VALUE);

        // Construct and execute albums listing request.
        Request request = new Request(session, id + TO_ALBUMS_LISTING_GRAPH_PATH, params, HttpMethod.GET, callback);
        request.executeAsync();

        isSuccessful = true;
    }
    return isSuccessful;
}
 
開發者ID:groundupworks,項目名稱:wings,代碼行數:25,代碼來源:FacebookEndpoint.java

示例6: getGraphMeRequestWithCache

private static GraphRequest getGraphMeRequestWithCache(
        final String accessToken) {
    Bundle parameters = new Bundle();
    parameters.putString("fields", "id,name,first_name,middle_name,last_name,link");
    parameters.putString("access_token", accessToken);
    GraphRequest graphRequest = new GraphRequest(
            null,
            "me",
            parameters,
            HttpMethod.GET,
            null);
    return graphRequest;
}
 
開發者ID:eviltnan,項目名稱:kognitivo,代碼行數:13,代碼來源:Utility.java

示例7: getFeedGraphRequest

public static GraphRequest getFeedGraphRequest(String pageId, GraphRequest.Callback callback) {

        return new GraphRequest(
                AccessToken.getCurrentAccessToken(),
                "/" + pageId + "/feed?include_hidden=true&fields=message,created_time,is_hidden,insights.metric(post_impressions)",
                null,
                HttpMethod.GET,
                callback
        );
    }
 
開發者ID:seventhmoon,項目名稱:PagesManager,代碼行數:10,代碼來源:GraphRequestHelper.java

示例8: getPromotablePostsGraphRequest

public static GraphRequest getPromotablePostsGraphRequest(String pageId, GraphRequest.Callback callback) {

        return new GraphRequest(
                AccessToken.getCurrentAccessToken(),
                "/" + pageId + "/promotable_posts?is_published=false&include_hidden=true&fields=message,created_time,is_hidden,insights.metric(post_impressions)",
                null,
                HttpMethod.GET,
                callback
        );
    }
 
開發者ID:seventhmoon,項目名稱:PagesManager,代碼行數:10,代碼來源:GraphRequestHelper.java

示例9: getMeAccoountsGraphRequest

public static GraphRequest getMeAccoountsGraphRequest(GraphRequest.Callback callback) {
    return new GraphRequest(
            AccessToken.getCurrentAccessToken(),
            "/me/accounts",
            null,
            HttpMethod.GET,
            callback
    );
}
 
開發者ID:seventhmoon,項目名稱:PagesManager,代碼行數:9,代碼來源:GraphRequestHelper.java

示例10: getLike

/**
 * 取得讚
 *
 * @param object_id
 * @param callback
 */
public void getLike(String object_id, Callback callback) {
    GraphRequest graphRequest = new GraphRequest(AccessToken.getCurrentAccessToken(),
            "/" + object_id + "/likes",
            null,
            HttpMethod.GET,
            DefaultCallback(callback));
    graphRequest.executeAsync();
}
 
開發者ID:JimRoid,項目名稱:EasyFacebook,代碼行數:14,代碼來源:FacebookTool.java

示例11: getComments

/**
 * @param post_id
 * @param bundle
 * @param callback
 */
public void getComments(String post_id, Bundle bundle, Callback callback) {
    if (bundle == null) {
        bundle = new Bundle();
    }

    GraphRequest graphRequest = new GraphRequest(AccessToken.getCurrentAccessToken(),
            "/" + post_id + "/comments",
            bundle,
            HttpMethod.GET,
            DefaultCallback(callback));
    graphRequest.executeAsync();
}
 
開發者ID:JimRoid,項目名稱:EasyFacebook,代碼行數:17,代碼來源:FacebookTool.java

示例12: getFeed

public void getFeed(String id, Bundle bundle, Callback callback) {
    GraphRequest graphRequest = new GraphRequest(AccessToken.getCurrentAccessToken(),
            "/" + id + "/feed",
            bundle,
            HttpMethod.GET,
            DefaultCallback(callback));
    graphRequest.executeAsync();
}
 
開發者ID:JimRoid,項目名稱:EasyFacebook,代碼行數:8,代碼來源:FacebookTool.java

示例13: getPost

public void getPost(String id,Bundle bundle, Callback callback) {
    GraphRequest graphRequest = new GraphRequest(AccessToken.getCurrentAccessToken(),
            "/" + id,
            bundle,
            HttpMethod.GET,
            DefaultCallback(callback));
    graphRequest.executeAsync();
}
 
開發者ID:JimRoid,項目名稱:EasyFacebook,代碼行數:8,代碼來源:FacebookTool.java

示例14: getCredentials

void getCredentials(final CredentialsListener listener) {
    Log.d(TAG, "getUserData");
    final AccessToken currentToken = AccessToken.getCurrentAccessToken();
    GraphRequest request = new GraphRequest(
            AccessToken.getCurrentAccessToken(),
            "/me",
            null,
            HttpMethod.GET,
            new GraphRequest.Callback() {
                public void onCompleted(GraphResponse response) {
                    try {
                        Profile profile = Profile.getCurrentProfile();

                        String email = response.getJSONObject().getString("email");
                        String name = response.getJSONObject().getString("name");
                        String imageUri = profile.getProfilePictureUri(200,200).toString();

                        SocialMediaCredentials credentials =
                                new SocialMediaCredentials(currentToken.getToken(),
                                        currentToken.getUserId(), FACEBOOK_ACCOUNT, name, email,
                                        imageUri);
                        listener.onSuccess(new FacebookAccount(credentials));
                    } catch (JSONException|NullPointerException e) {

                        listener.onError(new ServerStatusCode(ServerStatusCode.LOGIN_API_ERROR));
                        Log.e(TAG, e.getMessage()==null?"null message":e.getMessage());
                    }
                }
            }
    );
    Bundle parameters = new Bundle();
    parameters.putString("fields", "id,name,email");
    request.setParameters(parameters);
    request.executeAsync();
}
 
開發者ID:InspectorIncognito,項目名稱:androidApp,代碼行數:35,代碼來源:FacebookDataManager.java

示例15: onExecute

@Override
public void onExecute()
  {
  // If we already have a next page request ready - execute it now. Otherwise
  // start a brand new request.

  PhotosGraphRequestCallback photosGraphRequestCallback = new PhotosGraphRequestCallback( mCallback );

  if ( mNextPhotosPageGraphRequest != null )
    {
    mNextPhotosPageGraphRequest.setCallback( photosGraphRequestCallback );

    mNextPhotosPageGraphRequest.executeAsync();

    mNextPhotosPageGraphRequest = null;

    return;
    }


  Bundle parameters = new Bundle();

  parameters.putString( PARAMETER_NAME_TYPE,   PARAMETER_VALUE_TYPE );
  parameters.putString( PARAMETER_NAME_FIELDS, PARAMETER_VALUE_FIELDS );

  GraphRequest request = new GraphRequest(
          AccessToken.getCurrentAccessToken(),
          GRAPH_PATH_MY_PHOTOS,
          parameters,
          HttpMethod.GET,
          photosGraphRequestCallback );

  request.executeAsync();
  }
 
開發者ID:OceanLabs,項目名稱:FacebookPhotoPicker-Android,代碼行數:34,代碼來源:FacebookAgent.java


注:本文中的com.facebook.HttpMethod.GET屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。