简体   繁体   English

iPhone应用程序中的Facebook集成

[英]Facebook integration in iphone app

Sorry for asking the same question which is in stackove flow already . 很抱歉已经问了stackove流中的相同问题。 I am trying to integrating Facebook in my iPhone app. 我正在尝试将Facebook集成到我的iPhone应用程序中。 To do this i have followed https://developers.facebook.com/docs/mobile/ios/build/#sdk . 为此,我遵循了https://developers.facebook.com/docs/mobile/ios/build/#sdk Whenever i am clicking Facebook button in my app it is showing login screen properly. 每当我在应用程序中单击Facebook按钮时,它就会正确显示登录屏幕。 But whenever i click on login button getting an alert as "Safari can not open the page because address is invalid". 但是,每当我单击登录按钮时,都会收到警告,提示“由于地址无效,Safari无法打开页面”。 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 . 即使我正确添加了SSO。 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? 如果我没记错,我遇到了同样的问题,就我而言,那是因为我没有在.plist中设置fb [YOUR_APP_ID],您是否正确设置了它?

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). 创建一个名为URL type的新行,其中包含一个单独的项目URL Schemes,其中包含单个值fb [YOUR_APP_ID](文字字符fb后跟您的应用程序ID)。

Try using YOUR_APP_ID in the Facebook Hackbook example project, find it here: https://github.com/facebook/facebook-ios-sdk/ 尝试在Facebook Hackbook示例项目中使用YOUR_APP_ID,在此处找到它: https//github.com/facebook/facebook-ios-sdk/

To test YOUR_APP_ID you need to change the project in two places: 要测试YOUR_APP_ID,您需要在两个地方更改项目:
1) In the .plist file 1)在.plist文件中
2) In HackbookAppDelegate.m search for the kAppId and set it to YOUR_APP_ID, 2)在HackbookAppDelegate.m中搜索kAppId并将其设置为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. 如果这可行,那么我们将知道您知道如何正确设置.plist,并且YOUR_APP_ID有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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