0

I am sending some data to php which stores the data in database. Another webpage will retreive data from database, this webpage will also contain a textbox and a button, upon clicking the button any data entered in the textbox should be send back to the same ipad. The question is . . how to send back the data from textbox to ipad? I am using HTTP POST method to send data to php from ipad.

1 Answer 1

1

You somehow need to establish a connection between your webserver (i presume you are using an external one not running on the iPad). These are many different ways to do this some of them are:

  1. Store the sent data somewhere and poll the input from the iPad.
  2. Open a server on the iPad. This might be a little complicated considering NAT and dynamic ips
  3. Anyway the best way would be to use Apple's Push notifications, which handle all the dirty work for you and even notify the user if your app is not in the foreground if you wish.

To do so you would have to open a socket in php if your webserver allows it and send a push notification to Apple's server. You can find a good introduction here: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Introduction/Introduction.html

UPDATE:

I didn't mention this earlier but if you don't want to write the apns comunication yourself there is a good open source php framework for that: http://code.google.com/p/apns-php/

1
  • Thanks for your useful answer and precious time! I'll go for apns Dec 14, 2012 at 10:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.