iOS:-canOpenURL:URL失败:“fbauth2:/” - 错误:“操作无法完成。(OSStatus错误-10814。)”在Simulators&设备

时间:2017-10-24 10:52:34

标签: ios objective-c facebook facebook-graph-api ios-simulator

我使用了Link,但我有错误信息。不可能知道为什么。我想要的只是一个按钮,单击它在iPad上共享本地图像,而无需安装Facebook应用程序。我只想让用户点击按钮,输入他的登录名/密码,发布它,就是这样。

UIImage *image = [UIImage imageNamed:@"..."];

FBSDKSharePhoto *photo = [[FBSDKSharePhoto alloc] init];
photo.image = image;
photo.userGenerated = YES;
FBSDKSharePhotoContent *content = [[FBSDKSharePhotoContent alloc] init];
content.photos = @[photo];
appDelegate中的

openUrl方法:

- (BOOL) application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
    NSLog(@"url recieved: %@", url);
    NSLog(@"query string: %@", [url query]);
    NSLog(@"host: %@", [url host]);
    NSLog(@"url path: %@", [url path]);

      return YES;
}

我确切地知道线上有问题:

[[FBSDKApplicationDelegate sharedInstance] application:application
                         didFinishLaunchingWithOptions:launchOptions];
  • 在控制台(模拟器)中执行其他消息错误:
    由于模拟器错误而退回到从NSUserDefaults加载访问令牌 由于模拟器错误而退回到在NSUserDefaults中存储访问令牌

  • 在控制台(设备)中发生其他消息错误:
    任务。&lt; 1&gt;完成错误 - 代码:-1001

有关信息,这是我的plist键:

<key>CFBundleURLTypes</key>
<array>
    <dict>
    <key>CFBundleURLSchemes</key>
    <array>
        <string>fb2000xxxxxxxxxxx</string>
    </array>
    <key>CFBundleTypeRole</key>
    <string>Editor</string>
    <key>CFBundleURLName</key>
    <string>com.newTelApps.WebBoxEssaisPresse</string>
    </dict>
</array>
<key>FacebookAppID</key>
<string>2000xxxxxxxxxxx</string>
<key>FacebookDisplayName</key>
<string>WebBox</string>
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>fbapi</string>
    <string>fb-messenger-api</string>
    <string>fbauth2</string>
    <string>fbshareextension</string>
    <string>fbapi</string>
    <string>twitter</string>
    <string>facebook</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>fbauth</string>
    <string>fb-messenger-api20140430</string>
</array>

提前致谢。

1 个答案:

答案 0 :(得分:0)

转到Info.plist并进行更改 App Transport Security Settings ==&gt; Allow Arbitrary LoadsYES

添加LSApplicationQueriesSchemes