private async void UploadAlbumPhoto()
        {
            var request = VKApi.UploadAlbumPhotoRequest(UIImage.FromBundle("apple"), VKImageParameters.PngImage(), AlbumId, OwnerId);

            try {
                var response = await request.ExecuteAsync();

                Console.WriteLine("Result: " + response.Json);

                var photoInfo = ((VKPhotoArray)response.ParsedModel).ObjectAtIndex <VKPhoto> (0);
                UIApplication.SharedApplication.OpenUrl(new NSUrl(string.Format("http://vk.com/photo{0}_{1}", OwnerId, photoInfo.id)));
            } catch (VKException ex) {
                Console.WriteLine("Error: " + ex.Error);
            }
        }
Пример #2
0
            private async void UploadSinglePhoto(object sender, EventArgs e)
            {
                var photo   = GetPhoto();
                var request = VKApi.UploadAlbumPhotoRequest(new VKUploadImage(photo, VKImageParameters.PngImage()), AlbumId, OwnerId);

                try {
                    var response = await request.ExecuteAsync();

                    RecycleBitmap(photo);

                    var photoArray = (VKPhotoArray)response.ParsedModel;
                    var uri        = string.Format("https://vk.com/photo{0}_{1}", OwnerId, photoArray [0].id);
                    var i          = new Intent(Intent.ActionView, Uri.Parse(uri));
                    StartActivity(i);
                } catch (VKException ex) {
                    ShowError(ex.Error);
                }
            }