Programmatically unlock iphone with a paired bluetooth device? - ios

I need to make an ios app for iphone with the following behavior.
There will be a bluetooth button paired with the iphone.
The iphone will be in the locked state in some distance from the button.
I click the button and the iphone becomes unlocked and my app transits to foreground.
Then other button clicks are handled by my app.
After some idle time the iphone becomes locked again (the screen turns off, my app transits to background, etc).
Go to step 2.
So, I'm specifically interested if the step 2 is possible at all?
Thank you.

It's completely not possible to programmatically unlock iPhone from your application.
It's question of security.
But you can prevent device from locking if your app in foreground:
[UIApplication sharedApplication].idleTimerDisabled = YES

Related

Launch app using shake gesture

Is there a way to launch an app by shaking the iPhone?
I want my app to launch when the user shakes their iPhone (a certain number of shakes).
I believe thats not possible.
Apple can deal with this on its own end by OS.
What if the device gets shaken by accident? You've then got false alarms to deal with.

IOS, awake app after unlock (entreprise app, supervised iPads)

I am currently prototyping an iOS iPad app for my company. Before I go in the details of what I am trying to do, this will be an enterprise app deployed by a local MDM. All the iPads that will have the app installed are supervised with a mobile config that allows the app to be in autonomous single app mode. So far, everything is working fine. The iPads are not (and cannot) be jailbroken.
I am looking for a way to basically switch the app to the foreground whenever the iPad is unlocked. I am aware of this thread (ios open app after screen unlock) from 2013, and I am hoping that 5 years later a solution has popped-up. Since our app is an enterprise app, it does not have to respect the app store requirements. I can successfully detect lock events if the app is opened when the device is locked, but when the app is not in the foreground, I would need it to be awaken from an iPad event.
The basic idea is that whenever the iPad would be unlocked, the app would freeze the iPad in single app mode, and the user need to perform some action inside the app to "reenable" the iPad and disable single app mode. If a user can re-lock the iPad and bypass the app (even if he successfully accessed it once) it's a no-go for us.
Edit
I am trying to awake the app after the unlock of the device. Basically once the iPads is unlocked (after pressing the home button) the app would be started automatically.
That is a loaded question but you could lock the ipad to only use one application with "Guided Access" There is a walkthrough here.
Here are the first steps:
Open “Settings”
Go to “General” > “Accessibility”
Tap on “Guided Access” (Scroll down the page a little, it’s under
the “Learning” section)
Flip the switch to “ON”
Tap on “Set Passcode” (this will prevent
users from leaving “Guided Access” mode)
Enter a passcode
Launch your App
With your app still open, triple-click the Home button

How to determine number of locks and unlocks of iPhone programmatically

is it possible to determine how many times my iPhone has been locked and unlocked programmatically when app is foreground and background as well. Code snippet will help a lot...
There's no way to get this information from your App.
You can only know when your app goes to foreground/background via your App Delegate, but not what the user does outside of your App.

Put Mobile App Launch Icon on Notifications Screen to Launch from Locked Device

Want to put the icon for our iOS app on the iOS Notifications Screen that can be accessed when a user has not entered their passcode, so that the user can launch the app when the phone is locked without needing to input their passcode. The goal is for a very fast launch with minimum time from a locked iphone. We don't need to actually send the user a notification. Would also be great for this to work on Android, but iOS is currently more important for this feature.
What is the best way to do this using Cordova? Is there an existing plugin for this purpose?
Thanks
It is not possible to launch an iOS app without unlocking the phone/device. The notifications screen is only available once the iOS device is unlocked.
(thanks to dan)

open iPhone in foreground from the watch os2

Is there any way to bring iPhone application into the foreground by pressing a button in the Apple watch
any way other than handoffs!
No, it is not currently possible. WatchConnectivity just serves to exchange data between the two devices, not for changing their statuses.
Of course you may activate a local notification from the watch on the iPhone upon clicking which the coupled application goes to the foreground, but it shall still require an action by the user on the iPhone.

Resources