iphone SSO Facebook实现 [英] iphone SSO Facebook implementation

查看:152
本文介绍了iphone SSO Facebook实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于SSO实施Facebook的问题。我按照说明并添加到AppDelegate实现代码中:

   - (BOOL)应用程序:(UIApplication *)应用程序handleOpenURL :( NSURL *)url {
return [[_viewController facebook] handleOpenURL:url];
}

但是,我收到错误,

 未知接收者_viewController,你的意思是UIViewController? 

我将其更改为,并收到警告,

 类方法+ Facebook找不到

我正在使用位于这里的教程
https://developers.facebook.com/blog / post / 532 /

解决方案

您用于处理打开网址的方法执行不正确。您提供的链接具有以下代码示例。其中显示应用程序代理 Facebook 对象属性调用方法 handleOpenURL

   - (BOOL)应用程序:(UIApplication *)应用程序handleOpenURL:(NSURL *)url {
return handleOpenURL:URL];
}

在您提供的代码中,您尝试调用一个名为 code> facebook 在 _viewController 的实例上。 UIViewController没有一个名为'facebook'的类方法,这就是为什么你得到警告。

 类方法+脸书没有找到


Question regarding SSO Implementation of Facebook. I followed the instructions and added to the AppDelegate implementation code:

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
return [[_viewController facebook] handleOpenURL:url];
}

however, I get the error,

unknown receiver _viewController, did you mean UIViewController?

I change it to that, and I get the warning,

class method +facebook not found

I am using the tutorial located here https://developers.facebook.com/blog/post/532/

解决方案

The method you are using to handle opening the url is implemented incorrectly. The link you provided has the following code sample. Which shows the application delegates Facebook object property calling the method handleOpenURL.

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
    return [facebook handleOpenURL:url]; 
}

In the code you provided, you are attempting to call a class method called facebook on your instance of _viewController. UIViewController doesn't have a class method called 'facebook' this is why you're getting the warning.

class method + facebook not found

这篇关于iphone SSO Facebook实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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