NEHotspotHelper NetworkExtension - ios

I am trying to use the new framework but I can not understand very well the scope.
Is it possible to connect a Wi Fi automatically?
For example, when iOS call the background service in my App I can set the password and the confidence of a particular network.
[network setConfidence:kNEHotspotHelperConfidenceHigh];
[network setPassword:#"QWERTY"];
and I can see a message under the SSID but the user has to touch the Wi Fi to connect.
My question is, is It possible to do this without the user touch it? For example, When you have a known Wi Fi the iOS is connected to this automatically.
is There a way to emulate this behavior with this framework?
Thanks.

This framework only allows you to connect selecting the network (touching it).
You can´t emulate this behavior because you can´t get into settings app, it´s the extension that get into your app and do the work

If the user has already previously connected to an SSID that you are managing through NEHotspotHelper, you can automatically connect them. If the user has never connected to the SSID in the past, or has chosen to "Forget the Network", then know you can't automatically connect them without the user manually selecting the network from the settings app.
Like Fernando Garcia Corrochano said there is no way to emulate this behavior.

Related

How reconnect programatically Classic Bluetooh on IOS with MFi and external-accessory framework

I am creating an IOS App to connect into a Bluetooth Device using Classic Bluetooth with Mpi using ExternalAccessory Framework.
Using showBluetoothAccessoryPicker method, I can display an alert with a list of devices that allows the user to select one Device to pair.
I can perform Steps 1 -5 of my use case as below. However I not able to perform step 6
Use case:
The User picks one Device to pair. On that case, I am using showBluetoothAccessoryPicker
The App stores, into a variable, the accessory that the user picked
Turn off the Device
The App shows an alert "Connection dropped"
Turn On the Device
The App needs to reconnect with the Device automatically without needs to select it into a list.
Is there any way or method to pair a device without display a list?
As my company is a member of the Apple MFi licensing program, I asked for Apple support and I received the answer below.
"
In response to your request below, there is presently no support for implementing the bluetooth reconnection process from the device side after an existing connection has been broken. This would be an API enhancement request which you can submit using the Apple Developer feedback assistant web page - https://feedbackassistant.apple.com.
"
"
One option would be for the accessory to handle the reconnection process itself as this is a supported bluetooth option. However, I understand if for power conservation reasons, this is not supported accessory option."
It means, there is no way, yet, to implement it from the App side. if you need that, you need to do it on the Device side.
We can submit feedback for the Apple, using the Apple Developer feedback assistant web page - https://feedbackassistant.apple.com to ask them to create it
you need to make some changes in your firmware to reinitiate the connection when it identifies the connection drop. Or else you can write a method and call on connection drop in your application which keeps looking for device in proximity (with accessory info saved in your app variable) and as and when it finds, it connects using that accessory instance.

iOS Check for Connected Peripheral - Xamarin

Hi I have created Core Bluetooth app which connects to peripheral. In my app, i have login page, connect to device page and further more pages.Now, When user login to the app first time, user needs to connect to the device first time which works perfectly fine but if user logout or login again i don't want to show connect to device option to the user. I want the device automatically connected to the app. Is there any event i should listening for ? I have tried to utilize RetrievedConnectedPeripherals event of central manager but this does not seems to be invoke by the app.
One basic hint when working with Xamarin: you still have the same APIs to learn as when programming in native. Therefore, you should also look out for generic CoreBluetooth help, and not Xamarin-specific answers - you will find more resources this way!
You will have to store the CBPeripheral's identifier in a persistent store (NSUserDefaults for example). Then you will have to call RetrievePeripherals, to get a CBPeripheral instance back, and simply connect it like you did the first time. RetrievedConnectedPeripherals is deprecated as of iOS 7 and has been replaced by a synchronous method.
You should also check out Apple's documentation and Programming Guide to get started.

How to set up wifi programmatically in iOS app?

How to set up the known wifi with my known account/password in the iOS app ?
I want the user open the app and set up wifi background without letting user know. Can we do that with code ? and how if we can ?
If we can not, is there any alternative solution to resolve this problem with best user experience ? thanks
AFAIK, you cannot setup known wifi networks inside your app. What you could do is add the key 'UIRequiresPersistentWiFi' to your app's plist. That will ensure that the system shows a dialog informing the user about the requirement of wifi for the app. If i remember correctly, in case wifi is disabled, the dialog also displays a settings button by default which the user can click and be redirected to the 'Settings' app. HTH.

iOS - Restricting use to single app

I am developing a business app for use on an iPad/iPod Touch. I am wondering if there is a way to restrict usage on the device to my app only. In other words, we don't want employees installing other apps such as games and playing around with the devices.
Yes, that's possible.
Check out the iOS Configuration Profile Programming Guide.
Edit: See the section about restrictions, it will allow you to do exactly what you need. Note however that you'll need to have access to those devices, ideally the devices should be company property. And you need to distribute your app via Enterprise Distribution.
Edit 2: Since iOS6, this feature is available through the normal settings app. It is called "Guided Access" and is part of the Accessibility settings. It will let you disable the home button (cancel guided access by triple-clicking the home button and enter the preset code) and it will even let you define areas within apps which should be disabled.
I don't think so, unless their device is jailbroken.
If they're logged into an Exchange server you could remote-wipe their phone if they install anything.
Do you provide the devices? Or they bring their own?
If you provide the devices that would mean you can use your Apple-id. If an employee would try to download any other app he would need the password of your Apple-id. So thats a simple way to prevent that.
Im am not sure if there is a total "lock" of such type.

Create equivalent of Androids sync adapter on iOS

I got data on a webserver which I want to download to an iOS contact list. Is it possible to programatically create an account on iOS that works like the android "sync adapter" and is not one of the default account or an LDAP/CardDAV account?
Or can I have my application to periodically chech for updates on my webserver without the user having to manually start it. (i.e. running in the background and starting up automatically when the phone is restarted)
No, to both. The best you can do is create a configuration profile that the user can download to add an LDAP/CardDAV account—but you will need to run an actual LDAP or CardDAV server to have any kind of automatic contact syncing happen without the user opening your app. The Address Book framework on iOS only allows you to add and modify contacts within the existing accounts on the device, and the multitasking rules only allow your app to start in the background if it provides a VoIP service.
Use silverstripe-sync !
Source: SO

Resources