【问题标题】:Share on Linkedin using the SDK for iOS doesn't work使用适用于 iOS 的 SDK 在 Linkedin 上分享不起作用
【发布时间】:2016-07-15 14:30:39
【问题描述】:

我正在使用适用于 iOS 的移动 SDK(版本:1.0.7)在 LinkedIn 上分享一些内容。我可以获取当前账号信息,但是当我尝试在LinkedIn上分享时,它总是反馈错误描述。这是我的代码:

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)")
     })

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

【问题讨论】:

  • 你有什么办法解决这个问题吗...?

标签: ios swift share linkedin


【解决方案1】:

这适用于 Swift:-

        if LISDKSessionManager.hasValidSession() {

        LISDKAPIHelper.sharedInstance().postRequest(url, stringBody: payload, success: {
            response in
            //Do something with the response
            print("\(response.data)")

            }, error: {
                error in
                //Do something with the error
                print("\(error.description)")
        })
    }

【讨论】:

  • 非常感谢,但这对我不起作用。我仍然收到错误描述:errorError Domain=LISDKErrorAPIDomain Code=403 "(null)",UserInfo={LISDKAuthErrorAPIResponse=}。运行 samplApp 时,我也得到同样的错误:errorCode:0,status:403。你有什么想法
  • 检查您是否已经在领英分享了内容。 LinkedIn 不允许重复的帖子。删除帖子并再次检查
  • 嗨,我需要帮助,我如何在没有 LinkedIn 应用程序的情况下共享数据,因为如果没有链接应用程序安装,那么它会显示首先安装应用程序的弹出窗口。
  • 你好,我面临同样的错误 403 null,关于这个错误的任何想法
【解决方案2】:

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

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-06-10
    • 1970-01-01
    • 2017-11-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多