How to use batch transfer option for paging in facebook android development

In fact, I turn to a list of 25 pages that I liked (in all my duration of accessing facebook) on

String graphPath = "me" Bundle bun = new Bundle(); bun.putString("fields", "music.fields(name,videos.fields(name))"); mAsyncRunner.request(graphPath, bun, "GET", object, null); 

where did I get the data that I displayed in my View list, and there is also JsonObject (paging) associated with:

 https://graph.facebook.com/100002420343415/music?fields=name,videos.fields%28name%29&access_token=CAAGjblaPDxoBAMH5FZBhdbJoJNALA0IiRGBgxLlWxlLixxTtxMUPVeo0AMkM1ZAFLZAOT7urdd1HeP1LQPJVsTSM9LDcnRUyABjSAxOHuljzRwkcbTHsPDloeA9CmZBMNPywubLPdz7PDrqaT3AC7MVxNHYLJh5tVhKI8tlAaZBoIWGGMhNKF&limit=25&offset=25&__after_id=219447808080269 

After receiving this, I want to access the pages that are between limit=25&offset=25&__after_id=219447808080269 , for this I use

 Bundle bun = new Bundle(); bun.putString("fields", "music.fields(name,videos.fields(name))"); bun.putString("limit","25"); bun.putString("offset","25"); bun.putString("__after_id","219447808080269"); mAsyncRunner.request(graphPath, bun, "GET", object, null); 

After doing this, I get the same data as 1st 25 Search , I also tried this,

 Bundle bun = new Bundle(); bun.putString("fields", "music.fields(name,videos.fields(name)&limit=5000&offset=5000&__after_id=206483212727507)"); 

but I found here that I need to change the graphPath path, so I set this graphPath as me/music

thanks, tushar.

+4
source share
2 answers

This will help:

 Bundle bun = new Bundle(); bun.putString("fields", "music.fields(name,videos.fields(name)).limit(10)." + "access_token("+facebook.getAccessToken()+").offset(10).__after_id(265025693519613)"); 
+1
source

I'm not quite sure about this, but I tried a similar query

 me/music?__after_id=108196079208151 

in the graph explorer, and it worked incorrectly, but if I execute this

 me/music?offset=1 

then it works fine. I think the offset and __after_id are in some way conflicting.

As a hint, first check the graph api results to examine .

0
source

Source: https://habr.com/ru/post/1498328/


All Articles