Skip to content

mobile: implement BLE proximity discovery for nearby DevCard users #29

@ShantKhatri

Description

@ShantKhatri

Summary

Product doc section 4.3 specifies AirDrop-style proximity sharing via Bluetooth Low Energy (BLE). Implement the native BLE scanning and advertising layer in the React Native mobile app using react-native-ble-plx.

Context

This is one of DevCard's core differentiators. When two users are nearby and both have the app open, they should see each other's cards without needing a QR scan. The ScanScreen.tsx screen at apps/mobile/src/screens/ScanScreen.tsx is the natural mount point for the discovery flow.

Tasks

  • install and configure react-native-ble-plx in apps/mobile.
  • add required permissions in AndroidManifest.xml (BLUETOOTH_SCAN, BLUETOOTH_ADVERTISE, ACCESS_FINE_LOCATION) and Info.plist for iOS.
  • create apps/mobile/src/context/BLEContext.tsx providing startAdvertising(userId), startScanning(), and discoveredUsers state.
  • BLE service UUID should be a static DevCard UUID defined in packages/shared/src/constants.ts.
  • discovered devices broadcast only their DevCard userId — no raw profile data over BLE.
  • on discovery, fetch the discovered user's public profile from the backend and surface a local notification/banner.
  • expose a ProximityBanner component rendered on ScanScreen showing discovered users with a 'View Card' CTA.
  • handle graceful degradation: if BLE is unavailable or permission denied, fall back to QR mode silently.

Acceptance Criteria

  • two devices with the app open and BLE enabled see each other in the discovery banner.
  • tapping 'View Card' opens DevCardViewScreen with the discovered user's data.
  • no raw profile data is transmitted over BLE.
  • permission denial path does not crash the app.

Difficulty

advanced — requires native BLE APIs, background permission handling, and cross-platform (iOS + Android) compatibility.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions