Skip to content

feat(app): add Meta Wearables integration and supporting fork updates - #9084

Closed
moni11811 wants to merge 10 commits into
BasedHardware:mainfrom
moni11811:omi4meta-meta-glasses-integration
Closed

moni11811 wants to merge 10 commits into
BasedHardware:mainfrom
moni11811:omi4meta-meta-glasses-integration

Conversation

@moni11811

@moni11811 moni11811 commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

What

Draft PR from moni11811:omi4meta-meta-glasses-integration into BasedHardware/omi:main.

This is a broad fork sync, not only the visible Meta glasses UI. Current diff from GitHub PR files API: 619 files, +66,148 / -2,298.

Main chunks:

  • Meta Wearables / DAT glasses integration: app provider/service/page/onboarding/debug proof, capture diagnostics, queue/watchdog, device labeling, runtime proof scripts, and regression tests.
  • Vendored Flutter bridge: app/third_party/meta_wearables_dat_flutter with Dart platform interface, Android plugin/session manager, iOS plugin/session manager, example scaffolding, and generated/proto support.
  • Native mobile bridge/config: iOS BLE/DAT bridge pieces, Podfile/SPM/project changes, entitlements/config fixes, Android BLE/audio foreground service pieces and Gradle/manifest wiring.
  • Device/capture stack updates: device page, capture/connect routing, onboarding device flow, batch/local recording/conversation handling, WAL/storage sync touchpoints.
  • UI/design-system and integration-service cleanup: app/lib/ui atoms/molecules plus Apple Health/Reminders, Asana, ClickUp, Google Tasks/Calendar, Todoist service extraction.
  • Localization: ARB and generated l10n updates across 99 files.
  • Docs and plans: Meta glasses follow-up plans, runtime stabilization notes, root docs/wearables developer references, rollout/runbook docs.
  • Other fork changes included: plugins/omi-zomato-app, small SDK release/podspec edits, setup/test/signing helper scripts, AGENTS guidance edits.

Why

Meta glasses need a first-class device/capture path instead of phone-mic or generic BLE assumptions. This branch wires the app, native bridge, tests, docs, and follow-up plan needed to keep that path explicit.

This is kept as draft because the fork diff is large and should be reviewed/pruned by chunk before it is marked ready.

Review notes

Suggested review order:

  1. Meta Wearables app/provider/service/native bridge.
  2. Vendored meta_wearables_dat_flutter package.
  3. Device/capture/onboarding routing.
  4. Tests and runtime proof scripts.
  5. Docs/root/plugins/sdk extras; decide what should stay in this PR vs split out.

Test plan

Not run in this PR-opening pass.

Regression surfaces present in the branch include:

  • app/integration_test/meta_glasses_mock_test.dart
  • app/test/unit/meta_glasses_autostart_regression_test.dart
  • app/test/unit/meta_glasses_background_stream_contract_test.dart
  • app/test/unit/meta_connection_reliability_contract_test.dart
  • app/test/unit/ios_launch_regression_test.dart
  • app/test/ios_dev_signing_contract_test.dart
  • additional Meta glasses runtime/session/watchdog/display/relay tests under app/test/unit/

Before ready-for-review: run targeted Flutter tests, l10n generation/analyze, and an iOS dev build/install on the Meta glasses path.

@moni11811
moni11811 marked this pull request as draft July 5, 2026 20:13

@cubic-dev-ai cubic-dev-ai Bot 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.

28 issues found across 619 files

Confidence score: 2/5

  • The highest-risk issue is the App Group split across app/ios/Runner/RunnerProfile-dev.entitlements, app/ios/Runner/Runner.entitlements, and app/ios/BatteryWidget/BatteryWidget.entitlements while SharedDefaults.swift/AppDelegate.swift still reference the old group; shared container reads/writes can fail at runtime and break app↔widget data flow. Align all entitlement IDs and native hardcoded group strings per flavor before merging.
  • In app/lib/pages/onboarding/auth.dart, Apple Sign-In is now controlled by Env.appleSignInEnabled but defaults are false in both env files, so release builds can silently ship with Apple login unavailable unless CI injects the flag. Add a safe default or enforce APPLE_SIGN_IN_ENABLED=true in release pipelines and verify in a release-config build before merging.
  • app/ios/Flutter/devRelease.xcconfig reuses the prod omi URL scheme, which can cause nondeterministic deep-link routing when dev and prod are both installed, leading to wrong app handling auth/callback links. Give dev/prod distinct schemes (or another deterministic routing strategy) before merge.
  • There are concrete regression risks in device flows: _getStoredDevice in app/lib/services/devices.dart no longer reads legacy btDevice while device_provider.dart still writes it, and app/lib/pages/home/device.dart broadens the tutorial to all Omi device types. This can cause missing restored pairings and incorrect onboarding for non-CV1 users—restore legacy fallback (or migrate stored data) and reintroduce device-type gating/tests before merging.

Not reviewed (too large): app/lib/l10n/app_be.arb (~44 lines), app/lib/l10n/app_bn.arb (~44 lines), app/lib/l10n/app_bs.arb (~44 lines), app/lib/l10n/app_fa.arb (~44 lines), app/lib/l10n/app_he.arb (~44 lines), app/lib/l10n/app_hr.arb (~44 lines), app/lib/l10n/app_kn.arb (~44 lines), app/lib/l10n/app_mk.arb (~44 lines), app/lib/l10n/app_mr.arb (~44 lines), app/lib/l10n/app_sl.arb (~44 lines), and 5 more - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="app/android/app/src/main/kotlin/com/friend/ios/BleCompanionService.kt">

<violation number="1" location="app/android/app/src/main/kotlin/com/friend/ios/BleCompanionService.kt:49">
P2: The companion-service autostart path is still starting from any appeared association. `managed_device` only influences `requiresBond`; it does not block `startService()` when the appeared address is different from the configured device. That can reconnect the wrong BLE device if multiple associations exist.</violation>
</file>

<file name="app/lib/ui/atoms/omi_avatar.dart">

<violation number="1" location="app/lib/ui/atoms/omi_avatar.dart:24">
P2: The avatar only shows a fallback when `imageUrl` is null, so empty strings or failed network loads bypass the fallback and render a blank avatar. Consider also guarding against empty strings with `imageUrl != null && imageUrl.isNotEmpty`, and using `CachedNetworkImage` (which the app already uses in chat and app detail pages) if you need graceful handling of actual network failures.</violation>
</file>

<file name="app/ios/Runner/Runner.entitlements">

<violation number="1" location="app/ios/Runner/Runner.entitlements:26">
P1: Changing the App Group entitlement identifier here introduces a runtime mismatch with the hardcoded group references in `SharedDefaults.swift` and `AppDelegate.swift`, which still use the old `group.com.friend-app-with-wearable.ios12`. The BatteryWidget extension entitlements already match the new group, so the main app and widget will share one container while the code tries to read/write another. `UserDefaults(suiteName:)` will return `nil` for a non-entitled suite, silently breaking the battery-widget shared-data path. You should either update the Swift code to match the new group (e.g., via a build-flavor-configurable constant), or keep the entitlement aligned with the existing hardcoded references.</violation>
</file>

<file name="app/lib/ui/atoms/omi_icon_button.dart">

<violation number="1" location="app/lib/ui/atoms/omi_icon_button.dart:17">
P2: The generic `OmiIconButton` atom has no semantic label or tooltip parameter. Because it is icon-only and built from `InkWell` + `Icon` (not the framework `IconButton`), screen readers will announce a generic unlabeled button. Consider adding a `tooltip`/`semanticLabel` parameter and applying it via `Icon.semanticLabel` or a `Semantics` wrapper so every consumer gets accessibility by default.</violation>
</file>

<file name="app/lib/pages/onboarding/complete_screen.dart">

<violation number="1" location="app/lib/pages/onboarding/complete_screen.dart:129">
P2: The CTA button text was changed from a localized string lookup (`context.l10n.startUsingOmi`) to a hardcoded English literal (`'Start Using Omi'`), and the `l10n_extensions.dart` import was removed. This creates a mixed-language UI for non-English users: other localized screens will adapt to the system locale, but this onboarding completion CTA will remain in English. Revert to `context.l10n.startUsingOmi` and keep the l10n extension import so the button stays consistent with the rest of the app’s localization surface.</violation>
</file>

<file name="app/lib/ui/atoms/omi_button.dart">

<violation number="1" location="app/lib/ui/atoms/omi_button.dart:61">
P2: The button's visual enabled state and actual tap behavior can diverge when `onPressed` is null but `enabled` is true (the default). In that case the `InkWell` receives `onTap: null` and becomes completely non-interactive, while the gradient, shadow, and white text still render the enabled appearance. This produces a button that looks actionable but does nothing.

The component should derive a single effective-enabled boolean — for example `enabled && onPressed != null` — and use it consistently for both the tap handler (line 60) and every visual branch (colors, gradients, shadows, text opacity).</violation>
</file>

<file name="app/lib/pages/onboarding/auth.dart">

<violation number="1" location="app/lib/pages/onboarding/auth.dart:74">
P1: Apple sign-in availability is now gated by `Env.appleSignInEnabled`, which defaults to `false` in both `dev_env.dart` and `prod_env.dart`. If a release build does not explicitly set `APPLE_SIGN_IN_ENABLED=true` in its `.env` flavor, the Apple sign-in button will silently disappear for iOS/Android users even though the underlying `onAppleSignIn` auth logic remains intact. Consider confirming that all production flavor `.env` files set this variable to `true` (if Apple auth is intended to remain available), or add an explicit assertion/fallback so the missing config is surfaced at build time rather than silently disabling a user-facing auth path.</violation>
</file>

<file name="app/ios/BatteryWidget/BatteryWidget.entitlements">

<violation number="1" location="app/ios/BatteryWidget/BatteryWidget.entitlements:7">
P1: The BatteryWidget entitlement App Group was changed to `group.dev.moni11811.omi`, a developer-specific identifier. Since the widget has only a single entitlement file, this affects all build flavors. The prod Runner entitlements still use `group.com.friend-app-with-wearable.ios12`, which will break shared-container communication between the widget and main app in prod builds. Additionally, `BatteryWidget/SharedDefaults.swift` and `Runner/AppDelegate.swift` still hardcode the old App Group ID, so the code will attempt to access a UserDefaults suite that no longer matches the widget entitlement. Consider reverting this to the production App Group or adding dev/prod widget entitlement variants and updating the corresponding hardcoded references.</violation>
</file>

<file name="app/lib/services/clickup_service.dart">

<violation number="1" location="app/lib/services/clickup_service.dart:42">
P2: `authenticate()` can report success even when the OAuth URL fails to open because `launchUrl`'s boolean result is discarded. After `canLaunchUrl` passes, the actual `launchUrl` call may still fail at runtime (e.g., OS-level denial or transient error), yet the method unconditionally returns `true`. That can advance UI/state as if the OAuth flow was initiated when it was not.</violation>
</file>

<file name="app/lib/services/devices/meta_wearables_service.dart">

<violation number="1" location="app/lib/services/devices/meta_wearables_service.dart:69">
P2: `startPairing()` returns a synthetic `DeviceInfo` with the hardcoded UUID `meta-registration-pending` when no real device is found yet. Because this is a fixed string, any downstream code that keys by `BtDevice.id` — whether in a device list, persistence layer, or analytics — will collide across registration attempts and users. Consider making `startPairing()` return `Future<BtDevice?>` and passing `null` when no device is available, or at least generating a unique placeholder UUID per call, so callers don't accidentally treat the placeholder as a stable device identity.</violation>
</file>

<file name="app/lib/ui/atoms/omi_loading_badge.dart">

<violation number="1" location="app/lib/ui/atoms/omi_loading_badge.dart:26">
P2: The `OmiLoadingBadge` shared atom uses a hardcoded English default (`'Loading…'`), which bypasses the app's `AppLocalizations` system. If any caller relies on the default instead of passing a localized label, non-English users will see untranslated English text. Consider removing the default to make `label` a required parameter, so callers are forced to supply a localized string from `AppLocalizations`.</violation>
</file>

<file name="app/ios/Runner/SceneDelegate.swift">

<violation number="1" location="app/ios/Runner/SceneDelegate.swift:9">
P2: This SceneDelegate forwards opened URLs to Flutter via `super.scene(...)` and then immediately redispatches the same URLs through `AppDelegate.application(...open:options:)`. FlutterSceneDelegate already routes URL events to plugins and the framework; manually calling the legacy AppDelegate path can cause duplicate plugin handling and will re-run the custom `MetaWearablesDatHandleURL` notification and `onDeepLink` channel for each URL. If the AppDelegate-specific logic is required here, consider extracting it into a shared helper that the SceneDelegate calls directly, rather than re-entering the plugin dispatch path.</violation>
</file>

<file name="app/lib/l10n/app_da.arb">

<violation number="1" location="app/lib/l10n/app_da.arb:3132">
P2: The `metaGlassesPendingPhotos` Danish translation uses a plain `{count}` placeholder and always renders the plural noun form `billeder`. When exactly one photo is pending, the UI will show the grammatically incorrect "1 billeder venter på synkronisering" instead of "1 billede venter på synkronisering". Other count-sensitive strings in this same Danish ARB file already use ICU plural formatting (e.g. `nConversationsCreated`), so this entry should follow the same pattern for correct Danish grammar at all counts.</violation>
</file>

<file name="app/ios/Runner/RunnerProfile-dev.entitlements">

<violation number="1" location="app/ios/Runner/RunnerProfile-dev.entitlements:26">
P1: The dev profile app group was moved from `group.com.friend-app-with-wearable.ios12` to `group.dev.moni11811.omi`, but the native code that uses the shared container still references the old identifier. Because iOS only allows access to app groups listed in the entitlements, dev builds will silently fail to read/write shared data.

`Runner/AppDelegate.swift` hardcodes the old group when writing battery info:
```swift
let defaults = UserDefaults(suiteName: "group.com.friend-app-with-wearable.ios12")

BatteryWidget/SharedDefaults.swift hardcodes the same old group when reading it:

let appGroupIdentifier = "group.com.friend-app-with-wearable.ios12"

Please update both call sites to the new group group.dev.moni11811.omi (or better, share a single constant) so the dev target's code matches its entitlements.

P1: This global `minSdkVersion` bump from 29 to 31 drops support for Android 10 (API 29) and Android 11 (API 30). While the Meta Wearables DAT SDK requires API 31, a blanket app-level change affects all flavors and all existing users on those OS versions. Consider adding an explicit inline comment noting that the bump is intentional and linking to the release/product decision that approved this compatibility drop, or explore whether the new dependency can be gated so the core app remains installable on API 29/30. P1: The interactive device tutorial was previously gated to CV1 pendant devices using `DeviceUtils.isOmiCv1(...)`, but this PR removes that guard and broadens visibility to all `DeviceType.omi` variants. The onboarding flow itself (`InteractiveDeviceOnboardingWrapper`) contains CV1-specific hardware steps (single press, power cycle, double press config). Non-CV1 variants such as DevKit, Glass, and Neo will now see a tutorial describing incorrect button behavior, leading to a broken onboarding experience. Re-introduce the `DeviceUtils.isOmiCv1(...)` model/name check alongside `provider.connectedDevice?.type == DeviceType.omi`, or make the onboarding wrapper variant-aware before dropping the guard. P1: The dev release build registers the same custom URL scheme (`omi`) as the prod build. When both variants are installed side-by-side (they already have different bundle IDs), iOS will nondeterministically route `omi://` deep links or OAuth callbacks to either app. To keep auth callbacks reliable per flavor, consider using a dev-specific scheme such as `omidev` in the dev xcconfigs, or otherwise verify that the auth provider registers a distinct redirect URI for each build variant. P2: The `metaGlassesPendingPhotos` string should use `intl.Intl.pluralLogic` to handle Slovak pluralization, matching the pattern already used by `syncCardReadyCount` and `syncCardNeedsAttention` in this same file. A fixed form like '$count fotiek čaká na synchronizáciu' is grammatically incorrect for counts of 1 and the few range (2–4). P2: The ADTS frame parser doesn't validate that the computed `frameLength` is at least the minimum valid ADTS header size (7 bytes) before slicing the buffer. A corrupt packet with a valid sync word but zeroed length bits would set `frameLength = 0`, pass the length check, return an empty frame, and never advance the buffer — causing the parser to get permanently stuck on that header as new audio packets arrive. Consider adding a `frameLength >= 7` guard before the extraction block, or skip the sync bytes and `continue` to let the parser resync when the length is implausibly small. P2: Bee connections can take an extra 5s to report as connected when firmware doesn't answer, because `connect()` waits for `_queryFirmwareVersion()` and that helper waits for `sendFirmwareCommand()` to time out. This makes the new connection path unnecessarily slow on an otherwise healthy BLE link; fetching firmware asynchronously or outside the critical connect path would avoid the stall. P1: The `_getStoredDevice` refactor no longer falls back to the legacy `btDevice` field, but `device_provider.dart` still writes that field directly with `SharedPreferencesUtil().btDevice = pairedDevice!;`. When the `btDevices` list is non-empty, the legacy device is invisible to the new lookup, so background reconnect can fail for users whose latest paired state was written only to the legacy key. Consider preserving a fallback lookup to `btDevice` when `btDevices` does not contain the requested ID, or migrate the provider to use `btDeviceSet` / `btDeviceAdd` consistently. P2: Meta Wearables device-info fallbacks are skipped when fields are empty strings rather than exactly `'Unknown'`. If the device object is created from an empty constructor or prefs with blank values, `_getDeviceInfoFromMetaWearables()` leaves `modelNumber`, `hardwareRevision`, and `manufacturerName` blank instead of applying the DAT defaults, which leads to missing labels in diagnostics and UI. Consider treating empty strings the same as `'Unknown'` so the fallback always applies, or align this method with the other loaders by unconditionally setting the known defaults. P2: Onboarding navigation now has a stale back target: the new Find Devices step is inserted at index 8, but index 7 remains an empty placeholder. If the existing back handling still walks to the previous index, users can land on a blank screen instead of a meaningful step. P2: The newly added Meta glasses localization entries `metaGlassesOverheating` and `metaGlassesFolded` use Latin-script Serbian while the rest of the same feature block (and the intended `sr` locale) is Cyrillic. This will cause mixed-script rendering in the Meta glasses UI for Serbian users. These two strings should be translated into Cyrillic to match the surrounding entries like `metaGlassesCaptureFrequency` and `metaGlassesAutoCapture`. P1: The child `MemoryItem` widget now directly imports its parent page (`MemoriesPage`) and reaches into `MemoriesPageState` via `findAncestorStateOfType`, creating a circular import and tight UI-layer coupling. This makes the widget fragile and non-reusable outside the `MemoriesPage` context. Consider restoring the `onDeleteNotification` callback pattern that was previously in place instead of looking up ancestor state by type — that keeps the widget modular and avoids the circular dependency. P2: The `metaGlassesPendingPhotos` string renders broken Macedonian grammar when `count == 1` because it uses a fixed plural noun (`фотографии`) and plural verb (`чекаат`) instead of the singular forms (`фотографија`, `чека`). Other count-based methods in this localization class already use `intl.Intl.pluralLogic` for exactly this reason. Consider bringing this string in line with the existing plural-handling pattern so singular counts display correctly. P2: Audio packet parsing accepts any BLE payload >= 5 bytes instead of validating the expected 95-byte packet / 90-byte LC3 payload size, so malformed or misaligned notifications can be consumed as valid audio frames. P2: The `authenticate()` method reports success even when `launchUrl` fails because its boolean return value is ignored. `launchUrl` can return `false` without throwing (e.g., OS restriction, transient platform error, or user cancellation), yet the code unconditionally returns `true` afterward. This creates a false-success path where callers believe the auth URL was opened when it was not.

Consider propagating launchUrl's result so the method returns false when the URL could not be opened.


</details>

<sub>**Note:** This PR contains a large number of files. cubic only reviews up to 200 files per PR, so some files may not have been reviewed. cubic prioritizes the most important files to review.<br /><br />[Re-trigger cubic](https://www.cubic.dev/action/re-review/pr/BasedHardware/omi/9084/ai_pr_review_1783282261155_e4f57e57-f6b8-454a-95c2-e39ce754b12d?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F9084)</sub>

<!-- cubic:review-post:ai_pr_review_1783282261155_e4f57e57-f6b8-454a-95c2-e39ce754b12d:d4912bdfa1a6ec9971ebf97608b9d23cc3466ed5:930b8f26-7db0-46cf-8bfc-1e1131cb9d07 -->

<key>com.apple.security.application-groups</key>
<array>
<string>group.com.friend-app-with-wearable.ios12</string>
<string>group.dev.moni11811.omi</string>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: The dev profile app group was moved from group.com.friend-app-with-wearable.ios12 to group.dev.moni11811.omi, but the native code that uses the shared container still references the old identifier. Because iOS only allows access to app groups listed in the entitlements, dev builds will silently fail to read/write shared data.

Runner/AppDelegate.swift hardcodes the old group when writing battery info:

let defaults = UserDefaults(suiteName: "group.com.friend-app-with-wearable.ios12")

BatteryWidget/SharedDefaults.swift hardcodes the same old group when reading it:

let appGroupIdentifier = "group.com.friend-app-with-wearable.ios12"

Please update both call sites to the new group group.dev.moni11811.omi (or better, share a single constant) so the dev target's code matches its entitlements.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/ios/Runner/RunnerProfile-dev.entitlements, line 26:

<comment>The dev profile app group was moved from `group.com.friend-app-with-wearable.ios12` to `group.dev.moni11811.omi`, but the native code that uses the shared container still references the old identifier. Because iOS only allows access to app groups listed in the entitlements, dev builds will silently fail to read/write shared data.

`Runner/AppDelegate.swift` hardcodes the old group when writing battery info:
```swift
let defaults = UserDefaults(suiteName: "group.com.friend-app-with-wearable.ios12")

BatteryWidget/SharedDefaults.swift hardcodes the same old group when reading it:

let appGroupIdentifier = "group.com.friend-app-with-wearable.ios12"

Please update both call sites to the new group group.dev.moni11811.omi (or better, share a single constant) so the dev target's code matches its entitlements.

@@ -23,7 +23,7 @@ com.apple.security.application-groups - group.com.friend-app-with-wearable.ios12 + group.dev.moni11811.omi ```

Comment thread app/ios/Runner/Runner.entitlements Outdated
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.friend-app-with-wearable.ios12</string>
<string>group.dev.moni11811.omi</string>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: Changing the App Group entitlement identifier here introduces a runtime mismatch with the hardcoded group references in SharedDefaults.swift and AppDelegate.swift, which still use the old group.com.friend-app-with-wearable.ios12. The BatteryWidget extension entitlements already match the new group, so the main app and widget will share one container while the code tries to read/write another. UserDefaults(suiteName:) will return nil for a non-entitled suite, silently breaking the battery-widget shared-data path. You should either update the Swift code to match the new group (e.g., via a build-flavor-configurable constant), or keep the entitlement aligned with the existing hardcoded references.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/ios/Runner/Runner.entitlements, line 26:

<comment>Changing the App Group entitlement identifier here introduces a runtime mismatch with the hardcoded group references in `SharedDefaults.swift` and `AppDelegate.swift`, which still use the old `group.com.friend-app-with-wearable.ios12`. The BatteryWidget extension entitlements already match the new group, so the main app and widget will share one container while the code tries to read/write another. `UserDefaults(suiteName:)` will return `nil` for a non-entitled suite, silently breaking the battery-widget shared-data path. You should either update the Swift code to match the new group (e.g., via a build-flavor-configurable constant), or keep the entitlement aligned with the existing hardcoded references.</comment>

<file context>
@@ -23,7 +23,7 @@
 	<key>com.apple.security.application-groups</key>
 	<array>
-		<string>group.com.friend-app-with-wearable.ios12</string>
+		<string>group.dev.moni11811.omi</string>
 	</array>
 </dict>
</file context>


// Sign in buttons
if (Platform.isIOS || Platform.isAndroid) ...[
if (Env.appleSignInEnabled && (Platform.isIOS || Platform.isAndroid)) ...[

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: Apple sign-in availability is now gated by Env.appleSignInEnabled, which defaults to false in both dev_env.dart and prod_env.dart. If a release build does not explicitly set APPLE_SIGN_IN_ENABLED=true in its .env flavor, the Apple sign-in button will silently disappear for iOS/Android users even though the underlying onAppleSignIn auth logic remains intact. Consider confirming that all production flavor .env files set this variable to true (if Apple auth is intended to remain available), or add an explicit assertion/fallback so the missing config is surfaced at build time rather than silently disabling a user-facing auth path.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/lib/pages/onboarding/auth.dart, line 74:

<comment>Apple sign-in availability is now gated by `Env.appleSignInEnabled`, which defaults to `false` in both `dev_env.dart` and `prod_env.dart`. If a release build does not explicitly set `APPLE_SIGN_IN_ENABLED=true` in its `.env` flavor, the Apple sign-in button will silently disappear for iOS/Android users even though the underlying `onAppleSignIn` auth logic remains intact. Consider confirming that all production flavor `.env` files set this variable to `true` (if Apple auth is intended to remain available), or add an explicit assertion/fallback so the missing config is surfaced at build time rather than silently disabling a user-facing auth path.</comment>

<file context>
@@ -70,7 +71,7 @@ class _AuthComponentState extends State<AuthComponent> {
 
                     // Sign in buttons
-                    if (Platform.isIOS || Platform.isAndroid) ...[
+                    if (Env.appleSignInEnabled && (Platform.isIOS || Platform.isAndroid)) ...[
                       SizedBox(
                         width: double.infinity,
</file context>

<key>com.apple.security.application-groups</key>
<array>
<string>group.com.friend-app-with-wearable.ios12</string>
<string>group.dev.moni11811.omi</string>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: The BatteryWidget entitlement App Group was changed to group.dev.moni11811.omi, a developer-specific identifier. Since the widget has only a single entitlement file, this affects all build flavors. The prod Runner entitlements still use group.com.friend-app-with-wearable.ios12, which will break shared-container communication between the widget and main app in prod builds. Additionally, BatteryWidget/SharedDefaults.swift and Runner/AppDelegate.swift still hardcode the old App Group ID, so the code will attempt to access a UserDefaults suite that no longer matches the widget entitlement. Consider reverting this to the production App Group or adding dev/prod widget entitlement variants and updating the corresponding hardcoded references.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/ios/BatteryWidget/BatteryWidget.entitlements, line 7:

<comment>The BatteryWidget entitlement App Group was changed to `group.dev.moni11811.omi`, a developer-specific identifier. Since the widget has only a single entitlement file, this affects all build flavors. The prod Runner entitlements still use `group.com.friend-app-with-wearable.ios12`, which will break shared-container communication between the widget and main app in prod builds. Additionally, `BatteryWidget/SharedDefaults.swift` and `Runner/AppDelegate.swift` still hardcode the old App Group ID, so the code will attempt to access a UserDefaults suite that no longer matches the widget entitlement. Consider reverting this to the production App Group or adding dev/prod widget entitlement variants and updating the corresponding hardcoded references.</comment>

<file context>
@@ -4,7 +4,7 @@
 	<key>com.apple.security.application-groups</key>
 	<array>
-		<string>group.com.friend-app-with-wearable.ios12</string>
+		<string>group.dev.moni11811.omi</string>
 	</array>
 </dict>
</file context>

val prefs = applicationContext.getSharedPreferences("ble_config", Context.MODE_PRIVATE)
if (prefs.getBoolean("user_disconnected", false)) return

val saved = prefs.getString("managed_device", null)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: The companion-service autostart path is still starting from any appeared association. managed_device only influences requiresBond; it does not block startService() when the appeared address is different from the configured device. That can reconnect the wrong BLE device if multiple associations exist.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/android/app/src/main/kotlin/com/friend/ios/BleCompanionService.kt, line 49:

<comment>The companion-service autostart path is still starting from any appeared association. `managed_device` only influences `requiresBond`; it does not block `startService()` when the appeared address is different from the configured device. That can reconnect the wrong BLE device if multiple associations exist.</comment>

<file context>
@@ -0,0 +1,136 @@
+        val prefs = applicationContext.getSharedPreferences("ble_config", Context.MODE_PRIVATE)
+        if (prefs.getBoolean("user_disconnected", false)) return
+
+        val saved = prefs.getString("managed_device", null)
+        val requiresBond = if (saved != null) {
+            val parts = saved.split("|")
</file context>

Comment thread app/lib/l10n/app_da.arb
"myDevices": "Mine enheder",
"metaGlassesAutoCapture": "Automatisk optagelse ved forbindelse",
"metaGlassesShowPreview": "Live-forhåndsvisning",
"metaGlassesPendingPhotos": "{count} billeder venter på synkronisering",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: The metaGlassesPendingPhotos Danish translation uses a plain {count} placeholder and always renders the plural noun form billeder. When exactly one photo is pending, the UI will show the grammatically incorrect "1 billeder venter på synkronisering" instead of "1 billede venter på synkronisering". Other count-sensitive strings in this same Danish ARB file already use ICU plural formatting (e.g. nConversationsCreated), so this entry should follow the same pattern for correct Danish grammar at all counts.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/lib/l10n/app_da.arb, line 3132:

<comment>The `metaGlassesPendingPhotos` Danish translation uses a plain `{count}` placeholder and always renders the plural noun form `billeder`. When exactly one photo is pending, the UI will show the grammatically incorrect "1 billeder venter på synkronisering" instead of "1 billede venter på synkronisering". Other count-sensitive strings in this same Danish ARB file already use ICU plural formatting (e.g. `nConversationsCreated`), so this entry should follow the same pattern for correct Danish grammar at all counts.</comment>

<file context>
@@ -3113,17 +3113,33 @@
+    "myDevices": "Mine enheder",
+    "metaGlassesAutoCapture": "Automatisk optagelse ved forbindelse",
+    "metaGlassesShowPreview": "Live-forhåndsvisning",
+    "metaGlassesPendingPhotos": "{count} billeder venter på synkronisering",
+    "metaGlassesPairInMetaAI": "Konfigurer i Meta AI-appen",
+    "metaGlassesTypeRayBanMeta": "Ray-Ban Meta",
</file context>
Suggested change
"metaGlassesPendingPhotos": "{count} billeder venter på synkronisering",
"metaGlassesPendingPhotos": "{count, plural, =1{1 billede venter på synkronisering} other{{count} billeder venter på synkronisering}}",

String get metaGlassesTypeOakleyMeta => 'Oakley Meta';

@override
String get metaGlassesOverheating => 'Naočare se hlade — snimanje je pauzirano';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: The newly added Meta glasses localization entries metaGlassesOverheating and metaGlassesFolded use Latin-script Serbian while the rest of the same feature block (and the intended sr locale) is Cyrillic. This will cause mixed-script rendering in the Meta glasses UI for Serbian users. These two strings should be translated into Cyrillic to match the surrounding entries like metaGlassesCaptureFrequency and metaGlassesAutoCapture.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/lib/l10n/app_localizations_sr.dart, line 9572:

<comment>The newly added Meta glasses localization entries `metaGlassesOverheating` and `metaGlassesFolded` use Latin-script Serbian while the rest of the same feature block (and the intended `sr` locale) is Cyrillic. This will cause mixed-script rendering in the Meta glasses UI for Serbian users. These two strings should be translated into Cyrillic to match the surrounding entries like `metaGlassesCaptureFrequency` and `metaGlassesAutoCapture`.</comment>

<file context>
@@ -9502,24 +9502,93 @@ class AppLocalizationsSr extends AppLocalizations {
+  String get metaGlassesTypeOakleyMeta => 'Oakley Meta';
+
+  @override
+  String get metaGlassesOverheating => 'Naočare se hlade — snimanje je pauzirano';
+
+  @override
</file context>

@moni11811 moni11811 changed the title feat(app): add Meta Wearables glasses integration feat(app): add Meta Wearables integration and supporting fork updates Jul 5, 2026
@Git-on-my-level Git-on-my-level added needs-maintainer-review Needs a human maintainer to sign off before merge needs-scope-reduction PR scope should be reduced or split dependency-review Touches dependencies or lockfiles; needs dependency review security-review Touches auth, provider routing, secrets, or security-sensitive surfaces workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior docs-accuracy Documentation or committed reports need accuracy fixes feature-fit-review Needs review of product/feature direction with Omi mission/vision needs-tests PR introduces logic that should be covered by tests labels Jul 5, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks for opening this and for clearly marking it as draft. I’m not going to approve or request formal changes on a draft of this size, but this needs substantial maintainer/product review before it can move toward merge.

Key maintainer concerns:

  • Scope: this is a very broad fork sync rather than a reviewable Meta Wearables integration slice (500 files / ~58k changed lines in the current context, spanning app code, native bridges, vendored plugin code, generated localization, docs, scripts, signing helpers, and unrelated device/service refactors). Please split into smaller PRs with one user-visible outcome per PR.
  • Security/dependency/workflow surface: the PR adds a vendored third-party Flutter plugin, Meta GitHub Packages Maven access requiring a PAT, native iOS/Android BLE/audio/background-service code, signing/build scripts, and dependency/build-system changes. Those need dedicated dependency/security review and should not be mixed with product UI or unrelated fork updates.
  • Environment and private-local assumptions: several changes appear tied to a contributor/local setup, e.g. dev.moni11811.omi, EddyPhone, hard-coded device/provisioning/signing identifiers, and .dev.env/API base behavior. Those should not land in the shared app as-is.
  • Test/build concern: app/test.sh now unconditionally writes API_BASE_URL=https://api.omiapi.com/, removing the previous override/blank behavior. That risks tests hitting a real/prod-like API and conflicts with the new launch gate expecting https://api.omi.me/.
  • Docs accuracy/noise: the PR adds large agent execution plans and local handoff/proof docs. Some may be useful as implementation notes, but they are not narrow maintainer docs and include local device details. Please convert only the stable, source-backed docs into repo docs and keep ephemeral agent plans out of the merge.
  • Agent behavior impact: this PR changes agent-facing instructions (AGENTS.md, app/AGENTS.md, app/third_party/.../AGENTS.md, and plan docs). Notably, the root AGENTS.md removes backend import-purity/test-isolation safeguards, while app/third-party docs add new agent constraints and even shell-install guidance. That can change how AI coding/review agents operate in this repo, so a human maintainer should explicitly review and accept/reject those instruction changes separately.

Suggested path:

  1. Keep this draft as a staging/reference PR if helpful.
  2. Open a first clean PR with only the minimal Meta Wearables app/provider/service interface plus focused tests, no vendored/generated/local-proof churn.
  3. Open separate follow-ups for native iOS bridge, Android bridge, dependency/vendor introduction, docs, and any device-service refactors.
  4. Remove local/private identifiers and avoid changes that cause tests or default dev flows to point at live production-like APIs.

I’ve labeled this for maintainer, scope, dependency/security/workflow, docs, feature-fit, and tests review rather than treating it as merge-ready.

@moni11811

Copy link
Copy Markdown
Contributor Author

Thanks for opening this and for clearly marking it as draft. I’m not going to approve or request formal changes on a draft of this size, but this needs substantial maintainer/product review before it can move toward merge.

Key maintainer concerns:

  • Scope: this is a very broad fork sync rather than a reviewable Meta Wearables integration slice (500 files / ~58k changed lines in the current context, spanning app code, native bridges, vendored plugin code, generated localization, docs, scripts, signing helpers, and unrelated device/service refactors). Please split into smaller PRs with one user-visible outcome per PR.
  • Security/dependency/workflow surface: the PR adds a vendored third-party Flutter plugin, Meta GitHub Packages Maven access requiring a PAT, native iOS/Android BLE/audio/background-service code, signing/build scripts, and dependency/build-system changes. Those need dedicated dependency/security review and should not be mixed with product UI or unrelated fork updates.
  • Environment and private-local assumptions: several changes appear tied to a contributor/local setup, e.g. dev.moni11811.omi, EddyPhone, hard-coded device/provisioning/signing identifiers, and .dev.env/API base behavior. Those should not land in the shared app as-is.
  • Test/build concern: app/test.sh now unconditionally writes API_BASE_URL=https://api.omiapi.com/, removing the previous override/blank behavior. That risks tests hitting a real/prod-like API and conflicts with the new launch gate expecting https://api.omi.me/.
  • Docs accuracy/noise: the PR adds large agent execution plans and local handoff/proof docs. Some may be useful as implementation notes, but they are not narrow maintainer docs and include local device details. Please convert only the stable, source-backed docs into repo docs and keep ephemeral agent plans out of the merge.
  • Agent behavior impact: this PR changes agent-facing instructions (AGENTS.md, app/AGENTS.md, app/third_party/.../AGENTS.md, and plan docs). Notably, the root AGENTS.md removes backend import-purity/test-isolation safeguards, while app/third-party docs add new agent constraints and even shell-install guidance. That can change how AI coding/review agents operate in this repo, so a human maintainer should explicitly review and accept/reject those instruction changes separately.

Suggested path:

  1. Keep this draft as a staging/reference PR if helpful.
  2. Open a first clean PR with only the minimal Meta Wearables app/provider/service interface plus focused tests, no vendored/generated/local-proof churn.
  3. Open separate follow-ups for native iOS bridge, Android bridge, dependency/vendor introduction, docs, and any device-service refactors.
  4. Remove local/private identifiers and avoid changes that cause tests or default dev flows to point at live production-like APIs.

I’ve labeled this for maintainer, scope, dependency/security/workflow, docs, feature-fit, and tests review rather than treating it as merge-ready.

Thanks for taking a look and for the detailed review. That all makes sense.

This PR is still very much a WIP/staging PR, not something I consider merge-ready. I had put the work on hold last month and recently picked it back up; unfortunately, a lot of the progress happened locally and the branch accumulated more noise than I intended. Some of the agent-generated planning/proof files and local setup details should definitely not land as-is.

I agree with the suggested path. I’ll keep this draft as a reference/staging branch and start carving out smaller, reviewable PRs with a single user-visible outcome per PR. The first one will focus on the minimal Meta Wearables app/provider/service interface with focused tests, without the vendored/generated/local-proof churn.

I’ll also separate the native bridge work, dependency/vendor changes, docs, agent-instruction changes, and device/service refactors into their own follow-ups so they can get the right maintainer/security/workflow review.

A few of these cleanup items are already in progress, but I appreciate the clear breakdown — it helps align the work with how it should move toward merge.

Meta Wearables DAT v0.8 integration: vendored Flutter plugin, background-
safe native frame capture, capture modes (Camera+Mic / Mic only), photo
ingestion + glasses BT-mic audio over the transcription socket, media-
remote tap gestures, stream watchdog with per-session backoff and
suspension-safe recovery, iOS legacy-lifecycle launch hardening, and
focused regression/contract tests.

Staging/reference branch per maintainer guidance; smaller single-outcome
PRs will be carved from it. History rewritten to a single snapshot to
remove agent working docs and local device/provisioning identifiers that
should never have been pushed.

Co-Authored-By: Claude Fable 5 <[email protected]>
@moni11811
moni11811 force-pushed the omi4meta-meta-glasses-integration branch from 302b106 to 2d5588a Compare July 6, 2026 03:27
…yWith null-clear

Addresses three review threads:
- enqueue no longer orphans the frame JPEG when the ledger append fails
  (frame file is deleted before rethrowing).
- append-only queue/uploaded ledgers now compact once uploads accumulate
  (atomic rewrite keeping only pending entries; threshold configurable).
- MetaCaptureDiagnostics.copyWith uses an unset sentinel so nullable
  fields can be explicitly cleared back to null.

All behavior covered by new unit tests (41 green across the meta suites).

Co-Authored-By: Claude Fable 5 <[email protected]>
undivisible added a commit that referenced this pull request Jul 24, 2026
Theory
Multi-device support failed because the app persisted one active BLE
device and the onboarding scanner rendered only live scan results. A
second saved device displaced the first, and offline saved devices
disappeared from the connect flow.

Scope
- Adds `SharedPreferencesUtil.btDevices` list storage with legacy
`btDevice` fallback.
- Keeps `btDeviceSet` updating active device while preserving unique
saved devices.
- Adds `OnboardingProvider.savedDeviceList` and `visibleDeviceList`.
- Updates Find Devices UI to render saved offline devices and replace
them with live scan data when seen.

Cut from #9084
- Meta glasses provider/page/runtime.
- On-device transcription.
- Android/iOS native recording churn.
- Docs/plugin examples/auth changes.

Tests
- Red first: `flutter test
test/providers/onboarding_provider_multi_device_test.dart` failed on
missing `btDevices`, `savedDeviceList`, and `visibleDeviceList`.
- Green: `flutter test
test/providers/onboarding_provider_multi_device_test.dart`.
- Green: `dart analyze lib/backend/preferences.dart
lib/providers/onboarding_provider.dart
lib/pages/onboarding/find_device/found_devices.dart
test/providers/onboarding_provider_multi_device_test.dart`.

Notes
- Draft PR. Surgical generic multi-device persistence/UI slice of #9084.
- Low overlap with #9181; this branch does not touch
`app/lib/pages/home/page.dart`.

<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/9311?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
@undivisible undivisible added the human Human-authored pull request label Aug 10, 2026
@undivisible undivisible added app flutter flutter work mobile docs-tooling Layer: Documentation, examples, dev tools privacy-review Touches user-data persistence, permissions, or privacy-sensitive surfaces labels Aug 10, 2026
@aryanorastar

Copy link
Copy Markdown
Collaborator

Closing as a maintainer.

This is still a draft fork sync on bf77f23 (Jul 12): 606 files, CONFLICTING against current main, 0 checks. Git-on-my-level already said it was not reviewable as one PR (local identifiers, GitHub Packages PAT, AGENTS.md edits, test.sh writing a live API base). The author agreed and asked to keep it as staging while carving smaller PRs.

Those carves already happened: #9311 and #9312 merged; the glasses runtime slice #9310 is closed. Landing this remaining dump would fight current main, not compose with it.

#4369 stays open. A new Meta path needs Meta-only scope, a locked DAT revision, and on-device smoke — not this branch.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @moni11811 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community!

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

Labels

app dependency-review Touches dependencies or lockfiles; needs dependency review docs-accuracy Documentation or committed reports need accuracy fixes docs-tooling Layer: Documentation, examples, dev tools feature-fit-review Needs review of product/feature direction with Omi mission/vision flutter flutter work human Human-authored pull request mobile needs-maintainer-review Needs a human maintainer to sign off before merge needs-scope-reduction PR scope should be reduced or split needs-tests PR introduces logic that should be covered by tests privacy-review Touches user-data persistence, permissions, or privacy-sensitive surfaces security-review Touches auth, provider routing, secrets, or security-sensitive surfaces workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants