How to create iPhone app without user operation in response to the iBeacon detection - ios

Is it possible the following behaviors on my iPhone app ?
1) Proccess begins in background ,when detecting iBeacon wave.
2) Proccess begins with a screen, when detecting iBeacon wave, but
the application will finish automatically(without any user operations) after proseccing.

To simply put it, no. In order for your code to execute in the first place, the user needs to tap on the app. That sort of style application MAY be able to work on Android, but not on iPhone.
You CANNOT start an application from the background.
Also, when it's in the background, you CANNOT bring its UI up and obstruct what the user's trying to do.

Related

ios app, running accelerometer while the app is in the background

I have an app using accelerometer. When a certain motion is detected, i am trying to make my iphone vibrate. While the app is in the foreground, and I conduct a certain motion, it vibrates. But it does not when the app is in the background.
I have a counter that detects this motion. When I execute this motion while in the background for three times, although it does not emit any vibration, after I transition back to foreground, the counter is increased by three. So I know the accelerometer is working. Or is putting the motions in a queue and executing it when the app comes back to foreground.
And I'm not making a rookie mistake by touching the phone's vibrate to off.
I'm quite not sure where to go from here. Is iphone inherently not capable of capturing and processing accelerometer data while in the background? Or is there something I'm not doing correctly?
In iOS there are only a certain type of activities allowed in background. Here you can check them: Background Modes.
I'm currently working in an app that uses sensors like the accelerometer and I get updates from it using the CoreLocation delegate method didUpdateLocation, since using the GPS to locate the device is one of the Apple allowed background modes. I hope this helps you!

iOS - App in Background vs Local Notifcations

I'm building a project which is something like an Alarm Clock app. I know there are inherit limitations here (as compared to the built-in Apple Clock app) but I'm trying to assess if these limitations will be a blocker.
In the end, I need to be able to schedule an alarm/notification at a certain time, and have it sound when the phone is locked. Furthermore, I want to be able to interact with the app from the lock screen (including shake and volume gestures).
Does this require me having the app run in the background, and scheduling LocalNotifications? If its in the background, and the LocalNotification fires on the lock screen, is it possible for the User to interact with the application? i.e. With the app SleepCycle, you can shake the phone from the lock screen to trigger a Snooze. Is that sort of functionality possible only because the app is running in the background (in the case of that app, I know it's running in the background)
yes. you need to be running in the background for interacting on the lock screen

IOS App and Background

I have a music signal processor app I want to publish and it needs to run in the back ground. I used to Info-plist to do so with UIBackgroundModes. It runs on IOS7 or less, and the problem I am having is once the phone locks and the app goes into the background I can't get it to come out of the background and its keeps running with the red banner at the top. Some of this I have learned as I go, but I have noticed some run on a timer, but I want mine, since its a music processor to keep going until the phone either unlocks or whatever interrupted it stops.
The app is basically a stomp box used with iRig. If that helps.
Thanks
Can you clarify about what you mean when the phone locks, the app goes into the background and yo can't get it to come out of the background? Are you saying like the app is playing music while the app is locked?

How does Moves app work on iOS

Moves app on iOS geolocates your movements throughout the day even when the app is inactive. In addition to this it also appears to analyse core motion data to identify if you have walked, cycled or taken another form of transport (walking with your phone in a suitcase on wheels reports as a cycle).
What iOS methods and techniques can the Moves app use to continuously capture this data without the application having been open? Geofencing? Background processes?
You can register an app to continue operating in the background. Have a look here at the Background Execution and Multitasking section. http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html

Keep app running while iOS device locked?

I have an app that makes heavy use of video out. In a typical use-case, I'll have an iPad connected to an external monitor. I just want the external monitor on; the iPad display does not need to stay on.
The ideal case would be for someone to connect to an external monitor, then lock their iPad. But that pauses my app. (Currently, I'm calling setIdleTimerDisabled to keep the iPad from locking up and pausing my app.)
I'd like to give the user the option of locking the iPad, but still having my app running and sending images to video out. (Note: I'm not talking about keeping my app running when it's not in the foreground. I just want to keep it running while it's in the foreground, but the device is locked.)
Is this possible?
I would say no, it is not possible. Here's why:
The docs read:
Pressing the Sleep/Wake button is another type of interruption that causes your app to be deactivated temporarily. When the user presses this button, the system disables touch events, moves the app to the background but sets the value of the app’s applicationState property to UIApplicationStateInactive (as opposed to UIApplicationStateBackground), and finally locks the screen.
Something interesting to note in the docs above is that a bit further down under "What to do when an interruption occurs" Apple recommends that you stop doing certain tasks.
In response to this change, your app should do the following in its applicationWillResignActive: method:
Stop timers and other periodic tasks.
Stop any running metadata queries.
Do not initiate any new tasks.
Pause movie playback (except when playing back over AirPlay).
Enter into a pause state if your app is a game.
Throttle back OpenGL ES frame rates.
Suspend any dispatch queues or operation queues executing non-critical code. (You can continue processing network requests and other time-sensitive background tasks while inactive.)
This tells me that Apple doesn't want or expect your app to be doing much of anything in this state, other than preparing to be fully backgrounded.
On a related note here's a thread that shows how to determine whether you've hit the Sleep/Wake button or not:
Is it possible to distinguish between locking the device and sending an app to background?

Resources