Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/116.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios FBSDKShareDialog不';不出现_Ios_Swift_Facebook_Fbsdksharedialog - Fatal编程技术网

Ios FBSDKShareDialog不';不出现

Ios FBSDKShareDialog不';不出现,ios,swift,facebook,fbsdksharedialog,Ios,Swift,Facebook,Fbsdksharedialog,我有显示对话框的功能: class func showShareDialog(fromViewController viewController: UIViewController, shareContent: FBSDKSharingContent, mode: FBSDKShareDialogMode = FBSDKShareDialogMode.shareSheet) { let dialog = FBSDKShareDialog() dialog.from

我有显示对话框的功能:

class func showShareDialog(fromViewController viewController: UIViewController, shareContent: FBSDKSharingContent, mode: FBSDKShareDialogMode = FBSDKShareDialogMode.shareSheet) {
        let dialog = FBSDKShareDialog()
        dialog.fromViewController = viewController
        dialog.shareContent = shareContent
//        dialog.mode = mode
        dialog.show()
    }
我这样称呼这个方法:

let imageURL = URL(string: "http://www.greycloaktech.com/wp-content/uploads/2015/07/url-small.jpg")
        let content = FacebookManager.getShareContent(forLinkShare: imageURL, text: "That's the text to share on walls")
        FacebookManager.showShareDialog(fromViewController: self, shareContent: content)
顺便说一句,如果我将模式更改为
dialog.mode=FBSDKShareDialogMode.browser
,它会工作,因此问题只存在于
FBSDKShareDialogMode.shareSheet

因为如果
mode==FBSDKShareDialogMode.shareSheet
我会得到一个错误:

    2017-10-23 11:04:56.866625+0300 MyApp[1868:625813] -canOpenURL: failed for URL: "fbauth2:/" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
2017-10-23 11:04:56.867029+0300 MyApp[1868:625813] [core] SLComposeViewController initWithServiceType: com.apple.social.facebook
2017-10-23 11:04:56.867151+0300 MyApp[1868:625813] [core] SLComposeViewController initWithServiceType got extension (null) for identifier com.apple.share.Facebook.post
2017-10-23 11:04:56.867243+0300 MyApp[1868:625813] [core] SLComposeViewController initWithExtension: (null) requestedServiceType: com.apple.social.facebook
2017-10-23 11:04:56.872994+0300 MyApp[1868:625813] -canOpenURL: failed for URL: "fbapi20150629:/" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
2017-10-23 11:04:56.876269+0300 MyApp[1868:625813] -canOpenURL: failed for URL: "fbshareextension:/" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
2017-10-23 11:04:56.876489+0300 MyApp[1868:625813] [core] addURL: start
2017-10-23 11:04:56.876911+0300 MyApp[1868:625813] [core] SLComposeViewController _addURL: http://www.greycloaktech.com/wp-content/uploads/2015/07/url-small.jpg type: 0 preview: (null)
2017-10-23 11:04:56.887705+0300 MyApp[1868:625813] [core] viewWillAppear
2017-10-23 11:04:56.892271+0300 MyApp[1868:625813] [core] viewDidAppear
2017-10-23 11:04:56.894247+0300 MyApp[1868:625813] [core] ViewDidAppear, but remote VC failed, dismissing
2017-10-23 11:04:56.895216+0300 MyApp[1868:625813] [core] Sheet not being presented, calling premature completion
2017-10-23 11:04:56.895326+0300 MyApp[1868:625813] [core] SLComposeViewController completeWithResult: 0
2017-10-23 11:04:56.895649+0300 MyApp[1868:625813] [core] SLComposeViewController automatically dismissing itself
2017-10-23 11:04:56.902158+0300 MyApp[1868:625813] [core] SLComposeViewController dealloc <SLComposeViewController: 0x105465350>
2017-10-23 11:04:56.866625+0300 MyApp[1868:625813]-canOpenURL:URL失败:“fbauth2:/”-错误:“操作无法完成。(OSStatus错误-10814)。”
2017-10-23 11:04:56.867029+0300 MyApp[1868:625813][core]SLComposeViewController initwithservice类型:com.apple.social.facebook
2017-10-23 11:04:56.867151+0300 MyApp[1868:625813][core]SLComposeViewController initwithserviceCype获得标识符com.apple.share.Facebook.post的扩展名(null)
2017-10-23 11:04:56.867243+0300 MyApp[1868:625813][core]SLComposeViewController initWithExtension:(null)requestedServiceType:com.apple.social.facebook
2017-10-23 11:04:56.872994+0300 MyApp[1868:625813]-canOpenURL:URL失败:“fbapi20150629:/”-错误:“操作无法完成。(OSStatus错误-10814)。”
2017-10-23 11:04:56.876269+0300 MyApp[1868:625813]-canOpenURL:URL失败:“fbshareextension:/”-错误:“操作无法完成。(OSStatus错误-10814)。”
2017-10-23 11:04:56.876489+0300 MyApp[1868:625813][core]addURL:start
2017-10-23 11:04:56.876911+0300 MyApp[1868:625813][core]SLComposeViewController\u addURL:http://www.greycloaktech.com/wp-content/uploads/2015/07/url-small.jpg 类型:0预览:(空)
2017-10-23 11:04:56.887705+0300 MyApp[1868:625813][core]视图将出现
2017-10-23 11:04:56.892271+0300 MyApp[1868:625813][core]视图显示
2017-10-23 11:04:56.894247+0300 MyApp[1868:625813][core]视图未出现,但远程VC失败,被解雇
2017-10-23 11:04:56.895216+0300 MyApp[1868:625813][core]未提交工作表,要求提前完成
2017-10-23 11:04:56.895326+0300 MyApp[1868:625813][core]SLComposeViewController完成,结果:0
2017-10-23 11:04:56.895649+0300 MyApp[1868:625813][core]SLComposeViewController自动解除自身功能
2017-10-23 11:04:56.902158+0300 MyApp[1868:625813][core]SLComposeViewController解除锁定
但如果我安装了Facebook应用程序,一切都正常,所以问题只是在没有安装Facebook应用程序的情况下

在plist文件中,我有:

<key>LSApplicationQueriesSchemes</key>
    <array>
        <string>fbauth2</string>
        <string>fbapi</string>
        <string>fbapi20130214</string>
        <string>fbapi20130410</string>
        <string>fbapi20130702</string>
        <string>fbapi20131010</string>
        <string>fbapi20131219</string>
        <string>fbapi20140410</string>
        <string>fbapi20140116</string>
        <string>fbapi20150313</string>
        <string>fbapi20150629</string>
        <string>fbshareextension</string>
        <string>fb-messenger-api20140430</string>
        <string>fb-messenger-platform-20150128</string>
        <string>fb-messenger-platform-20150218</string>
        <string>fb-messenger-platform-20150305</string>
        <string>googlechromes</string>
        <string>comgooglemaps</string>
    </array>
<key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
        <key>NSExceptionDomains</key>
        <dict>
            <key>akamaihd.net</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
            <key>facebook.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
            <key>fbcdn.net</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
        </dict>
    </dict>
LSApplicationQueriesSchemes
fbauth2
fbapi
fbapi20130214
fbapi20130410
fbapi20130702
fbapi20131010
fbapi20131219
fbapi20140410
fbapi20140116
fbapi20150313
fbapi20150629
fbshareextension
fb-messenger-api20140430
fb-messenger-platform-20150128
fb-messenger-platform-20150218
fb-messenger-platform-20150305
谷歌色度
谷歌地图
NSAppTransportSecurity
NSAllowsArbitraryLoads
NSExceptionDomains
akamaihd.net
n包括多个域
N第三方例外要求转发保密
facebook.com
n包括多个域
N第三方例外要求转发保密
fbcdn.net
n包括多个域
N第三方例外要求转发保密

当设备中没有应用程序时,会出现此错误
kLSApplicationNotFoundErr
1)我找不到kLSApplicationNotFoundErr 2)即使没有安装facebook应用程序,我也希望能够共享