How to use NSURLSession and NSURLRequest to fetch users feeds and update in a tableview for a social networking iOS app?

MD Singh

I am creating a social networking app in iOS for a university group and it's supposed to have display user feeds just like Facebook.

I am saving status updates in MySql database on a server. to update status I am using NSURLRequest and NSURLSession to send status data in post variables to the status update web service which uses php to update the database.

Now, I am confused about displaying the feeds. Here is what i want to do.

  1. I want to fetch 30 feeds first and display them in tableview.
  2. After 30 feeds if the user clicks on more, I want to be able to add another 30 and so on. just like Facebook, when you scroll to the bottom it shows more feeds.

I know how to make the first request and display 30 feeds, but I dont know how to do it the second time. Do I need to make another request? Can someone please explain how Facebook and Twitter do it?

jrturton

Your request needs to ask for a specific page or offset of the feed, and your server should handle this.

For the first feed, you'd ask for page 0. The server gives you items 1 - 30. At the app end, you keep track of the page you last requested. On the next request, you ask for page 1, and the server gives you items 31-60.

Alternatively, you can send the ID of the last item you have. So for the first request, you send nothing - the server gives you items 1-30. On the second request, you say "the last item in my current list is ID 14152" and the server gives you the next 30 items older than that.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Android Social Networking App

From Dev

Not offer update to current iOS App users

From Dev

How to programmatically update Networking Access Restriction on Azure Web App

From Dev

How do social networking websites handle notifications

From Dev

How to know the social networking websites security level

From Dev

In App Notifications For Social App IOS

From Dev

Users cannot update iOS app, after iTunes app transfer

From Dev

Swift NSURLSession NSURLRequest Cookies are not accepted

From Dev

Swift NSURLSession NSURLRequest Cookies are not accepted

From Dev

How to inform users for update of android app

From Dev

iOS XMPP How to display all users in single section in tableview

From Dev

How to troubleshoot iOS background app fetch not working?

From Dev

Networking pattern based on NSURLSession

From Dev

How to display users calendar in ios app

From Dev

How does facebook update the feeds dynamically?

From Dev

How to make a beautiful Tableview like Facebook ios app or tumblr app?

From Dev

How we can implement add to any(Social networking) in MobileFirst

From Dev

Converting Swift ios Networking to use Alamofire

From Dev

How to store users global information in social network

From Dev

How to make horizontal tableview like Twitter profile of iOS app

From Dev

How to change tableVIew height depending on the size of screen in iOS App

From Dev

How to notify users about app update which is not no play store

From Dev

Cloudkit social app - how to start

From Dev

On iOS App Vesion Update, will my app Users get the Updated version automatically

From Dev

Can I increment version number of iOS/Android app even users don't install app to update

From Dev

How to update the screenshot of an app on IOS 7

From Dev

How to respond if iOS update breaks my app?

From Dev

How to alert user of new update of iOS app

From Dev

How to develop an in-app update for iOS and Android?

Related Related

  1. 1

    Android Social Networking App

  2. 2

    Not offer update to current iOS App users

  3. 3

    How to programmatically update Networking Access Restriction on Azure Web App

  4. 4

    How do social networking websites handle notifications

  5. 5

    How to know the social networking websites security level

  6. 6

    In App Notifications For Social App IOS

  7. 7

    Users cannot update iOS app, after iTunes app transfer

  8. 8

    Swift NSURLSession NSURLRequest Cookies are not accepted

  9. 9

    Swift NSURLSession NSURLRequest Cookies are not accepted

  10. 10

    How to inform users for update of android app

  11. 11

    iOS XMPP How to display all users in single section in tableview

  12. 12

    How to troubleshoot iOS background app fetch not working?

  13. 13

    Networking pattern based on NSURLSession

  14. 14

    How to display users calendar in ios app

  15. 15

    How does facebook update the feeds dynamically?

  16. 16

    How to make a beautiful Tableview like Facebook ios app or tumblr app?

  17. 17

    How we can implement add to any(Social networking) in MobileFirst

  18. 18

    Converting Swift ios Networking to use Alamofire

  19. 19

    How to store users global information in social network

  20. 20

    How to make horizontal tableview like Twitter profile of iOS app

  21. 21

    How to change tableVIew height depending on the size of screen in iOS App

  22. 22

    How to notify users about app update which is not no play store

  23. 23

    Cloudkit social app - how to start

  24. 24

    On iOS App Vesion Update, will my app Users get the Updated version automatically

  25. 25

    Can I increment version number of iOS/Android app even users don't install app to update

  26. 26

    How to update the screenshot of an app on IOS 7

  27. 27

    How to respond if iOS update breaks my app?

  28. 28

    How to alert user of new update of iOS app

  29. 29

    How to develop an in-app update for iOS and Android?

HotTag

Archive