Enable/Disable camera app programmatically - ios

Is there a way to programmatically restrict camera access on iPhone 4S 5.0.1?
I am building a simple app with a button to enable/disable shooting with the camera.
I believe it should work in the similar way as the restrictions work in Settings app.
I am not going to deploy it, so I do not mind about Apple's approve.
Thanks!

there is no such a policy based programming like android in iphone to disable the camera. its possible only in rooted iphones.

I think the only option will be with MDM solutions

Related

Remote access of an iOS app

I want to get remote access of my iOS app running on one iPad in another iPad. Is there a way in iOS SDK to achieve this?
Any help would be highly appreciated. Thanks
No, there's not. You can mirror the screen to another device using AirPlay, but there is no way to "drive" the device remotely. (There's an app called "Reflector" that lets you mirror you iOS device onto your Mac, but it's view only.)

Turn off mirroring programmatically in iOS while airplaying to apple tv?

I am working around airplaying in iOS and I can able to do that without any issues. My issue is when mirroring is turned on i can see my mobile screen on apple tv, but I want to turn off mirroring programmatically and have to show apple tv default player and this is possible because I seen Netflix app they are doing this.
So could any one help in this?
Set usesExternalPlaybackWhileExternalScreenIsActive property to YES.
Go through the following doc
https://developer.apple.com/documentation/avfoundation/avplayer/1624255-usesexternalplaybackwhileexterna

Detecting iOS AirPlay screen mirroring capabilities

I've developed a user experience in my iOS app for displaying a different view on an external screen connected via AirPlay screen mirroring or HDMI out. I have a setting to enable/disable this feature, allowing the user to choose between this mode and true mirroring (i.e. same experience on both screens).
Since many iOS devices don't even support external displays (iPhone 3GS and earlier, iPod touches) and some only support HDMI out (iPhone 4, iPad 1, iPad 2 with iOS4), I'd like to tailor the settings UI for each category of device.
I know it's good practice to detect capabilities whenever possible and not to avoid checking the version of the device itself. However, I haven't found anything online about detecting AirPlay support, just how to code for it.
Is it possible to detect AirPlay/HDMI support in the SDK?
(Apple's documentation on developing for external screens:
http://developer.apple.com/library/ios/#documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/CreatingWindows/CreatingWindows.html)
No, not directly and in a summary fashion.
I think you would probably be best off detecting the device version and using that as the basis of your UI.
If you really believe that is bad practice, I suggest you explore Erica Sadun's UIDevice extensions - you might be able to find in there the code necessary to query enough specific capabilities to create an abstraction that would let you know if a device is AirPlay/HDMI capable. If you do that, I hope you share it!
UIDevice-extension: https://github.com/erica/uidevice-extension
As a side note, don't forget about the VGA adapter. I have tested my app with it at 1080p and it works/looks as good as the HDMI adapter, which was a big surprise to me.

Is there a way to programmatically check if some specific mobileconfig has been activated?

This solution for an iOS kiosk mode (disabling the home button and on iPad the multitasking gesture) is really great, finally there is a possibility to implement a kiosk mode on iPads (even though it's quite complicated to activate and deactivate).
Lock-down iPhone/iPod/iPad so it can only run one app
I want to use this with a exam/quiz/e-assessement app. But how can my app check if this "kiosk" mode is actually active? Is there a way to programmatically check if some specific mobileconfig has been activated?
Use an MDM tool, like AppBlade. Here's a video on our kiosk mode functionality http://vimeo.com/50632312

AirPlay Mirroring iPhone to Mac OS / using UIWebView + AirPlay

I need to live-demo a Mobile Safari browser app (iOS 5, iPhone 4S) on my Macbook and was wondering the best way to do this?
One way I thought might be possible would be using AirPlay Mirroring, but there doesn't seem to be any Mac OS apps capable of showing my iPhone screen mirrored.
I am an (beginner) iOS developer and wondered if there was anyway I could knock up a basic app with a UIWebView in it to somehow stream the contents of the web page and my interactions with it to my Mac.
Any thoughts?
EDIT: Yes I know I could use the iPhone Simulator, but I need to interact with it on the handset using the mobile phone network.
The situation has changed since this was asked.
AirServer (AirServerApp.com) and Reflection (ReflectionApp.com) both support AirPlay mirroring. Here's an article comparing them:
http://www.macstories.net/reviews/mirroring-multiple-ios-devices-to-a-mac-comparing-airserver-and-reflection/
Since your device (iPhone 4s) supports video mirroring via AirPlay, then you should be able to use AirServer to enable mirroring to your Mac.
Update: As pointed out by Marc Surman, AirServer does not support mirroring, rendering this answer incorrect. Thanks for playing.
Mirroring uses FairPlay encryption, which is why AirServer and similar applications can't do mirroring.
You CAN, however, fake this using AirplayKit:
https://github.com/rothacr/AirplayKit
The iOS demo in that repo actually does a simple mirror by sending an image of your screen to the airplay device using a timer. It would probably work just fine for a demo, and should work with AirServer.

Resources