App controlling home button in iPhone - ios

Just a quick question. Is it by any chance possible, that I can make an app control the users Home-button?
What I want to achieve is, that I want to ask the user if it is OK, that I add a functionality, when they click the Home-button 4 times. Is that even possible - even if the user accepts?

Related

iOS: Touch ID prevent user from closing app when pressing too strong

is it possible to prevent the app from closing when my app asks for a fingerprint and the user presses the home button instead of only let the finger rest? I know and understand that it shouldn't be possible everywhere else, but it would be nice if the app wouldn't close when asking for the fingerprint.
It is not ever possible to change regular system behaviour, even though some users might press too hard and go back home that is the behaviour that everyone expects, want to go home, press the home button and it always works
This is not possible, what you are trying to do is getting out of the scope of your application and change the behavior of the device. Apple won't allow it, ever.
They might change the behavior if they think it's better to handle it like that, you can send them a message. But they'll probably never do that as they are killing Touch ID for the sake of Face ID.

Killing an iOS app programmatically

I have an app when a specific action fires I close the app and ask the user to reopen it again.
The problem is when the app executes exit(0) the app stays in the apps stack (when I click the home button twice). I want it to be killed completely so that viewDidLoad() will be executed again when the app opens.
You cannot terminate an app on it's own.
From Apple's Human User Guidelines...
Don’t Quit Programmatically
Never quit an iOS application programmatically because people tend to
interpret this as a crash. However, if external circumstances prevent
your application from functioning as intended, you need to tell your
users about the situation and explain what they can do about it.
Depending on how severe the application malfunction is, you have two
choices.
Display an attractive screen that describes the problem and suggests a
correction. A screen provides feedback that reassures users that
there’s nothing wrong with your application. It puts users in control,
letting them decide whether they want to take corrective action and
continue using your application or press the Home button and open a
different application
If only some of your application's features are not working, display
either a screen or an alert when people activate the feature. Display
the alert only when people try to access the feature that isn’t
functioning.
Have a look at this answer: https://stackoverflow.com/a/8491688/742298

Limiting the user from saving the screen

I am making an app that allows the user to add captions to their photos. I'd like to be able to allow the user to save / share 3 of their creations, and after they share for the third time, shut down the app until they purchase more credits.
I'm trying to think of ways that the user can get around this to use my app for free all the time. The only way I can think that the user can save a photo manually is to do a screen shot, which I know how to detect so I'm not worried about. Is there anything else I'm not thinking of?
You can do it in an indirect way like the Snapchat app. Taking a screenshot interrupts any screen touches. See this for the solution.
You can trap the screen shot event and if they do create a screen shot you can delete it.
You can display some watermarks .
Remove watermark only after they buy it.
Here is a stackoverflow link to add watermarks

iOS7/iphone 5s home button tap API

So with this new fingerprint thing you only need to tap the home button and hold your finger for a few moments to unlock your phone. I was wondering if there's an API that lets us make use of the "Tap" functionality.
i.e. Let's say in my app, when the user taps the home button, my app does xyz.
Also, would it be possible for my app to read these taps when the screen is locked?
NOTE: By tap I do not mean pressing the button, just a tap, like when we unlock the iPhone 5s with the fingerprint scan.
I'm completely new to iOS development. So referencing libraries with links etc and basic tutorials might make things a bit clearer for me.
Thanks.
Nope. This API does not exist. File a feature request at http://bugreport.apple.com. I can't imagine that this will get implemented though, given the possibility of abuse.
No there is no public API for the Touch ID sensor... yet. And there may never be one.

Bring previous app back to the front when user is done with my iOS app

My iOS 4/5/6 app is meant to be used briefly. I want the user to click a "Done, now go away" button which takes them back to the app they were using before mine came to the front.
Is there a way for my iOS to put itself in the background while returning the previous app to the front?
On an iPad, the user can get that effect by doing a four-finger swipe horizontally across the screen. But that gesture is not a complete solution because (a) that gesture does not work on a handheld device, and (2) not many users know of that gesture. I want to programmatically return the previous app to the front.
I want the user to click a "Done, now go away" button
That button is the Home button.
I want to programmatically return the previous app to the front.
There's no public API for switching to another app. Users have a number of options for switching between apps, though. In addition to the swipe gesture you mentioned, they can do a four-finger upward swipe to get to the list of recent apps, or double-tap the home button for the same effect, or hit the home button once to go back to Springboard. Users, not apps, are supposed to be in control of which app is in the foreground. And the way they do that should be standard from one app to another. I can understand wanting to make life easier for the user, but what you're trying to do just isn't possible with the available API.
I Don't think you can do that if the previous application is not your property or if you are not aware if a URL Scheme has been incorporated in the previous application that you know of.
Launch App Via URL Scheme!

Resources