Change iPhone settings from an app - iphone

Does anyone knows how to change the iPhone settings from interior of an app? For example: close the WiFi, disable 3G, change the sound volume and so on?
Apple is changing settings trough an app: Settings.app. It means that it's possible, I just don't know how.

Apple can do it in her Settings.app indeed.
Because of limitations of the iPhone SDK, some API's are not made public so you can't do everything Apple is able to do within her own OS. However, you can let the user adjust the main volume from your application, using the MPVolumeView class.

All applications written with the public SDK are sandboxed. They only have access to the properties and data which Apple deems feasible to use within that sandbox. Some of the examples you list are possible and some aren't.
Apple can perform these operations within their own applications since they don't use the public SDKs to write their applications - they use an internal SDK which has more functionality than the external one. They're not too worried about Apple employees hacking the phone and getting all your data off the phone.
Most of us wish that Apple could migrate more things to the public APIs (and they often do) but the reality is that the sandbox environment is carefully guarded. I wouldn't hold my breath to expect Apple to move all your examples over. You could always file a radar bug and let them know what you want - it's one way to have your voice heard.

Related

How to lock down user to Single App mode in iOS 6, Programmatically?

There are some question which are related to this,. but getting the exact answer:
Lock-down iPhone/iPod/iPad so it can only run one app
Recently iOS 6 is introduced with some business oriented features, two of theme are:
Guide Access
Supervised Access
These both deals with Accessibility Control features, Like allow user to restrict access to there device, only if they have full access to the device. In that way this is only useful to people, who owned the device like, a school use there device for exam, a restaurant for menus, for product display etc. All of them have access to the device to configure settings etc.
Now my question begins here, I am thinking of an App, which look down user to single app mode when user run the app and after signing out of the app the device start working as before in normal mode.
Through the time when app is active, user should not able to access any other function or button, this applies on all three device iPad, iPhone, iPod.
Also I found that this could be done by installing some Profiles etc, which looks wired and we can't ask user to do so.
So the simple idea is user will only install the App, as normally he does and we could lock him down to single app mode when he log into the app.
The SureLock iOS app does nothing but inform the user how to do it in your system preferences.
Doing it from the app itself is only possible, if you break the rules about private frameworks. And break it hard.
I am sorry to tell you that the way you present your idea, would never be approved for the AppStore.
The accepted answer to this question is no longer correct:
Starting with iOS 7, UIKit exposes the function UIAccessibilityRequestGuidedAccessSession as public API.
I don’t know, but can very well imagine that this function existed as private API dating back to iOS 6, where the guided access feature was introduced.
Note that for this method to have any effect, the device in question must be supervised using MDM, and the ID of the app you want to use this API must be included in the device management profile deployed to it.
Hi may be I am late but I have a good news for you.
Apple provide a new feature in IOS 7 and we can lock the user to single mode without user permission(Lock and unlock mode) here is the apple documentation link
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIKitFunctionReference/#//apple_ref/c/func/UIAccessibilityRequestGuidedAccessSession
the other way is to install the profile config profile like is
http://ipadhire.co.nz/lockdown.mobileconfig
it lock the home button of IPhone and enable single mode
For this you have to do following..
access apple's private api's
access apple's private framework
Apple don't encourage accessing there private api's specially when it comes for App Store, if you accessed the private api's at the time of application review on App Store they will reject the app giving you a message of "accessing a private api".

iPhone Application Queries

Is there any way to achieve the following things via my application's code on the iPhone:
API for locking/unlocking the ios 5.0 device
Wipe the device data as in below app
http://www.engadget.com/2010/06/18/apple-launches-find-my-iphone-app/
Language change of the device
Device sound change etc
All of the activities you list here are handled by private methods, and as such, are off limits to App Store developers (and there is no official API to access them). That said, anything is possible if you're willing to forego distribution in the App Store and able to dig into the undocumented features of the native and/or jail broken OS.

find iPhone places using xcode

I would like to know my iPhone places using Xcode like this app.I know all the details related to my iPhones.Kindly help me how to do this.
The actual Find My iPhone implementation details are certainly private and/or using private Apple frameworks (especially as it's a feature that users have to explicitly turn on and off via Settings and there's no user-facing app), but you could use CoreLocation in an app that you create that runs in the background, reporting your location to some server that your own.
I also found an alternative app named iLostMyi, but this requires a jailbroken phone.

Where can I find information about private iPhone APIs?

I am trying to make an iOS application not for the App Store involving customized screen savers, automatic starting and ending of phone calls, and contact restrictions. I have not been able to find resources and information regarding private, undocumented APIs, however. Does anyone have a pointer?
If you just need to know something which is exposed via Objective C - you can look at https://github.com/rpetrich/iphoneheaders (or generate them yourself via class-dump-z)
Many private frameworks are here.
You also should look at http://iphonedevwiki.net/index.php/Main_Page
If you need access to undocumented C APIs and can't find examples...well,your only way in this case is IDA Pro
This is never required, but if you want to do this then this is simply done like testing your app on your iPhone.
Just create an app in the developer account, add your iPhone, get development certificate & provisioning profile then install app directly to your iPhone.

Pairing with "non-ios" device programmatically

A further question about Bluetooth and iPhone.
Is it possible to discover nearby "non-ios" devices via bluetooth programmatically? The device uses the Hands-free-Profile. When I go like "General > Bluetooth > On" it works fine and I can pair with it. And thats exactly what I want to do but in my own App. I know the official SDK doesn`t support it. So my questions are:
When I`m member of the "Made for iPod"-Program, will I have access to the Hands-free-Profile API?
Important: The device already exists and I have no influence on it. So no possibility to implement
a special ship or so.
Another opportunity I found is the Private Framework BluetoothManager.h. Is it possible to
discover/pair the device with an iPhone?
In one sentence: I want to build an app that exactly does what the Bluetooth-function in the iPhone settings does. Possible?
Thank you
I want to build an app that exactly does what the Bluetooth-function in the iPhone settings does. Possible?
No, it is not possible with official APIs, even if you are a part of the Made for iPhone program.
In one sentence: I want to build an app that exactly does what the Bluetooth-function in the iPhone settings does. Possible?
A preliminary search didn't find the official rule about it, but Apple specifically forbids apps that duplicate the functionality of their built-ins. So, no, your app will almost certainly not get approved.
And I'm pretty sure the T&C forbid interaction with non-Apple-approved devices, but I'm not sure whether they strictly apply that to bluetooth things.
Yes , using the bluetooth private APIs. You can get a list of remote devices, each a BluetoothDevice object, and use the afferent methods to pair or connect.