HTTPSocket connects locally, on app store it fails

I have a Mac desktop app on the app store. The HTTPSocket connects locally in development, but on the app store it fails. So basically I have a function that detects the users WAN IP address. That works locally, but when you download the app from the app store that field fails and I get an error.
Code I’m using:
// Get the page or give up in 30 seconds
PageData = HTTPSocket1.get( “http://checkip.dyndns.com”,30)

The http response code I receive is: 0
Status code 0 is a response object that generally means no response

I thought it was entitlements but that is only on iOS. I use App Wrapper to wrap my app but this is a bit beyond my understanding of how to get past Apple’s security to allow.

Does anyone have experience with this and can offer direction to overcome this issue?

Thanks in advance!

Entitlements are on macOS for the App store also. I would recommend App Wrapper, which provides a nice interface for controlling these things.

1 Like

??

1 Like

Also note: Mac App Store is going to require you use https
I quickly tried that address and it doesn’t look like it’s offering https.

2 Likes

Try https://api.ipify.org/ instead and use URLConnection if possible.

Var u As New URLConnection
MessageBox u.SendSync("GET","https://api.ipify.org/")

Heads up: ipify is on ad blocking hosts blacklists.
(+1 for URLConnection though!)

I believe it was the http not being secure.
I’m going to host my own ip return on a web page so I can better control things. The traffic is low enough to warrant this approach for now.
I’ll also change it to use URLConnection.

Wow - thanks everyone. This forum rocks!

1 Like

Doesn’t SendSync Freeze the UI? I’ll experiment with Send and SendSync

Yes it does. Using Send is recommended.

1 Like

Yes, but i wanted to keep it simple

Got it - create a Thread… :slight_smile:

1 Like

I believe SendSync will also lock the thread and the UI at the same time.
I’ve seen that in webApps.
Using Send is the best way to do it.