Automatic connection between 2 IOS Apps - ios

I have written a Solution that contains two Apps,
the first app acts like a remote control app and the second app display some stuff depending on the selection of the first app.
State Now:
Currently, both apps communicate over a Bluetooth connection using the MultipeerConnectivity.framework.
Problem:
I have always to pair both apps manually starting the apps.
Solution:
Starting both apps, they should detect each other and be paired automatically.
How could I solve my Problem, is there any alternative to the Bluetooth connection or can I set up the connection to have trusted devices or something like that?

It's up to you as the developer how the pairing is implemented. You could even code a solution which requires no approval from the user; the app could pair automatically with any device looking for other peers (although this probably wouldn't be a good idea for a variety of reasons).
One possible solution for your problem:
The first time your devices pair, you generate a random UUID and save it on both devices for later use.
The next time your devices discover one another, they check to see if they have any matching UUIDs stored; if they do find a matching pair then you can let them connect automatically.

Related

If my iOS app pairs with a device using Core Bluetooth, will other apps have access to the device?

From Android documentation:
Caution: When a user pairs their device with another device using BLE, the data that's communicated between the two devices is accessible to all apps on the user's device.
For this reason, if your app captures sensitive data, you should implement app-layer security to protect the privacy of that data.
Is this also true for iOS? I haven't found anything on it and I assumed because iOS doesn't show the true MAC addresses of devices this wouldn't be an issue, but just wanted to check. Thanks
Yes, iOS also works in a similar way. And if you want private communication, you also need to maintain app layer security. Thus android wear, galaxy watch, and other similar devices use encrypted communication in the app layer.
If you already know the details. BLE communication works via Gatt Characteristics.
Consider there are two health applications running on an iOS device and the user also using an activity tracker device. In that case if the user wants to connect both of the health apps with that tracker, he certainly can do it. Both apps will be able to communicate with the activity tracker and get sensor data using the CBCentral module. Look at the diagram for Details.
On the other hand, In general, vice versa will not possible. Because if both iOS apps use Peripheral Role they will register two different instances of BLE-Service even if using the same UUID. Thus it will force two apps to communicate with completely different characteristics instances. However, it is also possible to work with two peripheral apps with the same UUID but this is not what the BLE developers ever wanted.
you need to provide app level security based on Service UUID, so that devices having the app with only same service UUID can connect.

Publish IOS App to Appstore with SSID ( wifi) discovery/connect through app

I was trying to get a specific info before a IOS App development task which I searched but couldn't find anything relevant.
Wanted to know whether this requirement restricts (non compliance issue as per publish guidelines) the app to be published in App Store with features as below
User scans and lists all available wifi connections in a tableview
Selects one of the Wifi connection and connects on button click
Stores the password and SSID for future connections.
Would there be any compliance issue related to the same functionalities when submitting to IOS app store. One of my colleague have advised me about the same but not able to explain why? Which I tried to find out searching the internet, but too specific to find anything relevant. Deeply appreciate an Expert advise on this.
Thanks in advance.
I can't find anything in the Review Guidelines that would object your app idea: https://developer.apple.com/app-store/review/guidelines
A couple of areas where you should have a more detailed look:
2.5.1 Apps may only use public APIs.
2.5.9 Apps that alter the functions of standard switches, such as the Volume Up/Down and Ring/Silent switches, or other native user
interface elements or behaviors will be rejected.
5.1 Privacy
Technically, I'm not sure if it's even possible to change the WIFI not via the settings app, so I'd have a look their first. (https://apple.stackexchange.com/questions/1592/is-there-an-ipod-app-to-easily-switch-wifi-on-and-off)
I don't believe I've ever seen an app or a way to change SSID outside the Settings app. I explored a way to detect network changes, connects, disconnects, which work fine while the app is running. I was never able to influence how the user connected, just that a change happened. It also falls apart pretty quickly when the user backgrounds the app. Trying to keep a background task open long enough to poll the current connection fails pretty fast.
I wish Apple would provide some system level notification of Wifi connect events. This could be very useful to developers that want a little more control than Background App Refresh events.

How to pair ibeacon with iOS first time programmatically

I started with ibeacon-based(actually— lock) device development+iOS application. I can provide to iOS app the minor and major+ UUID of beacon. But, it is good only for testing.
And what if the customer bought my device and want to pair with self.iOS application. For having a unique key to opening/closing device? Sure, i can write in code the common major/minor for all my devices, but it is foolish and insecure, right? Any user with my app can open the lock with 1 tap.
So, can you help me to understand how i can pair 1 unique iPhone with 1 unique ibeacon(but they all mine) to have an 1 unique pair to communicate?
I need to do it at the 1st time after unboxing the lock.
Why don't you require the user to register to a web service after app installation, and then download the UUID/major/minor from the web service and store the identifiers in the app?
If you are distributing user-specific hardware beacons, you can have an activation code associated with each beacon that is entered as part of the registration process. One code must be tied to a UUID/major/minor on the back end.
Keep in mind that once the beacon is transmitting, anybody can read the beacon identifiers over the air using Android, Linux or OSX. So make sure your system is adequately secure.

Bluetooth Smart: is it sensible to choose a device based on its peripheral name

I have an application (Basically an Arduino) that I connect to from iOS (and might use Android in the future as well) using BLE. I reprogram the BLE hosts to a specific value so that the when I ask the peripherals name after it gets discovered in iOS can be accepted or rejected.
I'm however not sure that this is a good way to do. The name has a code that users can easily change to an other (always valid) code. That way if two modules are up and running at the same time, users will be sure that only the module they are linked to is the one they want to be linked to. This is a bit the same like connecting a mouse / keyboard of course using 'normal' bluetooth.

GameKit peer to peer connection issue. It takes long time to deliver an invitation to another device

I'm using GameKit peer-to-peer connection in my app and I'm experiencing the following issue: when using GKPeerPickerController sometimes it takes too long time to deliver an invitation to connect from one device to another. Sometimes devices just don't see each other. What can i do about that? Is it better not to use GKPeerPickerController at all and present custom interface?
Depending on the type of app you are trying to make, it may be more beneficial for you to have one device act as a Server and another as a Client. I've noticed from personal experience that having both devices act as Peers can take considerably longer, or just flat out not work.
The only disadvantage with the Server / Client perspective is that your users will have to specifically choose one or the other, and you will have to create your own user interface. But if you can work with that then you'll probably get better results. Good luck!

Resources