DNS problems in Codename One

In my application server settings, the iOS version is unable to interpret any address I enter. I think it may be DNS problems because when I use an IP, it works normally.

Example:

I tried to connect to this URL: http://seu-app-dev02.amnet.local:8080 and did not work on the iOS build. (Android works normally)

If I Replace that with IP, it worked...

Is there any solution to this problem?

Upvotes: 2

Views: 45

Answers (1)

Diamond
Diamond

Reputation: 7483

This could be due to calling non https URL which Apple recently started to restrict. To solve this, try adding this build hint:

ios.plistInject=<key>NSAppTransportSecurity</key><dict><key>NSAllowsArbitraryLoads</key><true/></dict><key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLName</key> <string>com.mycompanyname.MyApp</string> </dict> <dict> <key>CFBundleURLSchemes</key> <array> <string>MyApp</string> </array> </dict> </array>

Replace com.mycompanyname.MyApp and MyApp to correspond with your app name and bundle reverse domain name.

In addition to above, a quick copy and paste of the above URL in my browser return below error:

This site can’t be reached seu-app-dev02.amnet.local’s server DNS address could not be found. Search Google for seu app dev02 amnet local 8080 ERR_NAME_NOT_RESOLVED

Upvotes: 1

Related Questions