5
votes

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

1
your question is very confusing. Is there a scheme to the URL you're trying to open? i.e. a http:// in front of http://m.facebook.com/dialog/oauth?refid=0 ??Michael Dautermann
I have the same exact question. My plist file is about the same but after clicking "okay" the url is "h t t p s : / / m.facebook.com/dialog/oauth". Any help appreciatedVitalyp

1 Answers

6
votes

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