Skip to content

chore: support Unity 2022.3 across SDK and demo#886

Merged
fadi-george merged 5 commits into
mainfrom
fg/unity-2022-support
Jul 13, 2026
Merged

chore: support Unity 2022.3 across SDK and demo#886
fadi-george merged 5 commits into
mainfrom
fg/unity-2022-support

Conversation

@fadi-george

Copy link
Copy Markdown
Collaborator

Description

One Line Summary

Restore Unity 2022.3 as the minimum supported version and let the demo open and build cleanly across Unity 2022.3 and Unity 6.

Details

Motivation

The demo project and SDK editor tooling had drifted to require Unity 6-only APIs and modules (UnityEngine.Accessibility, TextField.textEdition.placeholder), which broke opening/building the project on Unity 2022.3. This PR lowers the documented minimum back to Unity 2022.3 and guards the version-specific code so the same project works on both Unity 2022.3 and Unity 6.

Scope

  • Docs / requirements: Bump the minimum Unity version from 2021.3 to 2022.3 in README.md and the demo README.md files.
  • Editor dependency generation: OneSignalAndroidDependencies and OneSignaliOSDependencies now skip initialization inside the asset import worker process (AssetDatabase.IsAssetImportWorkerProcess()), avoiding redundant/erroneous dependency writes during imports on newer Unity.
  • File inventory: OneSignalFileInventory.GetCurrentPaths() excludes the generated Android/iOS dependency XML (and .meta) files so generated artifacts aren't tracked as package assets.
  • Demo UI compatibility: Placeholder text is now set through a SetPlaceholder helper guarded by UNITY_2023_1_OR_NEWER, since TextField.textEdition.placeholder does not exist on Unity 2022.3. Updated across DialogBase, MultiPairInputDialog, OutcomeDialog, and TrackEventDialog.
  • Accessibility: AccessibilityBridge is compiled only under UNITY_2023_2_OR_NEWER && ONESIGNAL_E2E_ACCESSIBILITY, with no-op fallbacks otherwise, because UnityEngine.Accessibility is not available on Unity 2022.3. The com.unity.modules.accessibility module is removed from the demo manifest.json/packages-lock.json and instead injected only during E2E via the workflow.
  • CI: The E2E workflow enables the accessibility module and ONESIGNAL_E2E_ACCESSIBILITY define at build time, pins unityVersion to 6000.4.11f1, and includes Assets/csc.rsp in the Library cache keys.

Testing

Manual testing

The demo can now be opened directly in both Unity 2022.3 and Unity 6. The E2E workflow enables Unity 6's Accessibility module only for automated builds because that module is not available in Unity 2022.3.

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
Open in Web Open in Cursor 

fadi-george and others added 4 commits July 9, 2026 18:46
Guard APIs unavailable in Unity 2022 and provide a launcher that temporarily disables the newer accessibility module while preserving Unity 6 E2E behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the accessibility module CI-only so Unity 2022 and Unity 6 can both resolve the committed project without swapping manifests.

Co-authored-by: Cursor <cursoragent@cursor.com>
@fadi-george fadi-george marked this pull request as ready for review July 10, 2026 17:10
@fadi-george fadi-george requested a review from a team as a code owner July 10, 2026 17:10
Comment thread README.md
- A [OneSignal Account](https://app.onesignal.com/signup) if you do not already have one
- Your OneSignal App ID which you can find under **Settings > Keys & IDs**
- Unity 2021.3 or newer
- Unity 2022.3 or newer

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.

Do we need to change this in the 3 package.json files?

 "unity": "2021.3",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good catch — yes, the "unity" field declares each package's minimum supported version, so it should match. Bumped "unity": "2021.3""2022.3" in all three package manifests (com.onesignal.unity.core, com.onesignal.unity.android, com.onesignal.unity.ios) in 79dce4a.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

Co-authored-by: Fadi George <fadi-george@users.noreply.github.com>
@fadi-george fadi-george requested a review from nan-li July 13, 2026 18:00
@fadi-george fadi-george merged commit 97ec481 into main Jul 13, 2026
4 checks passed
@fadi-george fadi-george deleted the fg/unity-2022-support branch July 13, 2026 18:35
@fadi-george fadi-george changed the title Support Unity 2022.3 across SDK and demo chore: support Unity 2022.3 across SDK and demo Jul 13, 2026
fadi-george added a commit that referenced this pull request Jul 13, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Fadi George <fadi-george@users.noreply.github.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.

4 participants