从服务器发送和获取设备位置
我对 Objective-C 还很陌生,想编写一个 iPhone 应用程序。
iPhone 应用程序应在首次启动时将设备 ID 发送到服务器,
即使应用程序在后台,设备也应该在给定的时间间隔内发送其位置,并且当前位置与 ID 一起存储。 如果 iPhone 靠近给定的其他位置,服务器应向设备发送一条消息,以便屏幕上出现警报视图。
我不希望有手册来对此进行编程,但如果您能给我一些要查找的关键字和我确实需要使用的类,我会很高兴。
I am pretty new to Objective-C and want to write an iPhone app.
The iPhone app should send the device-ID to a server when it is started the first time,
and even if the app is in the background, the device should send its position in a given time interval and the current position is stored with the ID.
If the iPhone is near a given other position, the server should send a message to the device such an alert view appears on the screen.
I don't expect a manual to program this, but I would be happy if you can give me some key words to look up and classes I definitely need to use.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯,听起来你需要 CoreLocation 框架
http: //developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CoreLocation_Framework/_index.html
这将处理设备的定位。
UDID(设备 ID)相当简单,快速谷歌即可找到该代码。
您还需要研究多任务处理,特别是下面的链接,以便在应用程序处于后台时执行代码。
http://developer.apple.com/库/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/BackgroundExecution/BackgroundExecution.html
Well, sounds like your gonna need the CoreLocation framework
http://developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CoreLocation_Framework/_index.html
That'll handle the positioning of the device.
The UDID (device id) is fairly straight forward, a quick google will get you that code.
You'll also need to look into multitasking, specifically the link below, to execute code when the app is in the background.
http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/BackgroundExecution/BackgroundExecution.html