使用适用于iOS的SDK的Linkedin上的共享不起作用 [英] Share on Linkedin using the SDK for iOS doesn't work

查看:88
本文介绍了使用适用于iOS的SDK的Linkedin上的共享不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用iOS的移动SDK(版本:1.0.7)在LinkedIn上共享内容.我可以获得当前的帐户信息,但是当我尝试在LinkedIn上共享时,它总是会反馈错误说明.这是我的代码:

I'm using the mobile SDK for iOS (Version:1.0.7) to share something on LinkedIn. I can get the current account information, but when I try to share on LinkedIn,it always feedback the error description. This is my code:

let url:String = "https://api.linkedin.com/v1/people/~/shares"
let payload:String = "{\"comment\":\"Check out developer.linkedin.com! http://linkd.in/1FC2PyG\",\"visibility\":{\"code\":\"anyone\"}}"
if LISDKSessionManager.hasValidSession(){
    LISDKAPIHelper.sharedInstance().postRequest(url, stringBody: payload, success: { (response) -> Void in
          print("\(response.data)")
          }, error: { (apiError) -> Void in
          print("\(apiError.description)")
     })

有人遇到过同样的问题.请帮助我,非常感谢!

Has anyone ever facing the same issue. Please help me,thanks a lot!

推荐答案

当我没有设置正确的权限时,我遇到了同样的问题.

I had the same problem when I didn't set the correct permissions.

确保创建具有共享权限的会话.

Make sure create session with share permissions.

let permissions = [LISDK_BASIC_PROFILE_PERMISSION, LISDK_W_SHARE_PERMISSION]
LISDKSessionManager.createSession(withAuth: permissions, state: nil, showGoToAppStoreDialog: true, successBlock: ...

这篇关于使用适用于iOS的SDK的Linkedin上的共享不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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