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 Linked
This works in 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)")
})
}
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: ...