virata
virata

Reputation: 1866

How to retrieve gps co-ordinates of my iPhone to my server to show on my website?

I'm working on a security app on iPhone. I want to show the real time position of users iPhone ,any time when user clicks "find device" on website.(provided- user has installed my app on iphone and has registered on my website.)

In my previous webservices what I used to do is,request to server for some information and server would respond the request.(using NSURLRequest and NSURLConnection from device)

But here the case is, my device is not requesting the server for some response;user will be requesting the server from website to locate the device. here I cant use NSURLRequest and NSURLConnection.

I can get my gps co-ordinates on my iphone programmatically. issue is, just to pass those co-ordinates to my server ONLY when server is asking my device to do that. How should I achieve that??

Thanks for any suggestions.

Upvotes: 2

Views: 271

Answers (1)

Alan Zeino
Alan Zeino

Reputation: 4396

You can't. The only way to say, 'ping' a device with data is with apns - and that won't invoke a handler for you, that'll just send a notification to the device. Make the app periodically send back its location to the server with a background handler - that's all you can do.

Upvotes: 2

Related Questions