0
페이지 게시물 첨부 파일을 가져 오려고합니다.facebook 소식 첨부 파일 가져 오기 NullPointerException이 발생했습니다.
{
"attachments": {
"data": [
{
"media": {
"image": {
"height": 720,
"src": "url",
"width": 720
}
}
}
]
},
"id": "post_id"
}
내 @GET
요청 :
@GET("{post_id}")
fun getPostsAttachments(@Path("post_id") postId : String?,
@Query("access_token") authToken: String?,
@Query("fields") media : String?)
:Observable<AttachmentsList>
관찰 가능한 :
var getPostsAttachments: Observable<AttachmentsList> = facebook.getPostsAttachments(postId, "app_token", "attachments")
getPostsAttachments.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.subscribeBy(
onNext = { result ->
imgUrl?.addAll(result.data)
Log.d("TAG_NEXT", "$result")
},
onError = { throwable -> Log.d("TAG_ERROR", throwable.toString()) },
onComplete = { Log.d("TAG_COMPLETE", "$imgUrl") }
)
그리고 그것은 D/TAG_NEXT: AttachmentsList(data=null)
및 D/TAG_COMPLETE: null
를 반환 이것은 내가 얻으려고 JSON이다.
어떻게 해결할 수 있습니까? 어쩌면 내 링크 요청이 잘못 되었나요?