objective c - Handle Paginated api on the client side -


i've created api following 3 parameters page, longitude, latitude. when doing request pass users location , given page , api return page of organizations sorted users location. data saved/updated on client side in mobile database. question when trying populate data in view, how on client side know data updated , not since paginated api update/save number of objects on page?

so far i've tried populate number of objects retrieved on page, objects in api might switch page depending on how user changes position? i've thought making kind of flag in mobile database objects when requesting data, not quite sure in case?

i'm inclined think local database relevant current location of user, defined it's longitude , latitude. suggest clean local database if user changes position, , repopulate server new position.

that simplistic approach. if, mention, nearby location organizations appeared in different page in previous location, possible optimisation store in db current page (and position within page) of each organization. when retrieve new location, check if each organization received stored in db (organizations need have unique id this), , alter position/page match received server new location.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -