我閱讀FacebookSDK
:https://developers.facebook.com/docs/sharing/ios/send-button,我只能看到imageURL上傳到Facebook。用FBSDKShareButton將圖像上傳到Facebook
NSURL *contentURL = [[NSURL alloc] initWithString:
@"http://en.wikipedia.org/wiki/Facebook"];
NSURL *imageURL =
[NSURL URLWithString:@"http://upload.wikimedia.org/wikipedia/commons/thumb/9/95/Facebook_Headquarters_Menlo_Park.jpg/2880px-Facebook_Headquarters_Menlo_Park.jpg"];
_sendButton.shareContent = [[FBSDKShareLinkContent alloc]
initWithContentURL: contentURL
contentTitle: @"My Share Title"
contentDescription: @"Lorem ipsum dolor sit amet."
imageURL: imageURL
peopleIDs: nil
placeID: nil
ref: nil
];
我試過的東西與shareButton
:
let shareButton = FBSDKShareButton()
shareButton.center = view.center
let content = FBSDKShareLinkContent()
content.contentTitle = caption
content.imageURL = NSURL(string: "https://upload.wikimedia.org/wikipedia/commons/thumb/9/95/Facebook_Headquarters_Menlo_Park.jpg/2880px-Facebook_Headquarters_Menlo_Park.jpg")
shareButton.shareContent = content
view.addSubview(shareButton)
我可以輕鬆上傳這我的時間線。
但我只想發送我從PhotoLibrary上傳到Facebook的圖像。是可以的,因爲我當我嘗試content.image
(這裏沒有提示)
Facebook或維基百科? https://developers.facebook.com/docs/sharing/ios – Dare
分享前將其保存到磁盤 –
@LeoDabus然後,我必須從磁盤獲取此URL並上傳到我的時間軸? – Khuong