簡體   English   中英

iOS:-canOpenURL:URL失敗:“ fbauth2:/”-錯誤:“操作無法完成。 (OSStatus錯誤-10814。)”在模擬器和設備上

[英]iOS: -canOpenURL: failed for URL: “fbauth2:/” - error: “The operation couldn’t be completed. (OSStatus error -10814.)” on Simulators & Devices

我使用了該鏈接,但有該錯誤消息。 不可能知道為什么。 我想要的只是一個按鈕,單擊它即可在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中存儲訪問令牌

  • 在控制台(設備)中執行其他消息錯誤:
    任務。<1>已完成,錯誤-代碼:-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>

提前致謝。

轉到Info.plist並將“ App Transport Security Settings ==>“ Allow Arbitrary Loads更改為YES

要么

添加LSApplicationQueriesSchemes

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM