iOS MDM - Making Managed settings permanent - iphone

As per the "Mobile Device Management Protocol" API document from Apple, I am trying to restrict access to Data Roaming on iOS devices connected to my MDM server.
I can toggle the Data Roaming setting by sending the appropriate Settings request, however the user can then toggle Data Roaming straight back on.
This is addressed in Apple's documentation with the following paragraph :
In iOS 5 or later, this command allows the server to set settings on the device. These settings take effect on a one-time basis. The user may still be able to change the settings at a later time. This command requires the Apply Settings right.
The "might" suggests to me that there should be a way to restrict this, but I can not find a complete list of Global Restrictions that might solve this problem.
Is there a way to remove access to either the "Data Roaming" settings option, or even disable access to the whole "Settings->General->Cellular" sub menu ?

I don't think it's possible.
I checked the document with configuration profiles:
http://developer.apple.com/library/ios/featuredarticles/iPhoneConfigurationProfileRef/iPhoneConfigurationProfileRef.pdf
Also, I checked iPhone configuration utility.
None of them has Data Roaming restriction.
So, the only thing available is that MDM Settings which you are using already.

Related

disable web security on mobile browser ios

I have been searching around for a bit and cant find any solution to this question.
I need to run a browser on an iPAD that allows cross-origin policy to be bypassed. This is easily achieved with a windows machine by launching lets say chrome with --disable-web-security I have read that Phonegap allows this but the app is already in place.
Ill take any solution including jailbreak's
I'm not aware of any official ways to do this.
If you rely on cookies, the alternative would be to read every header to every response and manually assign received cookies to different domains (the downside to this is that you must know the other domains to be used beforehand). For handling cookies, check out [NSHTTPCookieStorage sharedHTTPCookieStorage], the default storage for native apps.

How to add a wifi network to the list of known ones in iOS?

I am working on an app that needs to add a wifi network (i.e., SSID and password) to the list of known ones of the mobile phone, so that it connects to that network automatically even when seeing it for the first time.
I already did this on Android, and now I will start working on the iPhone version.
Question: On the iPhone, is it possible to have my app (when it runs for the first time) add a wifi network to the list of known ones of the device, and if so, any hints regarding how to do it?
Thanks a lot.
Unfortunately this is not possible on iOS.
Apple doesn't provide any public APIs to add network SSIDs or passwords.
The most you can do is to enable your app to manage the user's authentication for a public network, (as is done for things like Boingo and The Cloud). In this case, when the user joins a network, instead of a webpage opening to authenticate, your app can launch and provide the authentication - but that is as far as you can go.
We asked for clarification on this point to Apple in the dev forums and were told that it is definitely not possible. (I will try to dig out the link to that post for you when I get more time. Else, search your query on the dev forums and it might show up).
so it would seem that with iOS 6, there may be a way to do this. Boingo appear to allow a user to turn on "Auto Login" and it will login/authenticate against the access point without the user interacting/authenticating manually (I haven't tried it myself though). Is there new API calls in iOS 6 that now allows this? See this article.

How to get the system settings in iPhone for 3G or data roaming status

I need to determine if certain system settings have been set on the iPhone. i.e. Whether or not 3G or data roaming are enabled/disabled. Is it possible to read the system settings, and if so, how?
Some are readable; some are not. The data roaming option is, AFAIK, not available to developers to either get or set. If you want to see this added, I would recommend you contact Apple via the Bug Reporter utility and file an enhancement request.

iPhone handling dynamic URLs

My iPhone app consumes a Java web service in order to get data. At my company we have 3 environments - development, testing, production. Each environment's URL, that points to the web service, is different. Thus, each time we promote the project to the next environment I must change the hard-coded URL in the iPhone code to match that of the targeted environment. Has anyone devised a strategy to handle this either on the iPhone itself or in the service layer?
Try storing the variable part of the URL in your app's info.plist file. You can change that w/o rebuilding.
If more config changes are needed, VCS branching may be what you need.
You might consider the following approach:
When you start up your app, or rather when you have established that a network connection is possible, you send your device id to the server.
The server checks your device id against a list and tells your app whether the user talking to the server is allowed to see development and testing content.
If your device is allowed to, you provide an interface for the user to change whether they want to see development, testing or production content. Store that in NSUserDefaults
Depending on user choice, the corresponding url is used to talk to your server. To be sure, you can include your device id check here, too.
This approach has the benefit that you can allow clients to see testing content... without ever having to update or change their app. And you can revoke that permission anytime.

iphone - Programmatically set (System-wide) proxy settings?

I am new to iPhone development, so I'm sorry if this is a stupid question. I am developing an application whose purpose will be to route all iPhone activity through my company's proxy.
Is there a way to programmatically set system-wide proxy settings in the iPhone (which will also take effect on the 3G connection)?
I know there is a way to manually set proxy settings for each wifi connection. Detecting new networks and setting the proxy on them would be acceptable. However, I need to also be able to set the proxy on the 3G connection.
Also, bonus: Is there a way to programmatically change the "Restrictions" settings?
If anyone has any tips or can point me in the right direction, I would appreciate it. Thanks.
EDIT: Please understand that this is for a legitimate purpose. Apple has to approve app store additions, so it's not like I'm trying to spread a virus. Please, constructive answers only.
If you're configuring iPhones in a commercial environment, you should look at the Enterprise Deployment Guide. Specifically, you should look at using the iPhone Configuration Utility to create a *.mobileconfig configuration file that can be distributed to all the phones in your network. The *.mobileconfig plist supports changing the following proxy configuration settings on the phone:
PropNetProxiesHTTPEnable (Integer, 1 = Proxy enabled)
PropNetProxiesHTTPProxy (String, Proxy server address)
PropNetProxiesHTTPPort (Integer, Proxy port number)
HTTPProxyUsername (String, optional username)
HTTPProxyPassword (String, optional password)
PropNetProxiesProxyAutoConfigEnable (Integer, 1 = Auto proxy enabled)
PropNetProxiesProxyAutoConfigURLString (String, URL that points to a PAC file where the configuration information is stored)
The iPhone Configuration Utility does not currently support adding or editing those settings, so you may need to get your hands dirty with the Property List Editor application. Also, it looks like the latest version of the Enterprise Deployment Guide does not include the settings I've included above, but you should be able to find it in the previous version of the document.
Pretty sure this is outside the Apple provided SDK sandbox. Probably possible with a jailbreak though.