iOS Multitask App Switcher Custom Image - ios

im developing an iOS App and i would like it to behave like PayPal when the user double taps the home button.
For those who dont know the PayPal app displays a custom image when the app is displayed on the multitask switcher but it doesnt when a notification arrives or when the user pulls the notifications bar.
My issue comes when implementing this, im using the event applicationWillResignActive to display my custom image (as applicationEnteredBackground is not called for this). But this method is called on events on which i dont want the app to display the image (such as notifications, calls, pulling the top bar, etc).
Is there any way of setting this image only when the home button is double tapped?
Thank you!

From what I see, PayPal doesn't cover the viewport with a custom image immediately – when I double tap the Home button, it remains rendered normally until I do something else – but most probably on applicationDidEnterBackground:. After switching to Home screen or another application, the PayPal preview becomes covered.
On the other hand, my mobile banking application does that immediately when applicationWillResignActive: is triggered.
These are AFAIK the only two approaches you can achieve.

Related

How to disable the home indicator of iOS in Expo?

I am using expo SDK 46. I would like to make the home indicator inactive or hide it. In my case, just one gesture movement closes the application. I want to make it harder for users since they can accidentally send the app to the background. As far as I see, we need two separate gesture movements to send the game to the background. An example game is Pokemon Unite. So, it should be possible.
I am already using expo-status-bar to hide the Status bar, and it seems it is not affecting the home indicator.
Any help is appreciated.

Avoid external display to show native iOS screen when app entering background

My app has an external display when a second screen is connected. It displays the main content I want that people see while I navigate through others views. it works fine.
Is there a way to keep this external display active when app is entering background ?
I enabled background mode in Capabilities tab, I'm able to run code in background, it refreshes correctly when I enter foreground again.
AFAIK the answer is No.
As soon as your app goes to the background, it loses control of the external screen.

What Is This Top Indicator View Called And Can You Use It?

The screenshot below shows the top indicator view displayed while the Apple Map app is tracking user location and when you take a screen recording on your iOS device. What is this top indicator view called? Also, can we create and display this view from our own custom apps? For example, if my app is tracking user location, can I display a green version of this view while my app is running in background? If so, how do you access it?
No. You cannot affect what the user sees on the home screen (except to badge your icon).
If your app is tracking user location, the user is notified of that fact by the system; there is nothing for you to do. If you have Always authorization, it would be nice to set the location manager's showsBackgroundLocationIndicator to true, but that's all you can do.

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

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