3

VK Android SDK (com.perm.kate.api) を使用しています https://bitbucket.org/ruX/android-vk-sdk/overview

ある日以下に提供するコードの最後の行は、KException を返し始めました。

ドキュメントから: ある種のアクションが頻繁に完了すると、API へのリクエストで「キャプチャが必要です」というエラーが返される場合があります。ユーザーは画像からコードを入力し、入力したキャプチャ コードをリクエスト パラメータに指定してリクエストを再送信する必要があります。

  • captcha_sid - キャプチャ識別子 captcha_img
  • 画像からテキストを入力できるように、ユーザーに表示する必要がある画像へのリンク。

問題は、このパラメーターをどこに入力すればよいかということです。メソッドを使用して、これらの引数を含まないユーザー プロファイルを取得します。

public ArrayList<User> getProfiles(Collection<Long> uids, Collection<String> domains, String fields, String name_case) throws MalformedURLException, IOException, JSONException, KException

ユーザー プロファイルを取得するコード:

Api vkApi=new Api(account.access_token, Constants.API_ID);
//get user
Collection<Long>userIds=new ArrayList<Long>();
userIds.add(account.user_id);
ArrayList<User> users=vkApi.getProfiles(userIds, null, null, null); //KException
4

1 に答える 1

1

すべてのパラメータを設定する必要があります。null ではなく、空の文字列を含む配列、および空の文字列。私の例:

Collection<Long> u = new ArrayList<Long>();
u.add(user_id);
Collection<String> d = new ArrayList<String>();
d.add("");

response = vkApi.getProfiles(u, d, "", "", "", "");
于 2014-10-21T10:09:43.083 に答える