Skip to content

Commit 95fb963

Browse files
committed
mobile: declare iOS local-network / mDNS permission
The Viam SDK finds the machine on the LAN via Bonsoir mDNS browsing for the `_rpc._tcp` service. iOS blocks that unless the app declares NSLocalNetworkUsageDescription and lists the browsed Bonjour service type in NSBonjourServices — without them the fast `<machine>.local` direct connection fails. Add both to the iOS Info.plist patcher. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016m9NjsSfBSx1RgN3fpnx7e
1 parent 612f450 commit 95fb963

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

mobile/tool/ios-appauth.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,20 @@ set_str NSCameraUsageDescription "Shows the boat's camera feeds."
3333
set_str NSMicrophoneUsageDescription "Required by the Viam robot connection."
3434
echo "ensured camera/microphone usage descriptions in $PLIST"
3535

36+
# --- Local network / mDNS ---------------------------------------------------
37+
# The Viam SDK finds the machine on the LAN via Bonsoir mDNS browsing for the
38+
# `_rpc._tcp` service (the fast on-boat direct connection). iOS silently blocks
39+
# this unless the app declares a local-network usage description AND lists the
40+
# Bonjour service type it browses — otherwise the `<machine>.local` connection
41+
# fails. Add both (idempotent).
42+
set_str NSLocalNetworkUsageDescription "Connects to your Viam machine on the local network."
43+
if ! "$PB" -c "Print :NSBonjourServices" "$PLIST" 2>/dev/null | grep -q "_rpc._tcp"; then
44+
"$PB" -c "Print :NSBonjourServices" "$PLIST" >/dev/null 2>&1 \
45+
|| "$PB" -c "Add :NSBonjourServices array" "$PLIST"
46+
"$PB" -c "Add :NSBonjourServices: string _rpc._tcp" "$PLIST"
47+
fi
48+
echo "ensured local-network / mDNS keys in $PLIST"
49+
3650
# --- OAuth redirect scheme --------------------------------------------------
3751
if "$PB" -c "Print :CFBundleURLTypes" "$PLIST" 2>/dev/null | grep -q "$SCHEME"; then
3852
echo "iOS URL scheme $SCHEME already present in $PLIST"

0 commit comments

Comments
 (0)