iOS 12 ParticleSetup not completing after selecting device

photon
Tags: #<Tag:0x00007fe21e26d808>

#1

Hi there,

I’m having issues with the iOS ParticleSetup library.

The setup process starts OK. I click “Ready” and get passed the first screen. Second screen comes up telling me to select the device from WiFi and then come back. I select the device from WiFi, but when I return to the app nothing happens.

The only errors I see in console are things like:
NSURLConnection finished with error - code -1005
TIC Read Status [2:0x0]: 1:57
TIC TCP Conn Failed [5:0x283429500]: 1:50 Err(50)
Task <FC02FA32-46C3-4D89-AC6D-35A551F8719A>.<0> HTTP load failed (error code: -1009 [1:50])
NSURLConnection finished with error - code -1009

As far as I’m aware I’ve followed the setup instructions correctly. I’ve got the Pods file my bridging header setup and referenced in the build settings.

Update:

Findings
The above errors are related to an iOS 12 bug. Closing and reopening an app produces these errors. Along with:

[BoringSSL] nw_protocol_boringssl_error(1584) [C2.1:2][0x103333150] Lower protocol stack error: 53

Actual cause of issue
The current version (0.9.0) of the ParticleSetup iOS pod uses CNCopyCurrentNetworkInfo which, in iOS 12, needs the ‘Access WiFi Information’ capability. In XCode: Project > Capabilities > Access WiFi Information.

It looks like they’re currently developing a different method using sockets, so this may change in future.


#2

Hello. Glad you were able to find the solution to the problem. This is not the cause of the issue, this is just how iOS handles the security and there’s nothing much we can do on our end to avoid this. For photon setup that permission is required and it became a requirement in iOS 12.

The BLE based setup (not sockets though) will only be available for 3rd gen devices.


#3

Thanks Raimis. What I meant was that the issue was caused by me not having the permission enabled. I’ve written it up like this so it may help others facing the same problem. If the requirement for this permission is mentioned in the docs, I must have missed it.