我已經完成了從Swift 3中的應用程序的FB登錄。現在,我需要從Facebook獲取個人資料圖片。 Plzz誰能給我Swift 3中的解決方案?從swift中獲取FB中的用戶信息
0
A
回答
0
請試試這個。
let login = FBSDKLoginManager()
login.logIn(withReadPermissions: ["email"], from: self) { (result, error) -> Void in
if (error != nil) {
self.view.makeToast("Error")
}
else if (result?.isCancelled)! {
self.view.makeToast("Cancel")
}
else {
if (FBSDKAccessToken.current() != nil) {
FBSDKGraphRequest(graphPath: "me", parameters: ["fields":"id,interested_in,gender,birthday,email,age_range,name,picture.width(480).height(480)"]).start(completionHandler: { (connection, result, error) -> Void in
print(result)
})
}
}
}
+0
你能解決我在那裏完成的方式嗎?我已經提取了所有其他數據,只有現在我需要獲取圖片。提前謝謝@ Keyur Hirani –
+0
可能會聽到許可問題。將picture.type(大)替換爲picture.width(480).height(480) –
+0
我做到了...仍顯示爲空。 @ Keyur Hirani –
相關問題
- 1. 以XML格式從FB獲取用戶詳細信息
- 2. 從表單中獲取用戶信息
- 3. 使用PFFVideosUtilsV4在Swift中獲取Facebook用戶詳細信息Cocoapods
- 4. FB SDK獲取用戶的頁面信息
- 5. 從用戶信息中提取用戶信息
- 6. 在Swift中將CLBeacon的信息從AppDelegate獲取到View Controller中
- 7. 從NodeJS獲取請求中獲取Facebook用戶信息
- 8. 無法獲取朋友的fb列表中的其他用戶詳細信息?
- 9. SWIFT - 從mapkit獲取縣信息
- 10. Swift:從UITapGestureRecognizer獲取任意信息
- 11. 如何通過FB Graph API獲取用戶信息
- 12. 從DataGridView中獲取信息
- 13. 在App Insights中獲取用戶信息
- 14. 在Windows 8中獲取用戶信息?
- 15. ServletFilter中獲取用戶信息
- 16. Paypal從REST API獲取用戶信息
- 17. 從aadhaar號獲取用戶信息
- 18. 從facebook獲取用戶信息
- 19. 從log.nsf獲取用戶詳細信息
- 20. Rails:從YouTube獲取用戶信息
- 21. 從CouchDB獲取當前用戶信息?
- 22. 如何從WebContext獲取用戶信息?
- 23. 從MGTwitterEngine獲取用戶詳細信息
- 24. 從其他用戶獲取rhythmbox信息
- 25. 如何從Facebook獲取用戶信息?
- 26. 從令牌c獲取用戶信息#
- 27. 從facebook獲取用戶詳細信息
- 28. 從谷歌加API獲取用戶信息的信息與PHP
- 29. 從地址簿中獲取人的詳細信息swift macOS
- 30. Twitterizer獲取用戶信息
參見:http://stackoverflow.com/questions/28333951/getting-profile-picture-with-swift-through-facebook-graph-api-return-unsupporte –
你有任何錯誤,同時獲取圖片? – Birendra
不,任何錯誤!它顯示除了顯示圖片爲空之外的所有內容... @ Birendra –