Button accesible from lock screen in iOS - ios

I want to develop an iOS app that can have like a panic button when the screen is locked. This button can be enable or disabled within the app, but
I want to know if it is possible to add a very accessible button you can press in case of an emergency even when the screen is locked. When the button is pressed I want to execute some code in the app.
Is there a possible way of accomplishing this in iOS?
Or is there an alternative?, The only think that I required is that the button can be pressed like in maximum three seconds even if the screen is locked and the app closed.

No that is not possible in iOS. You cannot make changes outside of your app.
One suggestion i can give you is to make a extension for today view in notification center. And you can ask the users to touch the button in notification center to invoke your functionality.
Notification center can be accessed in lock screen also.

Related

CallKit: Launch app when screen is locked

I have implemented callkit to receive the VoIP notification.
On accept the call I am managing calls through another third party ForzenMountain which has my custom screen to show the status of calls.
1) When screen is not locked: Call comes then it shows two button. On accept it goes into the app itself and I can manage all.
Problem:
2) When screen is locked: It show another transition which has multiple option like (speaker/keypad/mute/addcall) rather than to go into app.
I need to land on my app even my device is locked (if passcode enable then ask to enter it) so that I can manage FM and my custom calls screen.
Unfortunately, there's no way to go directly into your app if the phone is locked. The system will only display the native CallKit UI and from there you can tap on the bottom right button to go into your app.

iOS 10 local notifications: show notification content on lock screen

I've added local notification with Notification Content Extension.
It shows okay on home screen (with app in background).
The problem lies in displaying notification content on lock screen. When notification arrives on lock screen, it is only displayed with text and swiping left shows "Clear" button.
I need some way to show notification fully from lock screen (as on home screen).
For example I saw "View" button in some of the tutorials/articles, can I even create or control something like it?
So with notifications on iOS 10, Apple changed the way they appear on devices. When the screen is locked, you can see a View and Clear button or just clear button based on whether the device is enabled with 3D touch or not.
Swiping left on a message now offers View and Clear on non-3D Touch devices or just Clear on 3D Touch devices.
On 3D Touch devices, the long press on notification reveals the notification actions menu which can be customized using Category definition in the code.
Hope this answers your query.

iOS disable let user swipe the app in background list

In the iOS, when the user double home button , the app show in the list at background.
Have possible hidden my app show in the list, or force the user swiped the app, the app in the background can't close?
I just known applicationDidEnterBackground can do something in the background. But
I wish force the user can't swipe the app in the list or hidden the app in the list, or have some mobile device management method can do this effect(we can use private api)?
I search many time , but I was not found some answer...
thank you very much.
This is not possible in iOS, the user is in control and Apple does not allow your app to hide it self in this list.
If you want this you will need to target jailbroke devices and hook on the task switch. Then detect you app from being closed and restarted it.

Can I make my iphone app use only a portion of the screen

I was hoping to create a small windowed screen when the home button is pressed. It would keep a portion of the app process open while another app isn't open.
So say I had music playing on the app and when the home button gets pressed the screen would be windowed or shrunk and just displayed over the main screen (kind of like the little help button that can be moved around). Would using widgets in IOS 8 work?
When the user presses the Home button, the app goes to background, and that's it. You can't customize that action.
You only get a notification that the user closed the app so that you can save your app state or data for the next launch.

Detect if home button is pressed while the app is running in the background

I need a way for my app to know if the home button is pressed, while the app is running in the background. If the home button is pressed, something is gonna be added to a list inside the app. Is that possible somehow?
If your app is in the background, your app wont receive any updates. Furthermore, there isn't any way to hook into the home button click even if your app is in the foreground.
Perhaps there is a private api way to handle this, but your app certainly won't be able to both achieve this goal and be in the Apple App Store. Sorry!
In case you wanted some idea why Apple doesn't allow this, it's because they don't want the home button switch's default behavior to be altered. See this:
10.5 Apps that alter the functions of standard switches, such as the Volume Up/Down and Ring/Silent switches, will be rejected

Resources