facebook ios sso 收到“safari 无法打开页面”错误

发布于 2025-01-05 19:39:11 字数 2616 浏览 1 评论 0原文

我一直在为 android 和 iphone 开发一个应用程序,并且能够在 android 上实现 sso,但是当我尝试在 iOS 上实现它时,我收到上述错误:

“Safari 无法打开页面,因为地址无效”

在我单击“确定”以向应用程序授予我在 Facebook 上的个人信息的权限后,会显示错误,

相关链接为:m.facebook.com/ dialog/oauth?refid=0

这是我的 info.plist 文件

<plist version="1.0">
<dict>
<key>CFBundleIconFiles</key>
<array>
    <string>icon.png</string>
    <string>[email protected]</string>
    <string>icon-72.png</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
</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>icon.png</string>
<key>CFBundleIdentifier</key>
<string>com.snizilica.app</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></string>
<key>NSMainNibFile~ipad</key>
<string></string>
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLName</key>
        <string>[com.facebook.test]</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>fb[xxxxxxxxxxxxxxx]</string>
        </array>
    </dict>
</array>

其中 xxxxxxxxxxx 是我的 app_id

I've been developing an app for android and iphone, and been able to implement sso on android but when I try to implement it on iOS I get the above mentioned error :

"Safari cannot open the page because the address is invalid"

The error is shown after I click "okay" to give the permissions to my personal information on facebook to the app

the link in question is : m.facebook.com/dialog/oauth?refid=0

here is my info.plist file

<plist version="1.0">
<dict>
<key>CFBundleIconFiles</key>
<array>
    <string>icon.png</string>
    <string>[email protected]</string>
    <string>icon-72.png</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
</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>icon.png</string>
<key>CFBundleIdentifier</key>
<string>com.snizilica.app</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></string>
<key>NSMainNibFile~ipad</key>
<string></string>
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLName</key>
        <string>[com.facebook.test]</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>fb[xxxxxxxxxxxxxxx]</string>
        </array>
    </dict>
</array>

where xxxxxxxxxxx is my app_id

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

娇柔作态 2025-01-12 19:39:11

有同样的问题。解决了这个问题,删除了应用程序 ID 中的方括号,

               ...rfaceOrientationPortraitUpsideDown</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>fb123456789012345</string>
        </array>
    </dict>
</array>
</dict>
</plist>

不要在应用程序 ID 周围使用任何方括号

Had the same problem. Solved it having removed the square brackets in the app id

               ...rfaceOrientationPortraitUpsideDown</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>fb123456789012345</string>
        </array>
    </dict>
</array>
</dict>
</plist>

dont use any square bracets around the app id

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文