简体   繁体   English

Facebook集成v4.0不适用于iPhone App

[英]Facebook Integration v4.0 Not Working for iPhone App

I'm a starter in iPhone application development. 我是iPhone应用程序开发的入门者。 I'd like to implement 'Login With Facebook' Using my own customized UI. 我想使用自己的自定义UI实现“使用Facebook登录”。

I've tried all steps provided in Getting Started FB integration 我已经尝试了FB入门集成中提供的所有步骤。

I've tried to implement Login using FBSDKLoginManager forwhich suits for custom ui. 我尝试使用适合自定义ui的FBSDKLoginManager实现Login。

I've added all those things needed for FB integration. 我已经添加了FB集成所需的所有东西。 Added all necessary things in .plist file. 在.plist文件中添加了所有必要的内容。

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. 当我授予对该请求的访问权限时,我得到的响应是iOS模拟器中的“ Safari无法打开页面。因为地址无效”和iPad中FB应用程序中的空白。

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. 我正在使用最新的FacebookSDK v4。

I'll also provide my .plist file and Snapshots. 我还将提供.plist文件和快照。

In my AppDelegate.m 在我的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: .plist文件快照:

Info.plist文件快照

So kindly help to get out of this issue.. Or Give me the proper steps to implement the FB Login 因此,请帮忙解决此问题。.或给我适当的步骤以实现FB登录

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

  1. Make sure you have your app created and listed at Facebook Applications 确保已创建您的应用程序并在Facebook应用程序中列出

  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 如果是这种情况,请确保在该应用程序的Facebook开发人员页面上添加了您的捆绑软件ID,并且该ID也与您项目中的ID匹配

  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/ 确保该应用程序是公开的,或者您尝试登录的帐户在您的Facebook应用程序的角色页面中列出, 网址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. 如果使用本地Facebook登录按钮以及委托方法,请确保实现FBSDKLoginButtonDelegate ,在委托中加载其类并设置其权限, 或者正确实现FBSDKLoginManager ,我认为这是您的情况。

  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. 我遇到了问题,但我发现您没有跳过,是在Application Delegate实现了所有多汁的东西,而我跳过了,因为我直接跳到了Login实施教程。

  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. 同样重要的是您需要在Info.plist添加带有Facebook App ID,Facebook Display Scheme和URL Schemes的三(3)个值,但是我可以看到您已经介绍了它。

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. 或不。

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

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