通过URL在Facebook上添加朋友

时间:2019-04-25 14:47:56

标签: java android ihttpasynchandler

我想从我的应用程序中添加朋友,我有一个想法,可以获取URL按钮来添加(从“个人资料”中)并在不打开网络的情况下创建URL 这是我的代码:

 public void Add() {
    final AsyncHttpClient client = new AsyncHttpClient();
    RequestParams params = new RequestParams();
    params.put("key", "value");
    params.put("more", "data");

    client.get("https://m.facebook.com/a/mobile/friends/profile_add_friend.php?subjectid=100030701077313&istimeline=1&hf=profile_button&fref=unknown&frefid=0&gfid=AQCcjGgPKoUEnGP1", params, new AsyncHttpResponseHandler() {
        @Override
        public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
            Toast.makeText(MainActivity.this, "add", Toast.LENGTH_SHORT).show();



        }

        @Override
        public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {

        }


    });

}

我正在向Toast展示,但不添加朋友,请帮助...

0 个答案:

没有答案
相关问题