What does the iOS SDK provide in terms of programmatic access to the device's settings (usually accessed via the Settings app)?
After reading through Apple's Preferences and Settings documentation I'm not sure if an app can programmatically adjust the device's brightness or perhaps toggle wifi on/off. I'm experimenting with NSUserDefaults right now. Any help or advice is appreciated.
Yes, for some settings, by using a private API you can access them.
However, apparently, using these private API's prevents your app from being accepted into the app store.
A Link:
Access iOS settings from code
Hope this helped! ^_^
Apple's official public APIs do not allow an iOS app to access General settings in the Settings app, such as the wifi enable. NSUserDefaults only allows access to those preferences and settings created specifically by that one app for its own use.
Related
I am working on smart home devices based on the zigbee, z-wave & wifi.
I would like to make my smart home devices compatible with the google local SDK & apple home kit.
For that,
I would like to know how the provisioning is managed by the SDK or APP to add a device securely into the network.
Are there any standards mentioned by Google Or Apple?
How the security is managed by them?
With regards to Google's smart home platform, the seamless setup using Bluetooth is documented along with the rest of the developer documentation. That should answer your questions for that platform. I don't know about how Apple does it in their HomeKit platform.
I'm using swift 4.2. I want to create personal hotspot on my iOS device(iPhone) but not finding any solution to this. I Read on another blog that Apps are not allowed to access settings like bluetooth, wifi and personal hotspot is it true??
You cannot create hotspot programmatically.
The only way to create hotspot in iOS is to go to setting and do it manually.
iOS is always conscious about the users private data and the user
settings so if you are changing any type of any settings the user
should be informed and user should on his own should turn off/on the
the settings like WiFi/hotspot or anything which is related to the
setting of the user in the settings menu.
English is my second language. I apologize.
I'm trying to develop an hybrid app and it needs wifi or mobile data enabled to work.
If none of them are enables a Pop-Up appears and gives the user 3 options, Wifi, Mobile Data or cancel.
On Android there's no problem. I can use cordova's diagnostic plugin and use switchToWifiSettings() or switchToMobileDataSettings()
But for IOS only switchToSettings() is available. Is there any way to go further and open WIFI settings or Mobile Data directly?
Thanks in advance.
The functionality was removed in iOS 5.1. There's no way to go further than that.
I'm exploring the WatchKit SDK.
When I have a WatchKit app, is it possible to set values (e.g. Text, settings) from the iPhone app on the WatchKit app? Can I call functions in the WatchKit app extension from the iPhone app?
If someone managed to do this, could he/she post an example? Thanks!
You can use App Group and sharedDefaults to share data between the WatchApp/Extension and the App on the phone.
see example:
WatchKit SDK not retrieving data from NSUserDefaults
Study up on iOS8 Extension/App Groups/sharedDefaults and watchkit extension will make more sense.
This sample takes a UIImage from Shinobi chart, save it to defaults as image.
Then extension picks up the image through defaults and shows it on watch
https://github.com/ChrisGrant/ChartWatch
This one uses multipeer connectivity to have watch talk to phone.
https://github.com/jsclayton/swatches
but this uses Bluetooth and I presume the Watch OS also communicates to the phone using bluetooth so not sure if they'll both be allowed.
We have no devices to test on yet so the /swatches app is just watch simuator talking to iphone simulator on same mac.
If youve ever done low level AV programming you know the app may run on the simulator but fail on the device because the simulator can cheat an use Mac OSX media layer. May be the same for bluetooth.
other samples
https://github.com/search?q=WKInterfaceController&type=Code
There are several solutions: CoreData, NSKeyedUnarchiver and NSUserDefaults. With a common background for sharing the common data resource (Database, file or user default settings), this is enabling App Groups capabilities on both targets project properties.
In the following post is explained how to do it with default settings and you can also download the demo project.
With watchOS2 now Apple supports Watch Connectivity Framework to pass information from watch extension to app and vice versa.
Taken from Apple's docs
Communicating with Your Companion iOS App
The Watch Connectivity framework lets you create a bidirectional communications channel between your WatchKit extension and your companion iOS app. Use this channel to coordinate activities between the two processes. For example, you might use this framework to push updated information from your iOS app to your WatchKit extension. The framework provides options for transferring data in the background or while both apps are active and replaces the existing openParentApplication:reply: method of the WKInterfaceController class.
For more information the classes of the Watch Connectivity framework, see Watch Connectivity Framework Reference.
Taken from Apple's Developers Library
You can see this library
https://github.com/mutualmobile/MMWormhole
It do Message passing between iOS apps and extensions.
looks like the links with brain.clear are not pointing to the right destination for ShinobiChart example
https://github.com/ShinobiControls/ChartWatch
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.