![](/img/trans.png)
[英]share post on linkedin using ios swift 3 and linkedin sdk is not working
[英]Share on Linkedin using the SDK for iOS doesn't work
我正在使用 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)")
})
有沒有人遇到過同樣的問題。 請幫幫我,非常感謝!
這適用於斯威夫特:-
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)")
})
}
當我沒有設置正確的權限時,我遇到了同樣的問題。
確保創建具有共享權限的會話。
let permissions = [LISDK_BASIC_PROFILE_PERMISSION, LISDK_W_SHARE_PERMISSION]
LISDKSessionManager.createSession(withAuth: permissions, state: nil, showGoToAppStoreDialog: true, successBlock: ...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.