invoke a alarm sound when ios app is in background and someone pick it, using core motion - ios

invoke a alarm when someone touched the iPhone or iPad and a app is running in background.
this is happening into a ios app i.e. iAntiTheft
iAntiTheft is not using the location i checked the permission of the app, in a scenario i put the app in background activating motion alert and device get's locked after some time, now i pick the device, it immediately show a Notification and start alarm on high volume.
one More thing here to notice it always playing a low volume beep beep after enabling the motion sensor alert. any help appreciated.
how can i achieve this.

The answer to get Core Motion Update when the app is in background and the device locked. in both case just put an audio with background mode playing after the core motion updates function, now the device will go to background or get locked you always getting the core motion coordinates updates
Repo Link Providing soon

Related

How to continue collect motion sensor data on apple watch?

I'm developing an app on apple watch which needs continuous access to gyroscope and accelerometer data. But once the watch rotates, the screen turns off and apparently it stops accessing motion data while the screen is off. I tried to keep the screen on but apple watch doesn't have that feature, any thoughts around this?
Thanks
You'll need to start an HKWorkoutSession.
The app can continue to access data from Apple Watch’s sensors in the background, letting you keep the app up to date at all times. For example, a running app can continue to track the user’s heart rate, ensuring that the most recent heart rate data is displayed whenever the user raises their wrist.

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!

Using core motion in background by update location every second

My application is under study if I can do it because there is some issues I do not know if I Can do it .
Is there any solution to capture device movement with Core Motion when the screen is locked or the app in background ?
I know there is some background modes like audio - location update - voip ...etc .
How to use accelerometer events in background by update location every second
"keep my app alive"
when the device is switch off and going to switch on can I run the app in background automatically ?
thank you for helping me

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?

Shake functionality in a music application

I have developed a small music app by using AVPlayer and MPMediaPickerControlLibrary with all the normal required functionalities for a music app. The app is also capable of running in the background when the screen is locked.
Now, what I want is to start the app when the screen is locked through a shake and soon as the app starts the current song should start playing.
I am not able to achieve this from a long time
Any suggestions on this will be highly appreciated or any other workaround apart from shake to turn on the music in the app when the screen is locked in iPhone.
Thanks in advance.
You need to implement the a CMMotionManager object, but keeping it running all the time in background will be a major power consumption issue.
Modifying the updateInterval property to reduce the number of updates will defeat the purpose, given that you may miss a shake in background.
Now, if the app was terminated by the user, then no motionManager object will be available until the user launches the app again.

Resources