我无法为自己以外的用户创建GraphRequest.newGraphPathRequest()
。即使我在页面角色下将其他用户添加为Developer
/ Tester
,但当他们登录graphObject
data
数组时,该用户为空。
这是我访问用户照片的功能(仅对我有效,管理员):
val userPhotos = GraphRequest.newGraphPathRequest(
result.accessToken,
"/${result.accessToken.userId}/photos"
) { response ->
Log.d(TAG, response.toString())
val array = response.jsonObject.getJSONArray("data") // {Response: responseCode: 200, graphObject: {"data":[]}, error: null}
Log.d(TAG, array.toString()) // []
val firstImageId = if (array.getJSONObject(0) != null) array.getJSONObject(0).getString("id") else null
val secondImageId = if (array.getJSONObject(1) != null) array.getJSONObject(0).getString("id") else null
val profilePicUrl = Profile.getCurrentProfile().getProfilePictureUri(400, 400).toString()
generateUserImages(arrayOf(
profilePicUrl, getFacebookImageFromId(firstImageId), getFacebookImageFromId(secondImageId)
))
}.executeAsync()
当他们登录时如何启用权限访问?