我已經完成了從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. 使用PFFVideosUtilsV4在Swift中獲取Facebook用戶詳細信息Cocoapods
- 3. 從用戶信息中提取用戶信息
- 4. 從NodeJS獲取請求中獲取Facebook用戶信息
- 5. 如何通過FB Graph API獲取用戶信息
- 6. 在Swift中將CLBeacon的信息從AppDelegate獲取到View Controller中
- 7. Swift:從UITapGestureRecognizer獲取任意信息
- 8. SWIFT - 從mapkit獲取縣信息
- 9. 如何從Facebook獲取用戶信息?
- 10. 從aadhaar號獲取用戶信息
- 11. 從其他用戶獲取rhythmbox信息
- 12. 從facebook獲取用戶信息
- 13. 從log.nsf獲取用戶詳細信息
- 14. 從MGTwitterEngine獲取用戶詳細信息
- 15. 從CouchDB獲取當前用戶信息?
- 16. 從令牌c獲取用戶信息#
- 17. 如何從WebContext獲取用戶信息?
- 18. Drupal:獲取用戶信息
- 19. 獲取用戶信息
- 20. Sharepoint獲取用戶信息
- 21. 從地址簿中獲取人的詳細信息swift macOS
- 22. 無法獲取帳戶信息解析和FB SDK
- 23. 從FB到Asp.Net獲取城市和關於我的信息
- 24. 從Python獲取YouTube用戶信息Python中的Google API(API v3)
- 25. 從NSTimer的用戶信息中獲取一個Int
- 26. 從CakePHP中的Model獲取用戶信息
- 27. 無法從Ruby中的google api獲取用戶信息
- 28. 從Xenforo用戶信息中獲取陣列項目
- 29. 從預約架構中獲取用戶信息
- 30. 從Active Directory中獲取用戶詳細信息
參見:http://stackoverflow.com/questions/28333951/getting-profile-picture-with-swift-through-facebook-graph-api-return-unsupporte –
你有任何錯誤,同時獲取圖片? – Birendra
不,任何錯誤!它顯示除了顯示圖片爲空之外的所有內容... @ Birendra –