I'm interested in a border line iPhone app able to detect the user location continuosly.
The app will be delivered in enterprise mode (so no Apple approval).
Basically it should run forever (resetting the backgroundTimeRemaining through the location service start end stop).
the issue that I was not able to fix is to relaunch the app after a reboot, event if I declare the voip capability, it seems that the system give me only 3 minutes, no more time despite all the workarounds.
so actually I'd like to know if someone was able to implement this sort of behaviour on iOS7.
thanks in advances, please find below some references.
iPhone - Backgrounding to poll for events
to run app continuously in the background
Background Location Services not working in iOS 7
Start Location Manager in iOS 7 from background task
ok, I got it.
the music hack is the solution.
During the further 180s of background time a small mute playback of few seconds (of local mp3) restart the backgroundTimeRemaining counter.
bye
Related
So, I'm developing an app that has a timer for about 5 minutes. During this time, the app should remain active. Accessing geolocation, counting steps, etc. The problem I'm facing is that the app falls asleep and the timer stops ticking.
I'm using react-native-background-timer for a timer. It shouldn't fall asleep, but it does. On both, android and ios. Actually it works perfectly fine when the app is in debug mode. But on release version without debug app simply falls asleep after about 3 minutes when the screen is turned off and timer stops ticking. It resumes when phone wakes up.
I can keep screen on all the time, with react-native-keep-awake, but I don't like this solution. Because my app also counts steps, and the phone should be ideally in the pocket. And with active screen, it will register accidental presses. Not good.
There should be a way. Phone calls can be really long with disabled screen and phone app doesn't sleep. I just don't know which direction to take. It's also hard to test, because with debug mode, app doesn't fall asleep at all. I need to run the release version and wait 3 minutes hoping the timer won't asleep.
Any ideas? Thanks.
My application run on iOS 8 and when it go into background it need to detect and show a notification to the user when iBeacon detected (with UILocalNotification).
All works fine but when the iPhone is sleep/locked the Notification doesn't wake up the device.
How can I wake up the device when a notification come in?
Make sure the phone is detecting the beacon at all. Try adding a NSLog statement inside the didEnterRegion method or wherever you launch the notification. Then, start looking at the debug console while the phone screen is off and turn on the beacon. Do you get a debug line?
If you do not see the debug line, the issue is with detection, not with the notification. Note that it can take up to 15 minutes on an iPhone 4S to detect a beacon.
If this does not help, please post your code that sets up region monitoring and sends the notification. Also, please, describe how you are testing entering and exiting the region.
I'm developing an app which uses ibeacon to determine if the user entered a specific region.
Now I'm using the CoreLocation framework to implement this geofencing-based feature.
I've read the document below.
https://developer.apple.com/library/mac/documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html
in which the Apple is saying that:
"In iOS, the regions you register with the location manager persist between launches of your application. If a region crossing occurs while your iOS app is not running, the system automatically wakes it up (or relaunches it) in the background so that it can process the event. When relaunched, all of the regions you configured previously are made available in the monitoredRegions property of any location manager objects you create. "
I discovered that it's true just before the ios 7.
From ios 7, An app will be waken-up from background but it will actually no longer could be re-launched from terminated-state (slided out from the task manager which displayed by double-clicking the home button).
If it's due to the Apple's policies, why does Apple not update the above official document?
So I'm thinking of an ios7's bug because the Reminder App (a built-in app) is also not relaunched in ios7 even though it's relaunched in ios6.
Is this issue due to Apple's policies? or an ios7's bugs?
It takes me more than 2 days to google for a solution.
Any ideas for this issue?
The documentation is simply out of date. This is intended behavior in iOS7. Apple produced a video explicitly discussing this change. The idea is that if the user explicitly terminates the app, the user does not want it running. See this thread.
Is this such a big deal? How often will users really do this? Remember, if users are annoyed by you app, they can always uninstall it, too. This was true in iOS6.
iOS 7.1 reversed this policy. That is even if the user kills your app the iOS still launches your app upon crossing the region.
This was always impossible in iOS6 and below however with the new multitasking API's etc in iOS7 I was wondering if it has become possible. I am developing an app that is for personal security... The user needs to be able to trigger an "an" inside of the app when in background mode... The shake function would be the best approach however so far it seems impossible..
Any help would be greatly appreciated. T
The background tasking feature is not what you think. Apple heavily regulates it's use. You're probably thinking of the new iOS 7 background feature called "Background fetch". You can count on being activated for partial background execution as a batch job every few hours.
The new background fetch feature is to be used when: "The app regularly downloads and processes small amounts of content from the network."
This will let you update the state of your app in the background so that the new iOS 7 multitasking feature lets you see an updated state of the app in that view. There is no iOS 7 background state that does what you want.
I have an app with a behavior that I want to copy. The app can play music in the lock screen state. The app can also turn off the screen at this state. I'm not too sure if the app is placing the Mac in sleep mode but the white indicator light on the front of the Mac book is on but is not pulsing while the display is off.
I know how to play music and place the mac in the lock screen state using apple script. What I don't know how to do is turn off the display and have the indicator light turned on. This behavior is similar to when the Mac is in sleep mode. Any ideas as to how this can be done programmatically using objective-c and/or apple script?
I cannot use anything that is not documented by Apple. I am running the latest version of OSX Lion.
If you hold down the command, shift and eject buttons at the same time, the screen goes dark instantly. I just confirmed this in 10.7.1.
As for Applescripting Display Sleep, it's not trivial. I did find a probable solution in this thread:
http://macscripter.net/viewtopic.php?pid=135732#p135732
Give it a try and see if it accomplishes what you are looking for.