How to link to a specific preference pane in iOS 5 - objective-c

Background
The company I'm working in would like to launch an iOS app to support an hardware device that interacts with some mechanical automatism (aimed to home and building automation) we already produce.
Such automatism receives the pulse needed to activate itself from a nearby bluetooth device, whose MAC address is known by a white list.
We already know of the need to sign up to the MFi program for Bluetooth hardware to connect and talk effectively with Apple devices, exchanging significant messages, but what it is demanded here is to simply detect the presence of such MAC address. No need to establish protocol sessions and the like.
The facts
Investigating how to programmatically enable/disable Bluetooth interface in iOS, I learned it is impossible without private frameworks, as this post states; that is not an option for us, as the app has to be published on the App Store and it is known that Apple rejects apps including code that is coming from private frameworks.
By the way, the app usability would greatly benefit from a direct access to that feature, so I started thinking if, instead of directly interact with Bluetooth on/off state, would it be possible to let the user access to the Bluetooth preference pane straight from the application.
Does anyone know about that?

No, unfortunately it's not possible. There was a trick with:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"prefs://"]];
but it was opening only the preferences (not straight to bluetooth settings) and it's disabled in iOS 5.1. So your only chance is to make a really good help screen (with nice graphics and animations maybe) that explains the user how to enable the bluetooth.

Related

UWP access buttons

Helloo all
I'm currently developing an app for surface pro 3 that should be capable of:
detecting whether touchscreen was tapped and where
getting device information (product ID, amount of RAM, CPu model etc.) done by launching console application first which is capable of getting this information and saves it to a specific folder, UWP app can read its results from there and log them.
accessing sensor data like: accelerometer, gyroscope and ambient light sensor
testing cameras as i can command an app to make picture using either front or rear camera
testing microphones (both front and back)
testing speakers (i made synthesizer that is able to make beeps at given frequency at given stereo mode (left or right if both)
testing wifi - so it can connect to desired wifi network
bluetooth (swill working on it...)
I have already figured out quite a lot and put out a lot of work into it already, all listed tests are already developed on that UWP application so switching to completely different platform means rewriting whole app which I don't have time anymore.
UWP was chosen because this can run on different windows 10 devices and after completing this app the same app (with minor modifications) will be used on other windows 10 devices (like other surfaces and many different windows 10 phones)
This app will be automatically installed on a factory-resetted surface pro 3 that has no special configurations enabled, so tinkering with its settings is resource-hungry and not recommended process at all.
Now I have some other serious issues regarding of device:
how can I test the functionality of all the buttons Surface pro 3 has ?
It has 3 buttons: Volume up, Volume down and power button
but pressing power button sets screen to clack and locks device.
Can I make app override basic functionality of a button so that if button is pressed it detects it and logs its result.
same question goes to volume up and down buttons.
Only similiar questions about this are here:
Another thread on StackOverflow
I also cannot use same solution as I did with getting device information because test must be repetitive while app is running. (and UWP app cannot launch console application by itself)
Any help regarding this topic is highly welcome.
First for the power button behavior try this :
https://www.windowscentral.com/how-customize-power-button-action-when-pressed-windows-10
I don't have a surface so I cannot test it
also, I do have some inputs and thoughts about your app:
it seems to me that you are doing some sort of sanity check software for pieces of hardware I'd suggest looking into this
https://support.microsoft.com/en-my/help/4037239/surface-fix-common-surface-problems-using-surface-diagnostic-toolkit
https://www.lovemysurface.net/surface-diagnostic-toolkit/
additional thoughts of mine :
Overriding hardware behavior programmatically ould be considered as a harmful action especially when it comes to prebuilt devices such as the surface and by extension, I don't foresee MS providing API's for such a capability also such button might be communicating to the hardware directly rather and doesn't go through the software, runtime or the OS at all, changing it manually using the link i provided might be reflecting some registry settings changes but since UWP apps run in containers and cannot directly edit registry there is a dirty workaround look into this
read/write registery key file in uwp
hope this would help
You can use SystemInformation helper class from windows community toolkit it gives you a lot of details about the device.
https://learn.microsoft.com/en-us/windows/communitytoolkit/helpers/systeminformation

Is it available to use UIBackgroundModes and bluetooth-central to send a meesage who is in close area?

I want to create an Application that will send a message or pop up an alert when an people is using a same Iphone Application. And the requirement is , it also need to pop up an alert even it is in background or in sleep mode.
I found an function named UIBackgroundModes and bluetooth-central that will allow to move bluetooth in background.
Somebody help me and i will also be happy if there is sample code.
Not while app is in background mode. For background mode, you will have to fallback to push notification.
Excerpt from Apple Docs:
Peer-to-Peer Connectivity Provides Local Wireless and Bluetooth Networking
Peer-to-peer connectivity allows your game to create an ad-hoc Bluetooth or local wireless network between multiple iOS-based devices. Although designed with games in mind, this network is useful for any type of data exchange among users of your application. For example, an application could use peer-to-peer connectivity to share electronic business cards or other data.
Peer-to-peer connectivity is provided in iOS 3.0 and later.

Connecting 2 iDevices via Bluetooth automatically

So I don't like how I can connect two iPhones with game kit, because you have to choose the iPhone you want to connect to, the other iPhone has to accept... I think this way sucks. I want to have the Bluetooth ON on my two iDevices and I want them to connect automatically between them. Is there a way to do this, or does Apple not approve of it?
I believe it's Bluetooth that won't let this happen. Check out the options presented here: http://en.wikipedia.org/wiki/Bluetooth#Pairing.2FBonding
You can see that only the first SSP option could possibly allow a non-confirmed pairing, and that's not available for devices with security capabilities.

Controlling Network Settings in IOS 5

I have a project where it's highly desired to have some control over network settings in IOS 5 for an iPad device. The ideal scenario would be to have to ability to change the device's wifi connection to a specific SSID. My gut tells me that this is probably functionality that isn't exposed in the SDK but I figured I'd ask.
An alternate goal, if my first assumption about directly changing a connection is correct, would be to allow the app to prompt the user to change network settings and direct the user to the settings screen. I've seen a handful of apps offer this when, for example, the device is in airplane mode and the app requires an internet connection. The major difference in my case is that I'm not necessarily looking to prompt the user just when the device is not on the internet but when whatever connection the device already may (or may not) have isn't the one I'm looking for (in this case, I'm looking for a closed/non-internet-facing Wifi ssid on an aircraft).
I appreciate any pointers that can lead me in the right direction.
It might not fit perfectly what you want but I think CaptiveNetwork is the closest you can get.
The API bindings for CaptiveNetwork are available in recent MonoTouch releases.

Turn iPhone into a server programmatically?

I want to make my iPhone app display on a Mac's screen, kind of like AirPlay does with other machines. The only way I have heard to do this is, although I do not like it, turn the iPhone into a server. Unfortunately, I cannot figure out how to do so. I also wanted to set it up in such a way that my Mac automatically detects it. I have seen a similar setup in the game Chopper 2. My Mac app will have a simple timer that fires every few seconds to look for the iPhone, in the same way that Chopper 2's "Find iPhone" button does.
Is there a simple way to turn the iPhone into a server, or start a "session" like Game Center does?
One last thing: I know it is somehow possible, because another app I have actually gives my iPhone a web address at the click of a button. It is called the Dicenomicon, if you want proof.
First there is no easy way to redirect your display to Mac, even if you made it a server of some kind.
Second, to discover or publish customized services on WLAN, you may want to refer to the samples on Bonjour:
CocoaHTTPServer: a simple TCP/HTTP server.
WiTap: an app that discovers and connects to services of the same kind on WLAN by Bonjour.
I'm not really sure what you mean by "server", because there is no way to share the screen of an iPhone using the official SDK, although this is possible by jailbreaking.
It would be possible, however, to send data back and forth between the Mac and iPhone, and display the data on the iPhone, on a Mac. Using that data, you could try to recreate the interface on the Mac. All of this could be accomplished using sockets. A class that might help with that would be cocoaAsyncSocket, which makes network programming a lot easier.
The auto-discovery of iPhones on the local network is achievable with Bonjour. Without getting into too many details, NSNetService would allow you to publish a service for your app from an iPhone, and NSNetServiceBrowser would allow you to find that service on the local network from the Mac. From the NSNetServiceBrowser, you could establish a socket connection with the iPhone.
Good luck!
You might want to take a look at the GameKit APIs, I know they do something similar between two iOS devices.
http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/GameKit_Guide/Introduction/Introduction.html