feat(frontend): integrate connected app flows - #134
Conversation
| export class ExpoLocationProvider implements LocationProvider { | ||
| constructor( | ||
| private readonly module: ExpoLocationModule | null = requireOptionalNativeModule<ExpoLocationModule>( | ||
| 'ExpoLocation', |
There was a problem hiding this comment.
[P1] Add expo-location or inject a provider in the production composition root. createLocationProvider() is used by AppShell without an injection, but expo-location is not a dependency in frontend/package.json or package-lock.json; on native builds requireOptionalNativeModule('ExpoLocation') therefore returns null and every location reminder tick fails with ExpoLocation 原生模块未链接.
|
|
||
| /** | ||
| * 地点提醒位置上报器:客户端只上报位置,触发判定留给服务端。 | ||
| * 当前 timer 是前台轮询;后台 task/围栏应由宿主注入更合适的 provider。 |
There was a problem hiding this comment.
[P1] Provide a background-capable location task/geofence path before relying on location reminders. This implementation only polls with a JS setInterval; once the app is backgrounded or suspended, tick() stops running, so the server receives no position reports and cannot trigger location schedules. The app config requests background location, but no background task is registered here.
| ); | ||
|
|
||
| alarms.add(record); | ||
| saveAlarms(context, alarms); |
There was a problem hiding this comment.
[P1] Reschedule persisted alarms after device reboot. AlarmManager alarms are cleared by Android on reboot, and this branch only writes the records to SharedPreferences; there is no BOOT_COMPLETED permission/receiver or other startup rebuild that reads them. Every future alarm silently disappears after a reboot.
| time_triggered_at: existing?.time_triggered_at ?? null, | ||
| geo_triggered_at: existing?.geo_triggered_at ?? null, | ||
| system_schedule_ref_id: | ||
| input.systemScheduleRefId !== undefined |
There was a problem hiding this comment.
[P1] Do not treat the locally-created Android alarm ID as durable schedule state. systemScheduleRefId is assigned only to the in-memory entity after the server upsert; the upsert payload never sends it, and a later bootstrap/push returns the backend's null ref. After relaunch or resync, editing/deleting the schedule passes previousAlarmId: null, leaving the old native alarm active and allowing duplicate/stale alarms.
| } | ||
|
|
||
| const application = AndroidConfig.Manifest.getMainApplicationOrThrow(manifest); | ||
| application.$['android:usesCleartextTraffic'] = 'true'; |
There was a problem hiding this comment.
[P1] Avoid enabling cleartext traffic for every release build. This app-wide manifest flag permits any HTTP/ws:// endpoint, so schedule and voice data can be sent without transport encryption if the configured URL is changed or redirected. Scope cleartext to a debug/dev network-security config, and require wss:// for production instead of weakening the whole application.
Summary
Why
The preceding PRs intentionally introduce isolated capabilities. This PR performs the application-level dependency injection so the production entry point uses the real transport, schedule service, assistant recorder, system alarms, and in-app dialogs together.
Dependency