Repository navigation
feat: add Google sign-in and FCM push for the Android client - #6
Open
Frekion2002 wants to merge 11 commits into
Open
Frekion2002 wants to merge 11 commits into
Frekion2002 wants to merge 11 commits into
Conversation
Mirror the Apple login flow: a one-time server nonce challenge, Google ID token verification against Google's JWKS (both issuer spellings, audience = Web OAuth client ID), and users.google_subject. GOOGLE_CLIENT_ID left empty keeps both endpoints at 503. Migration 0011 adds the column and the google_login_challenges table.
Devices registered with platform=ANDROID now receive the incoming-call and report-ready signals as FCM HTTP v1 data messages. The access token is minted from a Firebase service account (FCM_SERVICE_ACCOUNT_PATH) and reused; unset keeps Android delivery disabled. iOS delivery is unchanged.
- An empty FCM_SERVICE_ACCOUNT_PATH (compose default) means unset instead of
Path('.') crashing the whole backend on start.
- Without FCM, Android rows are left out of report delivery, and report
retries skip devices that already received the notification.
- The callee receiver check accepts Android devices when FCM is configured.
- Only UNREGISTERED or an INVALID_ARGUMENT naming message.token counts as a
dead token, and clearing it touches that device row only.
- A 401 drops the cached access token; token_uri must be Google's.
- Report messages collapse per call; service-account JSON is git-ignored.
The compose files passed FCM_SERVICE_ACCOUNT_PATH through as a raw path but mounted no key file, so a host path in the deploy env made AppContainer fail at startup and took the API down for every client. Mount FCM_KEY_FILE like the APNs key and fill the container path only when it is set; when it is empty, /dev/null is mounted and Android push stays off.
Android also requests question audio from ElevenLabs directly and signs in with Google, so the iPhone-only wording was not true for Android users. Say phone instead of iPhone, name both login tokens, and bump the document version so the change is recorded as a new consent.
pyjwt 2.15.1, aiohttp 3.14.5, urllib3 2.8.0, certifi 2026.10.23 and multidict 6.9.1 (kept on 6.x). pip-audit reports none afterwards.
Collaborator
Author
Local end-to-end test and follow-up commits (2026-10-26)Tested locally (this branch + local LiveKit + Android emulator and an Android phone on the same Wi-Fi): Commits added since
Please note when merging/deploying
|
The final Figma asks for 건망증 · 호흡기 질환 · 비염 plus a free-text "추가적으로 걱정되는 부분". Health profiles now accept FORGETFULNESS, RESPIRATORY and RHINITIS alongside the earlier codes (the iOS app still sends those) and store an optional `concerns` note of up to 500 chars. - Migration 0012 adds parent_profiles.concerns. - PUT keeps the stored note when a client sends only conditions. - Daily question pools for the three new conditions use open questions, as docs/profile-question-report-design.md §5 asks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the server side of the Android client (Collog-App/Collog-Android).
Google sign-in:
/v1/auth/google/challengeand/v1/auth/googlefollow the Apple flow. The server issues a one-time nonce, and the ID token is checked against Google's JWKS (both issuers,aud=GOOGLE_CLIENT_ID, nonce). Accounts are found by the newusers.google_subject. Someone who signs up with Apple on iOS and with Google on Android gets two accounts; they are not merged. Google accounts are deleted without re-authentication, like OTP accounts.FCM: Android devices register with
platform=ANDROIDand one FCM token fortoken,voipTokenandpushToken. Incoming calls and report notifications go out as FCM HTTP v1 data messages signed with a Firebase service account. The payload has the same fields as the APNs push, with no health data and no LiveKit credentials. A stored token is cleared only onUNREGISTERED, orINVALID_ARGUMENTthat namesmessage.token, and only on that device row.Deploying with both settings empty is safe. The Google endpoints return 503, Android devices do not count as call receivers, and report notifications skip them. iOS behaves as before, except that a report retry within the same process no longer resends to devices that already received it.
Merging runs migration 0011, which only adds: a nullable
users.google_subjectwith a unique index, and agoogle_login_challengestable.To turn Android on in production, set
GOOGLE_CLIENT_ID, put the service account JSON on the host with a read-only bind like the APNs key, and setFCM_SERVICE_ACCOUNT_PATHto the path inside the container. The compose files do not have that bind yet.uv run pytest: 304 passed.ruff check: clean.