Skip to content

Make Formulus settings QR codes camera-scannable via formulus:// deep link #915

Description

@r0ssing

Summary

Update the Formulus settings QR payload so it can be scanned by the system camera (Android first; investigate iOS) and open Formulus into the settings / profile flow, instead of only working when scanned from the in-app Settings scanner.

Today the QR encodes an opaque FRMLS:… string (FRMLSHelpers, Portal, synk qr, formulus/scripts/generateQR.ts). That is not a URI, so OS cameras do not offer an “Open in Formulus” action.

Proposed URI shape

Prefer a custom URL scheme (not an https://opendataensemble.org/… App/Universal Link):

formulus://settings?<FRMLS payload>

Rationale: best fit for app-only deep links. Catching a shared opendataensemble.org HTTPS path risks colliding with normal website / docs QR codes.

Exact query encoding can be finalized in implementation (e.g. wrap the existing FRMLS string in a query param). Keep the FRMLS body as the credential payload.

Requirements

Formulus (consume path)

  • Register an Android intent filter for the formulus:// scheme (path/host for settings as needed).
  • On cold/warm start from such a URI: navigate into the settings/profile flow and treat the payload like an in-app QR scan.
  • Confirmation before applying: show a confirmation dialog before saving. Likely lands after Formulus profiles work lands — in practice this becomes “Add new profile” + confirm before persist (same effective outcome as scanning in-app, with an explicit confirm step).
  • Backward compatibility: in-app scanner must continue to accept bare FRMLS:… codes (no URI wrapper).
  • Deep-linked URIs that contain FRMLS must parse the same fields (serverUrl / username / password) via existing QRSettingsService / decodeFRMLS path (or a thin wrapper around it).

iOS

  • Spike whether the same formulus://settings?… custom scheme is feasible (URL types in Info.plist + Linking), and whether OS Camera / Control Center scanner surfaces an open-app affordance comparable to Android.
  • If iOS system-camera open is weak or unreliable, ship Android first and document iOS as follow-up or in-app-only for now.

Generators (same issue)

Update all producers to emit the new URI-wrapped form (while documenting that bare FRMLS remains readable in-app):

  • Synkronus Portal (synkronus-portal FRMLS / formulus QR helpers)
  • Synkronus CLI (synk qr)
  • Formulus script formulus/scripts/generateQR.ts

Acceptance criteria

  • Android: scanning a new-format settings QR with the system camera can open Formulus and reach the settings/profile apply flow with confirmation before save.
  • In-app Settings scanner still accepts bare FRMLS:… and the new formulus://settings?… form.
  • Portal, synk qr, and generateQR.ts emit the new URI format.
  • Short note in the PR/issue on iOS feasibility and whether iOS is in-scope for the same change or deferred.
  • No hijacking of general opendataensemble.org HTTPS links for this feature.

Notes / context

  • Current encode format: FRMLS:v:<b64>;s:<b64>;u:<b64>;p:<b64>;;
  • Related code: formulus/src/utils/FRMLSHelpers.ts, formulus/src/services/QRSettingsService.ts, formulus/src/screens/SettingsScreen.tsx, Portal frmls / formulus QR utils, synkronus-cli qr command.
  • Profiles dependency: confirmation / “Add new profile” behavior may intentionally follow the profiles work.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestformulusFor issues related to the Formulus React Native application

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions