fabio914 / RealityMixer

Mixed Reality app for iOS
GNU General Public License v2.0
776 stars 63 forks source link

Resolve Wireless Permission Issue on CN Devices #96

Open He-Peter-Huang opened 2 years ago

He-Peter-Huang commented 2 years ago

Per Chinese regulation, apps that runs on devices sold in China Mainland are supposed to prompt for Wireless/Cellular Data Permission before using Local Network or Internet. iOS is supposed to trigger a prompt for the permission prompt when the devices tries to use networking, but since this app uses SwiftSocket, it doesn't trigger the permission prompt. The code added makes dummy request to captive.apple.com which triggers the permission prompt to pop up.

fabio914 commented 2 years ago

That's interesting, I wasn't aware of this. Is there a way we can ask for this permission without necessarily starting this other connection first?

He-Peter-Huang commented 2 years ago

That's interesting, I wasn't aware of this. Is there a way we can ask for this permission without necessarily starting this other connection first?

Hi Fabio, there is currently no other way of triggering this permission prompt without making a connection. iOS is supposed to automatically trigger a permission prompt when using anything that’s related to networking, but it seems like by only using SwiftSocket, iOS doesn’t think the app is trying to use networking.

👇This is an example of the permission prompt: https://imgur.com/a/TASpeVH

PS: This issue have been bugging me for months because I traded in my iPhone 11 Pro (US Version) and got my current iPhone 12 Pro Max (China Mainland Version). Initially I thought it was an issue with my quest 2, but after building the project on XCode and digging through the logs, it occurs to me that the entire app does not have any network connectivity.