我正在使用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)")
})有没有人遇到过同样的问题。请帮帮我,谢谢!
发布于 2016-04-12 20:21:30
这在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)")
})
}发布于 2018-04-22 12:03:30
当我没有设置正确的权限时,我也遇到了同样的问题。
确保创建具有共享权限的会话。
let permissions = [LISDK_BASIC_PROFILE_PERMISSION, LISDK_W_SHARE_PERMISSION]
LISDKSessionManager.createSession(withAuth: permissions, state: nil, showGoToAppStoreDialog: true, successBlock: ...https://stackoverflow.com/questions/36260516
复制相似问题