Connecting to a device from an iOS app. How to handle authentication

This might also help: