iOS 11中的Photopicker和FB GrapSharer问题

我的代码在iOS 10上工作正常,但在更新到iOS 11之后似乎没有任何效果.

这是我在Facebook上分享视频的代码

internal func imagePickerController(_ picker: UIImagePickerController,didFinishPickingMediawithInfo info: [String : Any]){
        self.dismiss(animated: true,completion: { () -> Void in

        })
        guard let videoURL = info[UIImagePickerControllerReferenceURL] as? NSURL else {
            return // No video selected.
        }
        print(videoURL)
        let video = Video(url: videoURL as URL)
        var content = VideoShareContent(video: video)
        content.hashtag = Hashtag.init("#Ojas")

        if FBSDKAccesstoken.current() != nil{
            if FBSDKAccesstoken.current().hasGranted("publish_actions") {
                print("Have permission")
                let sharer = GraphSharer(content: content)
                sharer.failsOnInvalidData = true
                sharer.message = "From #Ojas App"
                sharer.completion = { result in
                    // Handle share results
                    print("Share results : \(result)")
                }

                do{
                    try sharer.share()
                    //try shareDialog.show()
                }catch{
                    print("Facebook share error")
                }

        }

    }

但是之前的工作没有任何效果.
这是我在ImagePicker中看到的日志:

[discovery] errors encountered while discovering extensions: Error Domain=PlugInKit Code=13 "query cancelled" UserInfo={NSLocalizedDescription=query cancelled}

现在有一个警告说“app_name”想用“facebook.com”登录.
我提到的链接
PhotoPicker discovery error: Error Domain=PlugInKit Code=13

知道为什么一切都停止在iOS 11工作.任何帮助将不胜感激.

解决方法

好的,这是关于询问我在应用程序开始时已经问过的权限.我还需要再问一次,我不知道为什么,但它确实有效.

PHPhotoLibrary.requestAuthorization({ (status: PHAuthorizationStatus) -> Void in
            ()

            if PHPhotoLibrary.authorizationStatus() == PHAuthorizationStatus.authorized {
                print("creating 2")
                // Impelement UiImagepicker method
            }

        })

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...