VKCOM / vk-ios-sdk

iOS library for working with VK API, authorization through VK app, using VK functions
MIT License
298 stars 165 forks source link

VKShareDialogController при отсутсвии интернета блокирует приложение #527

Open YauheniYarotski opened 6 years ago

YauheniYarotski commented 6 years ago

Если во время отправки новости пропадет соединение, появлется сообщение об ошибке без каких либо кнопок для закрытия - т.е. блокирует полностью UI. СompletionHandler так же не вызывается. Вызываю диалог так: let vkAction = { [weak self] in let shareDialog = VKShareDialogController() shareDialog.shareLink = VKShareLink(title: "", link: url) shareDialog.text = "\n" + hashtag shareDialog.dismissAutomatically = true shareDialog.completionHandler = { result in self?.dismiss(animated: true, completion: nil) } if self?.presentedViewController != nil { self?.dismiss(animated: true, completion: nil) } self?.present(shareDialog, animated: true, completion: nil) } Скрин: screen shot 2017-12-28 at 5 46 33 pm

samsonow19 commented 5 years ago

Тоже столкнулся с этой проблемой. Причина тому следующий код:

if IPHONE_OS_VERSION_MIN_REQUIRED < IPHONE_8_0

    [[[UIAlertView alloc] initWithTitle:nil message:VKLocalizedString(@"ErrorWhilePosting") delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show];

else

    UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:VKLocalizedString(@"ErrorWhilePosting") preferredStyle:UIAlertControllerStyleAlert];
    [self presentViewController:alert animated:YES completion:nil];

endif

Можно добавить action

npu3pak commented 5 years ago

Та же проблема, если перед публикацией удалить приложение в https://vk.com/settings?act=apps.