Skip to content

[Bug]: add NSLocalNetworkUsageDescription for local-network prompt#820

Merged
a-ghorbani merged 1 commit into
mainfrom
feature/TASK-20260711-0956
Jul 11, 2026
Merged

[Bug]: add NSLocalNetworkUsageDescription for local-network prompt#820
a-ghorbani merged 1 commit into
mainfrom
feature/TASK-20260711-0956

Conversation

@a-ghorbani

@a-ghorbani a-ghorbani commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary

iOS users running a local AI server (Ollama, llama.cpp) on their own network could not connect from PocketPal. On iOS 18.x, when an app's Info.plist lacks NSLocalNetworkUsageDescription, the system silently denies Local Network access: no permission prompt appears, the toggle in Settings → Privacy & Security → Local Network stays off, and requests fail with NSURLError -1009. Manually enabling the Settings toggle was the only workaround (reported by a user on r/PocketPal).

The fix adds the missing usage-description key to ios/PocketPal/Info.plist:

PocketPal connects to AI servers you run on your own network (like Ollama or llama.cpp) when you add them as remote endpoints.

No behavioral code changes and no new dependencies. Intentionally not added:

  • NSBonjourServices — the app makes only direct HTTP requests to user-configured endpoints; there is no mDNS/Bonjour/zeroconf usage (verified by grep across src/ and ios/).
  • Key in any other plist — ios/PocketPal/Info.plist is the only app-target plist; App Intents compile into the main target and no extension bundles exist.
  • InfoPlist.strings localization — the project does not localize its other usage-description keys, so a plain string follows the existing style.

Verification

  • pod install — clean, Podfile.lock unchanged
  • iOS Release build — succeeded; plutil -extract NSLocalNetworkUsageDescription raw on the built PocketPal.app/Info.plist returns the exact string
  • Android release build — succeeded (functionally unaffected; build gate only)
  • yarn lint / yarn typecheck — pass
  • Full Jest suite — 247/247 suites, 3740 passed (2 pre-existing skips); coverage 75.5% statements / 70.0% branches

Suggested manual QA

On a physical iOS device (especially iOS 18.x), add a local endpoint (e.g. Ollama on a Mac) and confirm the Local Network prompt appears with the new text on first connection, and that the connection succeeds after allowing.

Generated by PocketPal Dev Team

@a-ghorbani a-ghorbani added the bug Something isn't working label Jul 11, 2026
@a-ghorbani a-ghorbani marked this pull request as ready for review July 11, 2026 18:47
@a-ghorbani a-ghorbani requested a review from Copilot July 11, 2026 18:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes iOS local-network connectivity to user-hosted AI servers by adding the missing NSLocalNetworkUsageDescription entry to the app target’s Info.plist, ensuring iOS presents the Local Network permission prompt instead of silently denying access.

Changes:

  • Add NSLocalNetworkUsageDescription with a clear, user-facing explanation for local-network access.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@a-ghorbani a-ghorbani merged commit 52c2de8 into main Jul 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants