【问题标题】:Android, Instagram unfollow user can't be done?Android,Instagram取消关注用户无法完成?
【发布时间】:2015-11-29 11:08:40
【问题描述】:

我正在开发一款 Instagram 集成应用。我想取消关注一个用户,但我从 Instagram 得到了不相关的答案,包括 html doctype 说“抱歉,此页面不可用”。我在我的访问令牌 url 中提到了关系权限。是否需要审核流程?这是我的代码:

  new Thread(new Runnable() {
            @Override
            public void run() {
                try{                        
                    String urlFollowUnFollow = "https://api.instagram.com/v1/users/"
                    + username
                    + "/relationship?access_token="
                    + GetStats.ACCESS_TOKEN;
                    List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);
                    nameValuePairs.add(new BasicNameValuePair("action", "unfollow"));


                try {
                    DefaultHttpClient httpClient = new DefaultHttpClient();
                    HttpPost httpPost = new HttpPost(urlFollowUnFollow);
                    httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
                    HttpResponse httpResponse = httpClient.execute(httpPost);
                    HttpEntity httpEntity = httpResponse.getEntity();
                    is = httpEntity.getContent();

                } catch (UnsupportedEncodingException e) {
                    e.printStackTrace();
                } catch (ClientProtocolException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                }

                try {
                    BufferedReader reader = new BufferedReader(new InputStreamReader(
                            is, "iso-8859-1"), 8);
                    StringBuilder sb = new StringBuilder();
                    String line = null;
                    while ((line = reader.readLine()) != null) {
                        sb.append(line + "\n");
                    }
                    is.close();
                    response = sb.toString();
                } catch (Exception e) {
                    Log.e("Buffer Error", "Error converting result " + e.toString());
                }

                        System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!" + response + "  !!!!!!!!!!!!!!!!!!!!!!!!!");

                }  catch (Exception exception) {
                    exception.printStackTrace();
                }
            }}
        ).start(); 

顺便说一句,我看过其他 stackoverflow 帖子。没有帮助。提前致谢。

【问题讨论】:

    标签: android instagram


    【解决方案1】:

    问题是我的客户无权访问关系权限。为了获得这些访问权限,我必须将我的应用提交给 Instagram 审核。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-10-20
      • 1970-01-01
      • 2013-11-19
      • 1970-01-01
      • 2018-07-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多