Lock iPhone and iPad Screen programmatically - ios

I want to lock screen iPhone and iPad programmatically
I have searched a lot but didn't get proper idea. I have found one app Lock me but it is not worked on after iOS 7.
here is that link
https://github.com/neuroo/LockMeNow
as per my search I think we are able to implement this functionality using private api and using kiosk mode.

I don't think you can programmatically lock the iPhone or iPad from you application. that not full fit the apple policy and its guide line. In iOS app development we can not handle any API that out of the application. Apple not make any API for lock screen that you fire from your native app.
Other things is you are attached one link in your question. that clearly write the limitation that:
This application can obviously not be accepted (as is) on the Apple Store, and that's mostly why I put it here. If you want to use the application, you will need a developer cert (or a jailbroken device and using the iDevice build toolchain).

Related

How to distribute enterprise iOS App to specific iPhone device types

How I can restrict an iOS App so that it can install only on specific device type. for example, I do not want my app to install iPhone5, iPhone5S, and iPhone6. I do not want to control it with deployment target settings (iOS version).
And this has to be distributed using Apple Developer Enterprise Program.
You can't prevent the installation of the app on specific devices.
But you can create a splash screen as your first view of the app in which you check the device and prevent the start of the app informing the user.
Well, there is no direct option available to achieve what you requested, because you can select the device type, like iPhone, iPad or Universal while setting up the target,
You can do this in alternate way, on applicationDidFinishLaunching You can simply put a check, if the device is other than the one you wants to provide the support then allow the proceed to the application functionalities, otherwise show a screen with some message showing that, we are not currently providing support on these devices (iPhone5, iPhone5S, and iPhone6)
And as you are going to distribute the application via enterprise account, so you will not need it to get confirmation from the Apple reviewers.
Hope it helps!

Not able to make app iphone only [duplicate]

I'm shipping two binaries; one for iPhone/iTouch and the other for iPad. It's the same application.
Will Apple ensure that the user will never receive an iPhone version of the app on the iPad? If YES, then I don't have anything to worry about, but if not then I do have a problem.
The reason I ask is the iPhone application will simply not work correctly on the iPad because the server knows it's an iPad and will deliver the iPad HD content to it and the iPhone cannot handle that. I would rather not hack my application to send the server a fake device type if running the iPhone app on the iPad in order to receive the correct resources.
Suggestions?
I've been looking for this for a while because I couldn't prevent the iPhone app to load on the iPad. Searched a bit to understand why this was happening, followed #hotpaw2 instructions and found this on the official apple store rules:
UPDATE:
2.4.1 To ensure people get the most out of your app, iPhone apps should run on iPad whenever possible. We encourage you to consider
building universal apps so customers can use them on all of their
devices. Learn more about Universal apps.
https://developer.apple.com/app-store/review/guidelines/
The SDK and/or App store rules prohibit you from preventing an iPhone app from running on an iPad in 1X or 2X zoom mode, unless there are other requirements listed in the app plist. Apple's app review is known to test iPhone-only app submissions (unless there are other requirements) on an iPad, and reject the app if it doesn't run properly.
Other requirements (as listed under UIRequiredDeviceCapabilities in the app's plist) might include your app requiring telephone capabilities (or healthkit, etc.), which might help you temporarily, but still won't prevent the app from running on some hypothetical future iPad product that includes telephony capabilities (and/or healthkit, etc.).
Actually you can.
Add telephony to UIRequiredDeviceCapabilities in your plist file.
But i really not recommend it and maybe you could get rejected because of gratuitously using this property.
I think you should handle that there are iPad versions and iPhone versions on iPads, use the second one as an iPhone.
Also don't forget that retina iPads will use upscaled applications at retina resolution while none retina ones use the standard resolution. And this behavior can tweaked using jailbreak tweaks like RetinaPad and FullForce.
In the plist settings, add Application requires iPhone environment and set the boolean to YES

Need to lock all application on the iPhone by using an app

I am developing an app for one of my client,he wants me to provide a functionality to lock all available apps on his iPhone using this app,but i haven't much idea about it,i know about the screen lock like passcode app but not this one.
Please suggest some best tutorial link.
Thanks
You can't access another app functionality from your app according to Apple guidelines so it is not possible.
Unfortunately, it is not possible to lock the device programmatically. There is no available API for this.
It's not possible, Apple didn't allowed it.
This could've been possible in Android but sorry this is impossible in iOS. Apple doesnt allow that.
It's not possible for an app to lock itself down. However if you have access to the device you can set up Guided Access when the app is open, preventing it from being closed. If you have an enterprise setup you are also able to set up Supervised Mode where you should be able to configure Guided Access over wifi.

iOS Private API: lock device and power off the screen

I'm making an app for jailbreak that lock the device when the user launch the app. I've tried GSEventLockDevice(); from GraphicsServices.framework but this does not work properly because it locks the screen but does not power off the screen. Is there another way to lock the screen without MobileSubstrate?
Just as another alternative, check out this answer, which uses SBDimScreen(). You could use that in conjunction with GSEventLockDevice().
It appears that you may now (iOS 5+) need to add an entitlement to your app to use this call successfully. If you haven't done that before, here is an example of how to do so. Obviously, in this case, the entitlement in question must be changed to com.apple.backboard.client.
You also might see if #VictorRonin has experimented with this, as he commented on the question I linked to. I tested SBDimScreen() on a jailbroken iOS 4.2.1 device, but my newer devices are currently unavailable to run this test. I'll try it later on iOS 5.x and post an update.
Note: the answer I linked to from Elias has a different call altogether for iOS 6.
Look at these several questions:
Simulating System Wide Touch Events on iOS
Simulating System Wide Touch Events in iOS without jailbreaking the device
How to send a touch event to iPhone OS?
The idea is that you can simulate system wide events. One of events is power down event. If you simulate it, it will turn off device and will lock it.
BTW. You may be interested to google more on GSEvent which is the key for even simulation.
Here are couple of useful links:
http://iphonedevwiki.net/index.php/GSEvent
http://networkpx.blogspot.com/2009/08/gsevent-recording-and-playback-in-30.html
Also, this approach isn't limited to jailbroken phones. It works on jailed phone too (however, you won't be able to post it to AppStore).

Universal iOS application

We have an iPhone app and want it to support iPad also.
But as I learned if you submit an app to Apple and indicate it is Universal, while in reality it is not (for example iPad is not supported at the time of submission, this is restricted by their policy).
So, what is the best way that we simultaneously allow further development of our application such that we also support iPad?
ps: we didn't want to create separate projects for iPad and iPhone since they share lot of code, but as I mentioned we encountered following obstacles.
Submit your app as an iPhone app. When you support iPad change it to a universal app when you submit your update.

Resources