LiquidPlayer / LiquidCore

Node.js virtual machine for Android and iOS
MIT License
1.01k stars 127 forks source link

App Transport Security in DEBUG mode [iOS] #159

Open daetal-us opened 4 years ago

daetal-us commented 4 years ago

per docs, LCMicroService.bundle() attempts to hit the local development server when compiled in DEBUG mode. I didn't see a note of the subsequent errors reported anywhere but you'll want to add an exception for localhost to silence the warnings in the console:

e.g. temporarily added to my project's Info.plist:

(note: only for development! inadvisable for production)

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>localhost</key>
        <dict>
            <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
    </dict>
</dict>
ericwlange commented 4 years ago

Thanks @daetal-us . Yes, you have to enable cleartext HTTP. I should make that clear in the documentation. I also just discovered that this doesn't work in Android at all because if you use the distribution (rather than build from source), it is never in debug mode since the library is distributed in release mode. Hence, the logic to hit the dev server is compiled out. I need to figure out if I can detect the build flavor of the client app, not the library itself. So I will use this issue to cover both the problems in iOS and Android.