简体   繁体   中英

Facebook integration in iphone app

Sorry for asking the same question which is in stackove flow already . I am trying to integrating Facebook in my iPhone app. To do this i have followed https://developers.facebook.com/docs/mobile/ios/build/#sdk . Whenever i am clicking Facebook button in my app it is showing login screen properly. But whenever i click on login button getting an alert as "Safari can not open the page because address is invalid". Read so many questions on stack over flow which are related to my issue but problem not fixed. Even though i have added SSO properly . Ur help is so much appreciated

my info plist is also correct i think.

<?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>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleDisplayName</key>
    <string>${PRODUCT_NAME}</string>
    <key>CFBundleExecutable</key>
    <string>${EXECUTABLE_NAME}</string>
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>fb432606956784814</string>
            </array>
        </dict>
    </array>
    <key>CFBundleIconFile</key>
    <string></string>
    <key>CFBundleIdentifier</key>
    <string>VJILConsultingLtd.${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>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>1.0</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>NSMainNibFile</key>
    <string>MainWindow</string>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
</dict>
</plist>

Still i am not getting it. i dont understand what the issue is.

If I remember right I had the same problem, in my case it was because I didn't set the fb[YOUR_APP_ID] in the .plist, did u set it correctly?

Create a new row named URL types with a single item, URL Schemes, containing a single value, fb[YOUR_APP_ID] (the literal characters fb followed by your app ID).

Try using YOUR_APP_ID in the Facebook Hackbook example project, find it here: https://github.com/facebook/facebook-ios-sdk/

To test YOUR_APP_ID you need to change the project in two places:
1) In the .plist file
2) In HackbookAppDelegate.m search for the kAppId and set it to YOUR_APP_ID,

static NSString* kAppId = @"432606956784814";  

If this would work then we will know that u know how to set the .plist correctly and that YOUR_APP_ID is valid.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM