开发者

send iPhone current location at a particular time

开发者 https://www.devze.com 2023-02-13 20:21 出处:网络
I want to write a program that sends GPS location (lattitude, longitude) at a particular time... so it\'s like an alarm, but it\'s not buzzing, instead of sending locations at a particular time.

I want to write a program that sends GPS location (lattitude, longitude) at a particular time... so it's like an alarm, but it's not buzzing, instead of sending locations at a particular time.

Th开发者_StackOverflow中文版e best way I can think of it is by push notifications from the server, but this would be useless

UPDATE:

I actually wanna create something similar to this, automatic checkin. If this app can be done then what I wanna do is easy, I just check the time, if it fits checkin if not pass.


What you want to do is not practically possible. Unless you use a method to keep your app active in the foreground all of the time, the alarm time will pass and your app will not be activating to run any code. Push notifications from a server are allowed to play sounds, display messages or change your app's badge number, but they do not run code in your app. Background execution is limited to 10 minutes of runtime, after which the OS will kill your app.


You can let run application in background forever if it uses at least one of this service: GPS, Voip or Music. For any other app the 10 minutes limit will kill them.

Put this in your application .plist file

  <key>UIBackgroundModes</key>
    <array>
            <string>location</string>
    </array>
0

精彩评论

暂无评论...
验证码 换一张
取 消