mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Request iOS local-network permission at app launch
The iOS local-network permission prompt fires on the first local-network access. That used to be the user's "Test" tap in settings, so the prompt appeared mid-request and the first connection attempt always failed. Provoke the prompt at launch instead via an mDNS multicast datagram, so the permission is settled before the user reaches settings. Platform exclusion is handled with a conditional import: web gets a no-op stub (keeping dart:io out of web builds) and the native path no-ops off iOS. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
87af782985
commit
40a7f3a432
@@ -0,0 +1,10 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:frontend/utils/local_network_permission.dart';
|
||||
|
||||
void main() {
|
||||
test('is a no-op off iOS and never throws', () async {
|
||||
// Tests run on the host VM (not iOS), so this exercises the guard: it must
|
||||
// return cleanly without touching the network or raising.
|
||||
await expectLater(requestLocalNetworkPermission(), completes);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user