prevent the app from closing - ios

Recently i visited a restaurant and they use iPad for ordering. When i tried to close the app by pressing the home button it did not close. Rather it blinked (may be went to background and came up again i don't know). then i was prompted for admin password.
But when i searched stack overflow most answers suggest that it is not possible. As per my understanding i can use development certificate and implement this in my personal device. May be the restaurant might have also done that.
Can someone shed some light on how to achieve this functionality?

You can put an iPad into Kiosk mode.
This will essentially lock it into a particular app with a pass key required to do anything else.
http://www.ipadenclosures.com/blog/posts/your-ipad-into-a-kiosk

This has nothing to do with objective-c. It's a feature on iPhones and iPads called Guided Access: http://support.apple.com/kb/HT5509?viewlocale=en_US&locale=en_US

There are a few ways you can do it - One of the simplest is through guided access
Another, even more secure, is through Apple Configurator - When you supervise a device you can lock it to one app and disable the controls just as with the guided access method. With this method you can supervise multiple devices and apply standard configurations quickly by simply plugging them into your Mac's USB port.

Related

Can I find out the location of an app's icon on the home screen?

Is is possible to dynamically figure out the position of an app's icon on the home screen of an iphone/ipad?
Sorry I don't have enough credit to comment yet so I'm posting here.
To my knowledge no you cannot natively or easily do this. I know of no open source or other libraries. The reason being that your app exists in its own world, it is not in touch per say with the rest of the device. It can get permissions to read and write data but it doesn't know of itself.
Does that make sense?
When you open a website it cannot know which tab it is in the browser. Instead it knows how it was accessed and what device (physically) is using it. It knows the user-agent, the time, the browser, etc because that is information sent to it in the request. In turn the phone on launch gives data to the app in how to handle it but not for example how many other apps are running, or where it is on the screen. It's not normally considered relevant to run time. In addition it's a security feature in preventing an app from deleting or altering other apps, as well as itself. If you have an iPhone you will notice that SIRI cannot turn off google maps navigation or any other non-apple specific app. Only apps natively comparable and private party ones (ex apples) are accessible because Apple did that intentionally. They all know of their own existence and each others. However non-native in the sense of apps that do not come preinstalled and manufactured by the company creating the device are less trustworthy, in addition there are no guarantees about how they will be run by the device, where they will be, or what other apps will be there.
It is true that an app can request for another app it may be comparable with but it is up the user to handle that information.
May I ask for curiosities sake why you are trying to do this? Are there any other workarounds?
However in terms of it being physically possible, yes. I doubt that apple allows independent developers to do this however. But an example of this occurring may be gridlock where a user can move their apps around differently on the screen. The app in this case has the ability to access app position. But I believe in this case app position is about the UI and not about nested files. apps cannot to my knowledge modify information outside of their own file. Imagine if you had an app that could edit other games scores.
It is not possible to dynamically find out the position of an app's icon on the Home Screen (even for jailbreak apps). Apple wants you to respect the user's privacy settings.
Extra Info - There is popular JavaScript library that adds a promo bubble to the bottom of your mobile web application, inviting users to bookmark the app to their device's home screen.

Is it possible, perhaps with Apple's permission, to switch an app to the foreground without user input?

We would like to be able to remotely control an app on an iOS device so that the app can be automatically brought to the foreground WITHOUT the user having to do anything, for example when the app receives a remote push notification. My understanding is that normally there is no way to bring an app to the foreground in iOS unless the user presses a button, because Apple has decided that it knows best, and that it is better for app developers and users not to have this possibility, because it could be abused.
We are working on a security-related app where we believe that there would be strong justification for this type of functionality (in a case where the user is not able to take any actions).
Two questions:
Is there any way to do this in iOS coding that others on similar posts have overlooked?
Does anyone have experience with whether Apple ever grants exceptions to this kind of rule if there is a good justification?
The answer is simple: NO, and there is no chance that Apple will agree to allow you to implement such functionality. The only app that does this is the Phone.app because that is its purpose.

iOS - Can an app running in the background send touch / gesture events to another app in the foreground?

I have been asked to develop an app that will record and later "play back" touches and gestures onto another app running in the foreground.
From my experience and knowledge, this is not possible unless both apps are setup to send/receive data between them through notifications or other methods. Also, it would be a huge risk for apps and their data to be exposed to anybody.
I am 99% sure this is not possible, but was just curious if anyone else has come across something similar (or documentation that specifically states this is forbidden).
Nope not possible, no way no how, dont even try.
Expanded answer, if this runs on a jailbroken phone.......
Yes.... but good luck,
check Saurik's Veency code for this sort of functionality, it would have to be refactored signifcantly but basically it allows for virtualization of taps.
https://github.com/iceNuts/TouchTest
http://gitweb.saurik.com/veency.git
if you want to access another application in your iPhone ,you can set the url scheme parameter and so on.You can add callback in your url,then you can return back your application.
It's actually possible with facebook's idb:
https://github.com/facebook/idb/
As it stated:
Remote Automation. idb has a “companion” that runs on macOS and a python client and cli that runs anywhere. This enables scenarios such as a “Device Lab” within a Data Center or fanning out commands to large numbers of iOS Simulators.
As facebook stop support on WebDriverAgent, it's the best option we have right now

iOS Custom Lock Screen Alternative

Let me first begin by explaining my goal for this app. I am looking for ideas on the best way to accomplish my goal (or at least close to my goal). This app is completely internal and thus does not need to comply with any apple guidelines (aka, can use private api's).
Our company has ~20 iOS devices. These devices are used by multiple people throughout the organization. Often times we are looking for a specific device and need to be able to track it down. So I am looking for a way to track who has what device.
My initial thought was to make an app that allows the user to pick their name from the list and then have a server that keeps track of who has what device. This worked well for a while, but now people have decided its too much work and have stopped using it. Users can just not open the app or press the home button to exit it. So now I'm looking for alternatives.
Here are some ideas that didn't work:
Custom Lock Screen - (Requires jailbroken devices so not an option)
"Lock To App" from Apple Configurator - (No way to exit our app. We don't want to hinder normal use. Note exit(0) will just cause iOS to restart our app)
MDM options - (Didn't see any that would provide this functionality. Let me know if otherwise. We would like to implement it ourselves, but a 3rd party is an option)
At this point I'm just looking for ideas or knowledge. Any help would be appreciated.
Thanks
I would add a sticker on each device and then, if i need a specific device, i would push a notification with a message like: "person with the device X ..we need it in room Y " .Then it's up to the person who has it to return it (or smth).
The sticker itself would be a numbered decal... or a picture..or something like that.
It's just an idea

iOS - Restricting use to single app

I am developing a business app for use on an iPad/iPod Touch. I am wondering if there is a way to restrict usage on the device to my app only. In other words, we don't want employees installing other apps such as games and playing around with the devices.
Yes, that's possible.
Check out the iOS Configuration Profile Programming Guide.
Edit: See the section about restrictions, it will allow you to do exactly what you need. Note however that you'll need to have access to those devices, ideally the devices should be company property. And you need to distribute your app via Enterprise Distribution.
Edit 2: Since iOS6, this feature is available through the normal settings app. It is called "Guided Access" and is part of the Accessibility settings. It will let you disable the home button (cancel guided access by triple-clicking the home button and enter the preset code) and it will even let you define areas within apps which should be disabled.
I don't think so, unless their device is jailbroken.
If they're logged into an Exchange server you could remote-wipe their phone if they install anything.
Do you provide the devices? Or they bring their own?
If you provide the devices that would mean you can use your Apple-id. If an employee would try to download any other app he would need the password of your Apple-id. So thats a simple way to prevent that.
Im am not sure if there is a total "lock" of such type.

Resources