1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] Flutter/IOS: What could cause a single user to get a "No route to host" error?

Discussão em 'Mobile' iniciado por Stack, Maio 9, 2025 às 20:13.

  1. Stack

    Stack Membro Participativo

    One user in particular is struggling to use my app on a new iPhone. We've confirmed other devices on the same wifi network work with the same app totally fine, and we've also confirmed that switching to cell data doesn't fix the issue.

    The app is built in Flutter and makes a few web requests. They always result in an error like this:

    ClientException with SocketException: Connection failed (OS Error: No route to host, errno = 65), address = public.api.bsky.app, port = 443, uri=https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=[redacted]


    It's not just public.api.bsky.app that has the issue. Their device is sending the same errors for my own API service as well.

    I sent them a link to one of these URLs that are failing on their device, and it works totally fine in Safari.

    My web requests aren't anything special, here is the flutter code I'm using to make http requests (edited for brevity):

    import 'package:http/http.dart' as http;

    class ServerNotification {

    static Future<List<ServerNotification>> getAllNotifications() async {
    var fcmId = await settings.fcmToken();
    var url = '$apiServer/notifications/$fcmId';
    final response = await http.get(Uri.parse(url));
    if (response.statusCode != 200) {
    Logs.error(text: 'network error ${response.statusCode}');
    throw Exception('network error ${response.statusCode}');
    }
    List<dynamic> jsonResponse = json.decode(response.body);
    return jsonResponse
    .map((json) => ServerNotification.fromJson(json))
    .toList();
    }
    }



    So I'm not doing anything too tricky on the Flutter side.

    What on earth could be causing this error on a single IOS device, but not others? Is there any security or network settings on iPhones that could limit the ability for an app to access the internet?

    Continue reading...

Compartilhe esta Página