Facebook集成v4.0不适用于iPhone App [英] Facebook Integration v4.0 Not Working for iPhone App

查看:101
本文介绍了Facebook集成v4.0不适用于iPhone App的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是iPhone应用程序开发的入门者.我想使用自己的自定义UI来实现使用Facebook登录".

我已经尝试了入门FB集成

我尝试使用适合自定义ui的FBSDKLoginManager来实现登录.

我已经添加了FB集成所需的所有内容.在.plist文件中添加了所有必要的内容.

我的应用程序正在运行,并进入浏览器并要求登录.当我提供凭据时,它会要求个人资料"访问权限.

到目前为止,我不会收到任何错误.当我授予对该请求的访问权限时,我得到的响应是iOS模拟器中的"Safari无法打开页面.因为地址无效",iPad中的FB应用程序中的空白.

我不会将控件转移回我的应用程序.我已经搜索了此问题,但未得到任何适当的答复.

有人可以帮助我摆脱这个问题吗?

我正在使用最新的FacebookSDK v4.

我还将提供我的.plist文件和快照.

在我的AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    return [[FBSDKApplicationDelegate sharedInstance] application:application
                                    didFinishLaunchingWithOptions:launchOptions];
}


- (void)applicationDidBecomeActive:(UIApplication *)application
{

    [FBSDKAppEvents activateApp];

}


- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {

    return [[FBSDKApplicationDelegate sharedInstance] application:application
                                                          openURL:url
                                                sourceApplication:sourceApplication
                                                       annotation:annotation];
}

.plist文件快照:

因此,请帮忙解决此问题..或者给我适当的步骤以实施FB登录

预先感谢.

解决方案

我只能建议您按照以下步骤进行操作,因为新的Facebook SDK也存在一些问题,但是在仔细检查了所有设置步骤后再次,我设法使其全部正常工作:

  1. 确保已创建您的应用程序,并在Facebook上列出 应用程序

  2. 如果是这种情况,请确保在您的应用程序的Facebook开发人员页面上添加了您的捆绑包ID,并且该ID也与您项目中的捆绑包ID相匹配

  3. 确保该应用程序是公开的,或者您要登录的帐户已在您的Facebook应用程序的角色页面中列出,网址为Getting Started FB integration

    I've tried to implement Login using FBSDKLoginManager forwhich suits for custom ui.

    I've added all those things needed for FB integration. Added all necessary things in .plist file.

    My App is running and Goes into the browser and asks for login. When i provide my credentials, then it asks for Profile access permission.

    Upto this, i won't get any error. When i grant access to that request, i got the response as "Safari cannot open the Page. Because the address is invalid" in iOS Simulator and Empty blank space in FB app in iPad.

    I won't get the control transfer back to my application. I've searched for this issue and won't get any proper response.

    Can anybody assist me to get out of this issue?

    I'm using Latest FacebookSDK v4.

    I'll also provide my .plist file and Snapshots.

    In my AppDelegate.m

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
        return [[FBSDKApplicationDelegate sharedInstance] application:application
                                        didFinishLaunchingWithOptions:launchOptions];
    }
    
    
    - (void)applicationDidBecomeActive:(UIApplication *)application
    {
    
        [FBSDKAppEvents activateApp];
    
    }
    
    
    - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    
        return [[FBSDKApplicationDelegate sharedInstance] application:application
                                                              openURL:url
                                                    sourceApplication:sourceApplication
                                                           annotation:annotation];
    }
    

    .plist File Snapshot:

    So kindly help to get out of this issue.. Or Give me the proper steps to implement the FB Login

    Thanks in Advance.

    解决方案

    I could only suggest you go through these steps, as I had some issues as well with the new Facebook SDK as well, but after double checking all their setup process again I managed to make it all work properly :

    1. Make sure you have your app created and listed at Facebook Applications

    2. If that's the case, then make sure your bundle id is added at the Facebook Developers page for that app and it also matches with the one you have inside your project

    3. Make sure the app is either public, or the account you are trying to log in with is listed in the roles page for your Facebook application at https://developers.facebook.com/apps/APPID/roles/

    4. Make sure you implement the FBSDKLoginButtonDelegate if you're using the native Facebook login button and also the delegate methods, load its class in the delegate and setting its permissions, OR properly implement FBSDKLoginManager, which I see it's your case.

    5. What I had problems with, but I see that you did not skipped, is having all the juicy stuff implemented in the Application Delegate, which I skipped, since I jumped directly at the Login implementation tutorial.

    6. Also critical are the three (3) values you need to add in your Info.plist with the Facebook App ID, Facebook Display Scheme and URL Schemes, but I can see that you already covered that as well.

    I suggest going again through my first three steps I mentioned. Those (or just one) seem to be the root of your problem. Or not.

    这篇关于Facebook集成v4.0不适用于iPhone App的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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