使用单点登录验证用户时,Facebook iOS Safari"无法打开页面错误"

use*_*459 27 iphone facebook oauth ios

我正在围绕这个问题旋转 - 看起来Facebook有关于它的一些开放票,但我想看看是否有人遇到了我遇到的同样问题,并找到了一个临时或更好的解决方案.

我下载了Facebook的"DemoApp",并且可以将appId其放入我的info.plist中:( fb1234567890其中1234567890是我的appId).它可以通过多任务处理来验证用户身份,输入我的凭据,允许我的应用程序访问,然后在我登录时重定向回"DemoApp"(我可以请求我的信息正常).

现在,我正在尝试将DemoApp的功能集成到我现有的应用程序中.

我可以访问登录屏幕,并输入我的凭据.它允许我让我的应用程序访问我的个人信息 - 我点击allow和Safari处理一个新请求,然后返回错误消息:Safari cannot open the request because the address is invalid在URL:http://www.facebook.com/connect/uiserver.php

但是,如果我已经DemoApp安装在我的模拟器和我自己的应用程序上,它会在我成功登录后切换回DemoApp.如果我卸载DemoApp并再次使用我的应用程序,我会收到Safari错误.

我该怎么做才能解决这个问题? 任何帮助都会很棒; 我在这里敲我的头.:(

我的info.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLName</key>
            <string></string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>fb1234567890</string>
            </array>
        </dict>
    </array>
    <key>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleDisplayName</key>
    <string>${PRODUCT_NAME}</string>
    <key>CFBundleExecutable</key>
    <string>${EXECUTABLE_NAME}</string>
    <key>CFBundleIconFile</key>
    <string></string>
    <key>CFBundleIdentifier</key>
    <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>${PRODUCT_NAME}</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>1.0</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>NSMainNibFile</key>
    <string>MainWindow</string>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)

Mar*_*bst 38

CFBundleURLTypes条目不正确.它应该如下所示:

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>fb1234567890</string>
        </array>
    </dict>
</array>
Run Code Online (Sandbox Code Playgroud)


Pau*_*eri 6

我的经历非常相似.我发现即使在干净的构建之后,我正在制作的plist变化也没有被吸收到模拟器中.我能够通过将硬件 - >设备设置更改为不同的东西,然后再返回来制作它们.不知何故,这似乎导致plist更改在模拟器上注册了操作系统,而我没有做任何其他事情.不确定这是"正确"的方式,或者如果构建设置中的某些内容搞砸了,但对我来说,这确实解决了您所描述的确切问题.