Discourse Hub android mobile app cannot find private server

My private Discourse server is working and accessible via browser and iOS mobile app.

However, on android, Discourse Hub cannot find the server. (It can find other servers like meta.discourse.org.)

Any idea why this fails? Could it be that the android mobile app uses a different crawler agent to access the server than the iOS version? Or some other reason?

Yes, the mobile app makes some specific requests to determine that the URL is a Discourse server.

There are two requests:

  • a HEAD request to serverdomain.com/user-api-key/new
  • a GET request to serverdomain.com/site/basic-info.json

If either one doesn’t return data, the app will assume the URL isn’t a Discourse site.

1 Like

Most helpful, @pmusaraj ! Thank you. To follow up:

1- Both statements produce a non-error response.

2- Why does the iOS version get through these tests successfully and connect to my server, but not the android version?

1 Like

Ah, this is an indication that the Discourse side is most likely fine, the site verification is the same on iOS and Android.

I remember some Android versions/devices being stricter with SSL certificates, there was a similar in the past, but a long time ago: Community not found in App Android Version 7 - #37 by h.vdheurik

1 Like

For what it’s worth, I had a friend test this using a stock android with the same result. My device is a Pixel 8a running latest version of GrapheneOS.

Could this be a new cypher incompatibility similar to what you referenced from 2017?

I don’t know. If you want to send me the site URL privately, I can debug a bit further.

We checked in on the crawlers. My server blocked many crawlers and it seems one of them was preventing the mobile app from connecting. After resetting to factory settings, the app was able to connect.

Then I added okhttp as the only allowed crawler and the mobile app was still able to connect. Crisis averted. :slight_smile:

Thanks to @pmusaraj for checking the android app code and working through this solution.

1 Like