Nilesh
Nilesh

Reputation: 438

Is there any way through which server communicates with iPhone app without app asking for data?

Is there any way through which server can deliver data (ex. any status change) to app without app asking for it. For example I want server to deliver user status to app if there is any change without app keep asking for it. I know of push notifications(even silent push notification), is there any other way (preferably silent way)?

Upvotes: 1

Views: 56

Answers (2)

hris.to
hris.to

Reputation: 6363

You can use fairly simple:

PushNotifications

Or more complicated:

Sockets and Apple class for them NSStream

Reading From Input Stream

Upvotes: 2

Peter Segerblom
Peter Segerblom

Reputation: 2813

The http protocol relies on the request/response cycle so the server can not initiate communication in that scenario. If you really have a need for this you need to use another protocol stack that enables the server to keep a open connection so it can initiate communication. I don't really know what would be the best way to go here, maybe looking in to Web Sockets. I do think it's quite a lot of work.

Upvotes: 0

Related Questions