镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

chore: [SDK-5687] enable Firebase Installation IDs in demo app - #2836

Merged
fadi-george merged 7 commits into
mainfrom
fadi/sdk-5687
Nov 9, 2026
Merged

fadi-george merged 7 commits into
mainfrom
fadi/sdk-5687

Conversation

@fadi-george

@fadi-george fadi-george commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Description

One Line Summary

Enable Firebase Installation ID registration in the demo app and rename its gms package to com.onesignal.sdkdemo.

Details

Motivation

The demo should exercise FID registration end to end, and share one Firebase/OneSignal package (com.onesignal.sdkdemo) across SDK demos.

Scope

Demo app and CI only. No SDK changes.

  • gms manifest: firebase_messaging_installation_id_enabled = true.
  • gms: firebase-messaging:25.1.2 and minSdk 23 (25.x requires it). Huawei unchanged (minSdk 21, com.onesignal.example, since its agconnect config is tied to that package).
  • gms applicationId → com.onesignal.sdkdemo. ADM permission/category now use ${applicationId}.
  • Retry scripts and build.md updated for the new package.
  • CI: setup-demo writes google-services.json from the APPIUM_GOOGLE_SERVICES_JSON secret via the shared setup-google-services action. google-services.json stays gitignored.
  • e2e passes bundle-id: com.onesignal.sdkdemo to the shared Appium workflow (the shared default stays com.onesignal.example until every SDK migrates).
  • Removed the built-in default OneSignal app ID. ONESIGNAL_APP_ID is now required (local.properties or -P); preBuild fails with a clear message if unset. IDE sync, spotless, and detekt still work without it. CI demo builds pass a placeholder app ID.
  • CI builds gms and huawei demo variants in separate Gradle runs: the Huawei plugin applies to every variant when any Huawei task runs, and its committed config only matches com.onesignal.example.

Depends on OneSignal/sdk-shared#69 and the APPIUM_GOOGLE_SERVICES_JSON org secret. Merge after both.

Testing

Unit testing

None; config-only.

Manual testing

Built assembleGmsDebug, assembleGmsRelease, and assembleHuaweiDebug from OneSignalSDK/ with -PSDK_VERSION=5.11.0. Verified a build without ONESIGNAL_APP_ID fails at :app:preBuild with the expected message, and spotless/detekt pass without it. Verified merged gms manifest has package com.onesignal.sdkdemo, FID flag true, and ADM entries using the new package; firebase-messaging resolves to 25.1.2; google-services plugin generates gcm_defaultSenderId. Not run on a device.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

📊 Diff Coverage Report

✓ Coverage check passed (no source files changed)

📥 View workflow run

fadi-george and others added 3 commits November 8, 2026 13:49
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Also build the gms and huawei demo variants in separate Gradle runs in CI,
since the Huawei plugin's config only matches the huawei applicationId.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@abdulraqeeb33 abdulraqeeb33 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two configuration holes in the demo Installation ID switch. Details are on the manifest flag and the gms applicationId.

Nits:

  • examples/build.md:126 and .github/actions/setup-demo/action.yml:40-42 still say ONESIGNAL_APP_ID resolves through a built-in default. preBuild and examples/build.md:30 require the id and fail the build when it is unset.
  • examples/demo/GettingStarted.md:12 still lists API 21 as the minimum device. The gms flavor is minSdk 23. Huawei stays on 21.
  • examples/demo/scripts/retry/README.md step 2 runs ./retry-test.sh install with no app id. cmd_install passes -PONESIGNAL_APP_ID only when RETRY_TEST_IV_APP_ID is set, so a fresh checkout fails at :app:preBuild. The Gradle message names the fix. Add the requirement to that setup list. The uninstall line names com.onesignal.sdkdemo only, so an existing com.onesignal.example gms install stays on the device as a second app.

The preBuild app-id check, the ${applicationId} ADM entries, and the split gms/Huawei Gradle runs for agconnect look right.

Comment thread examples/demo/app/build.gradle.kts Resolved
Turn firebase_messaging_installation_id_enabled on only when
google-services.json exists, skip the Google Services plugin for
Huawei-only runs, and fix stale docs (app ID default, gms minSdk,
retry setup).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fadi-george

Copy link
Copy Markdown
Contributor Author

Nits fixed in 3aa0a90: build.md and the setup-demo comment note ONESIGNAL_APP_ID has no default, GettingStarted lists API 23 for gms and 21 for huawei, and the retry README now requires an app ID and mentions uninstalling the old com.onesignal.example install.

@abdulraqeeb33 abdulraqeeb33 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Both fixed in 3aa0a90.

  1. The Installation ID flag is on only when google-services.json exists, so an unconfigured gms build keeps the legacy token.
  2. The Google Services plugin is skipped for Huawei-only Gradle runs. assembleHuaweiDebug with a sdkdemo-only json is the case that was failing.

./gradlew build and assemble (no flavor in the task name) still apply the plugin, so that same json fails the Huawei variant. The split CI invocations avoid it.

The required checks on this commit are red because code-quality and demo-build came back abandoned, and the lint workflow recorded no jobs. test passed. Worth a rerun before merge.

fadi-george and others added 2 commits November 9, 2026 11:07
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants