Answer the question
In order to leave comments, you need to log in
How to post a photo with a description on the wall of a Vkontakte user from your application?
I log in with a request for permissions to email and post on the wall
VKSdk.login(ActivityRegLog.this, VKScope.EMAIL, VKScope.WALL);
VKRequest requestPost = VKApi.uploadWallPhotoRequest(new VKUploadImage(bitmap, VKImageParameters.jpgImage(0.9f)), 0, 60479154);
requestPost.executeWithListener(new VKRequest.VKRequestListener() {
@Override
public void onComplete(VKResponse response) {
Log.v("Upload", response.responseString);
}
@Override
public void onError(VKError error) {
Log.v("Upload", error.errorMessage);
}
@Override
public void attemptFailed(VKRequest request, int attemptNumber, int totalAttempts) {
Log.v("Upload", request.toString());
}
});
Answer the question
In order to leave comments, you need to log in
I know that this is a necropost, but I’ll answer anyway (because I myself encountered this an hour ago).
Uploading a photo, for subsequent attachment to a post, calls the photos.getWallUploadServer method internally (in the SDK) . If you look at the documentation for this method, it says that you need photos permissions to use it .
Thus, when authorizing, you also need to make a permission request for VKScope.PHOTOS .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question