Facebook iOS Safari“无法打开页面错误”使用单点登录验证用户时 [英] Facebook iOS Safari "Cannot Open Page Error" When Authenticating User with Single-Sign-On

查看:216
本文介绍了Facebook iOS Safari“无法打开页面错误”使用单点登录验证用户时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在旋转这个问题的圈子 - 看起来Facebook有一些开放的门票,但我想看看有没有人遇到同样的问题,并找到一个临时或更好的解决方案。 p>

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



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



我可以访问登录屏幕,并输入我的凭据。它允许我给我的应用访问我的个人信息 - 我点击允许,Safari处理一个新的请求,然后返回错误消息 Safari无法打开请求,因为地址无效在URL: http://www.facebook.com/connect/uiserver.php



然而,如果我在我的模拟器和我自己的应用程序上安装了 DemoApp 如果我卸载了 DemoApp ,然后再次使用我的应用程序,我会收到Safari错误。



我可以解决这个问题吗?任何帮助都会很棒;我在这里撞我的头:(



我的 info.plist

 <?xml version =1.0encoding =UTF-8?> 
<!DOCTYPE plist PUBLIC Apple // DTD PLIST 1.0 // ENhttp://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>英文< / string>
< ;键> CFBundleDisplayName< / key>
< string> $ {PRODUCT_NAME}< / string>
< key> CFBundleExecutable&l吨; /密钥GT;
< 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>


解决方案

CFBundleURLTypes条目不正确。它应该是这样的:

 < key> CFBundleURLTypes< / key> 
< array>
< dict>
< key> CFBundleURLSchemes< / key>
< array>
< string> fb1234567890< / string>
< / array>
< / dict>
< / array>


I'm spinning in circles with this issue - and it looks like Facebook has some open tickets regarding it, but I wanted to see if anyone had the same issue I'm having and found a temporary or better solution.

I downloaded Facebook's "DemoApp", and can put in my appId into its info.plist as so: fb1234567890 (where 1234567890 is my appId). It can authenticate the user by multitasking to Safari, entering my credentials, allowing my application access, and then redirecting back to "DemoApp" with me logged in (and I can request my information fine).

NOW, I'm trying to integrate DemoApp's functionality into my existing application.

I am able to access the login screen, and enter my credentials. It allows me to give my application access to my personal information - I click allow and Safari processes a new request, and then returns the error message: Safari cannot open the request because the address is invalid at the URL: http://www.facebook.com/connect/uiserver.php

HOWEVER, If I have DemoApp installed on my simulator and my own application, it will switch BACK to DemoApp with my successfully logged in. If I uninstall DemoApp and try again with my application, I get the Safari error.

WHAT CAN I DO TO SOLVE THIS?? Any help would be great; I'm banging my head here.:(

My 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>

解决方案

The CFBundleURLTypes entry is incorrect. It should look like this:

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>fb1234567890</string>
        </array>
    </dict>
</array>

这篇关于Facebook iOS Safari“无法打开页面错误”使用单点登录验证用户时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆