CNCopyCurrentNetworkInfo with iOS 13

后端 未结 10 2032
攒了一身酷
攒了一身酷 2020-12-10 00:56

Apple changed some things regarding WiFi with iOS 13. If you want to use CNCopyCurrentNetworkInfo your app needs to have one of the following

  • Apps with permiss
10条回答
  •  眼角桃花
    2020-12-10 01:38

    I have a similar issue in my app. I have submitted a feedback form to Apple and got a response stating:

    Potential fix identified - For a future OS update

    So hopefully, this will be resolved before the final release (not in iOS 13 Beta 4 though).

    For a workaround, you can set joinOnce = false in your NEHotspotConfiguration. In my app, it allowed me to access CNCopySupportedInterfaces, but required me to remove configuration every time my app was closed.

    Hope it helps!

    Edit:

    It seems that in iOS 13 beta 5 issue no longer persists. In my application, I can access CNCopyCurrentNetworkInfo again (thus confirming the Wi-Fi has been connected), no matter if NEHotspotConfiguration.joinOnce flag is set to true or false.

提交回复
热议问题