草庐IT

iphone - LinkedIn Integration r_network 和 w_messages 请求不能在 iOS sdk 中协同工作

coder 2024-01-17 原文

我已经完成了 LinkedIn 集成,我必须向特定用户发送消息。为此,我首先获取连接,然后发送消息。

(void)requestTokenFromProvider { OAMutableURLRequest *request = [[[OAMutableURLRequest alloc] initWithURL:requestTokenURL consumer:self.consumer token:nil callback:linkedInCallbackURL signatureProvider:nil] autorelease];

[request setHTTPMethod:@"POST"];

OARequestParameter *nameParam = [[OARequestParameter alloc] initWithName:@"scope" value:@"r_basicprofile+w_messages+r_network"];

NSArray *params = [NSArray arrayWithObjects:nameParam, nil]; [request setParameters:params];

OARequestParameter * scopeParameter=[OARequestParameter requestParameter:@"scope" value:@"r_basicprofile"];

[request setParameters:[NSArray arrayWithObject:scopeParameter]];

OARequestParameter * networkParameter=[OARequestParameter requestParameter:@"scope" value:@"w_messages"];

[request setParameters:[NSArray arrayWithObject:networkParameter]];

OARequestParameter * netParameter=[OARequestParameter requestParameter:@"scope" value:@"r_network"];

[request setParameters:[NSArray arrayWithObject:netParameter]];

OADataFetcher *fetcher = [[[OADataFetcher alloc] init] autorelease]; [fetcher fetchDataWithRequest:request delegate:self didFinishSelector:@selector(requestTokenResult:didFinish:) didFailSelector:@selector(requestTokenResult:didFail:)]; }

当我同时发送 w_messages 和 r_network 请求时,其中一个不工作,输出为“访问连接被拒绝”或“访问发送邀请被拒绝。”

如果我将两者分别与 r_basicprofile 一起使用,那么它们工作正常,但是当我将它们一起使用时,其中一个的访问被拒绝。我没有得到任何线索。请帮助。

最佳答案

我刚得到解决方案。根据要求,我需要像这样通过。

OARequestParameter *nameParam = [[OARequestParameter alloc] initWithName:@"scope" value:@"r_basicprofile+w_messages+r_network"];

 NSArray *params = [NSArray arrayWithObjects:nameParam, nil];

 [request setParameters:params];

 OARequestParameter * scopeParameter=[OARequestParameter requestParameter:@"scope" value:@"r_basicprofile w_messages r_network"];

[request setParameters:[NSArray arrayWithObject:scopeParameter]];

关于iphone - LinkedIn Integration r_network 和 w_messages 请求不能在 iOS sdk 中协同工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17785452/

有关iphone - LinkedIn Integration r_network 和 w_messages 请求不能在 iOS sdk 中协同工作的更多相关文章

  1. ruby-on-rails - rails 教程 : Putting flash messages in partial yields error "undefined method ` each' for nil:NilClass"? - 2

    这个问题在这里已经有了答案:关闭10年前。PossibleDuplicate:FlashMessagesinPartials(Rails3)我正在做MichaelHartl的Railstutorial和listing7.26将flash消息添加到应用程序布局:...">...这很好用。但是,我试图通过在我的部分文件夹中创建一个_flash.html.erb来清理这段代码...">-->...并且比使用......在我的应用程序布局中,我的所有Rspec测试开始失败,每个测试都显示以下消息:Failure/Error:before{visitsignup_path}ActionView:

  2. ruby-on-rails - Railscasts 第 362 集 - 导出到 Excel : How to avoid the warning message given by Excel 2010 when opening the file? - 2

    当使用RyanBates的Railscasts第362集关于导出到Excel(https://github.com/railscasts/362-exporting-csv-and-excel)的示例应用程序时,我注意到Excel2010(在Windows上)在打开.xls文件时给我一条警告消息我使用“下载为Excel”链接下载的文件。警告内容如下:“您尝试打开的文件...的格式与文件扩展名指定的格式不同。打开文件前请确认文件未损坏且来源可靠。是否要打开现在存档吗?”当我单击"is"时,我可以很好地打开文件。在使用Excel2011(在Mac上)时,我什至没有收到警告消息。但我希望能够

  3. ruby-on-rails - Rails 4.2 Action Controller :BadRequest custom error message - 2

    如果验证失败或参数丢失,我想从我的Controller返回400-错误请求。所以在我的Controller中如果有ifparams["patch"].nil?thenraiseActionController::BadRequest.new("TheJsonbodyneedstobewrappedinsidea\"Patch\"key")end我在我的应用程序Controller中发现了这个错误:rescue_fromActionController::BadRequest,with::bad_requestdefbad_request(exception)renderstatus:4

  4. iphone - 扩展 restful_authentication/AuthLogic 以支持匿名 iPhone 的延迟登录的最佳方法是什么? - 2

    我正在构建一个与RubyonRails后端对话的iPhone应用程序。RubyonRails应用程序还将为Web用户提供服务。restful_authentication插件是提供快速和可定制的用户身份验证的绝佳方式。但是,我希望iPhone应用程序的用户在新列中存储一个由手机的唯一标识符([[UIDevicedevice]uniqueIdentifier])自动创建的帐户。稍后,当用户准备好创建用户名/密码时,帐户将更新为包含用户名和密码,iPhone唯一标识符保持不变。用户在设置用户名/密码之前不能访问该网站。然而,他们可以使用iPhone应用程序,因为该应用程序可以使用它的标识符

  5. Two-Stream Convolutional Networks for Action Recognition in Videos双流网络论文精读 - 2

    Two-StreamConvolutionalNetworksforActionRecognitioninVideos双流网络论文精读论文:Two-StreamConvolutionalNetworksforActionRecognitioninVideos链接:https://arxiv.org/abs/1406.2199本文是深度学习应用在视频分类领域的开山之作,双流网络的意思就是使用了两个卷积神经网络,一个是SpatialstreamConvNet,一个是TemporalstreamConvNet。此前的研究者在将卷积神经网络直接应用在视频分类中时,效果并不好。作者认为可能是因为卷积神经

  6. ruby-on-rails - ruby rails : why do i get message for javascript and css after rails s? - 2

    railss=>StartedGET"/assets/application.css?body=1"for127.0.0.1at2011-10-1103:37:03-0900Servedasset/application.css-304NotModified(0ms)StartedGET"/assets/home.css?body=1"for127.0.0.1at2011-10-1103:37:03-0900Servedasset/home.css-304NotModified(0ms)StartedGET"/assets/jquery_ujs.js?body=1"for127.0.0

  7. Spring 国际化遇到的坑 No message found under code ‘xxx.xxxx‘ for locale ‘zh_CN‘ - 2

    Spring国际化遇到的坑org.springframework.context.NoSuchMessageException:Nomessagefoundundercode‘xxx.xxxx’forlocale‘zh_CN’背景以前做的项目客户群体只有国内的客户,从来没有考虑过语言文字的问题。这次有一个需求的返回内容,要根据客户设置的语言返回不同的语言。尝试使用了以后,结果发现怎么都不好使,一直报的一个错误如下:org.springframework.context.NoSuchMessageException:Nomessagefoundundercode'user.name'forloc

  8. ruby - 使用 NFS 和 private_network 时将 Vagrant VM 公开到网络 - 2

    我有一个多机Vagrant设置。使用NFS和private_network我可以让我需要的一切正常工作(Drupal、PHP等),除了允许大厅下面的人访问我的VM上运行的Web应用程序。我了解private_network使得无法从外部连接到VM。有没有一种方法可以同时创建私有(private)网络和公共(public)网络,以便除负载均衡器之外的所有VMS都是私有(private)的,并且可以通过主机的ip访问负载均衡器?hosts={"wloadlocal"=>"192.168.33.10","wweblocal1"=>"192.168.33.11","wweblocal2"=>"

  9. iphone - 设计和 Rails 3 中的 http 身份验证 - 2

    我有一个使用deviseonrails3的应用程序。我想启用http身份验证,以便我可以从iPhone应用程序向我的网络应用程序进行身份验证。如何从我的iPhone应用程序进行身份验证以进行设计?这安全吗?还是我应该进行不同的身份验证? 最佳答案 从设计的角度来看,您有3个选择:1)使用基本的http身份验证:您的iPhone应用程序有一个secretkey-这是在您的iPhone应用程序代码中烘焙的-用于对网络应用程序的每个请求进行身份验证。Google搜索:“设计基本的http身份验证”2)您可以通过在您的iPhone应用程序中

  10. ruby-on-rails - { "error": { "message": "Missing client_id parameter.", "type": "OAuthException", "code": 101 } } - 2

    我正在关注RyanBatesScreenCast#360Facebook身份验证...当我到达点击链接登录facebook的部分时,我得到一个{"error":{"message":"Missingclient_idparameter.","type":"OAuthException","code":101}}我尝试像之前所说的那样重新启动服务器我正在拔头发试图弄清楚这一点我在facebook开发页面上的网站url是正确的我已经按照他的步骤数百次 最佳答案 可能是你没有为FACEBOOK_KEY和FACEBOOK_SECRET设置e

随机推荐