Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
bc83db7
chore: Release 5.3.5 (#898)
onesignal-deploy Sep 19, 2026
84cd3ae
chore: Release 5.3.6 (#900)
onesignal-deploy Sep 22, 2026
0e5cf6b
chore: [SDK-5280] raise minimum iOS version to 15 (#899)
nan-li Sep 22, 2026
234bd10
chore: Release 5.4.0 (#902)
onesignal-deploy Sep 23, 2026
3bb2663
ci: remove redundant Maven Central wait from e2e
fadi-george Oct 2, 2026
14ae7dd
fix: [SDK-5335] validate public API inputs to prevent native crashes …
abdulraqeeb33 Oct 3, 2026
8f160fd
chore: Release 5.4.1 (#903)
onesignal-deploy Oct 23, 2026
1ce8f50
chore: [SDK-5531] add sticky log view to demo app (#905)
fadi-george Oct 26, 2026
5302289
chore: [SDK-5613] standardize push subscription UI in the demo app (#…
fadi-george Oct 28, 2026
bba4eef
chore: Release 5.4.2 (#907)
onesignal-deploy Oct 29, 2026
3b71dd8
chore: [SDK-5641] add extra IAM type buttons to demo app (#908)
fadi-george Oct 30, 2026
862aa29
docs: rewrite Unity demo README with setup steps
fadi-george Nov 4, 2026
42693f7
fix: [SDK-5671] add missing InputGuard.cs.meta to core package (#910)
fadi-george Nov 5, 2026
3f093b9
ci: auto-detect version in create release PR workflow
fadi-george Nov 5, 2026
f016094
chore: Release 5.4.3 (#911)
onesignal-deploy Nov 5, 2026
cd0aaae
chore: Release 5.4.4 (#913)
onesignal-deploy Nov 7, 2026
6c92374
chore: [SDK-5693] enable Firebase Installation IDs in demo app (#914)
fadi-george Nov 11, 2026
26704f4
chore: [SDK-5741] run push E2E with Firebase Installation IDs off (#915)
fadi-george Nov 11, 2026
587f665
ci: label E2E Android builds with FID on/off
fadi-george Nov 11, 2026
4f19b45
chore: [SDK-5593] sign demos with enterprise team and sdkdemo IDs (#916)
fadi-george Nov 18, 2026
74ebefe
chore: [SDK-5789] update CSharpier to 1.4.0 (#917)
fadi-george Nov 19, 2026
417c7b3
chore: [SDK-5808] default Unity demos to the shared example app (#919)
fadi-george Nov 24, 2026
7c238bc
Merge branch 'main' into v6
fadi-george Dec 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/actions/create-demo-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ runs:
ANDROID_CHANNEL_ID: ${{ inputs.onesignal-android-channel-id }}
E2E_MODE: ${{ inputs.e2e-mode }}
run: |
if [ -z "$APP_ID" ]; then
echo "::error::onesignal-app-id is empty"
exit 1
fi
{
echo "ONESIGNAL_APP_ID=$APP_ID"
echo "ONESIGNAL_API_KEY=$API_KEY"
Expand Down
56 changes: 56 additions & 0 deletions .github/scripts/validate-unity-distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import json
import re
import subprocess
import sys
from pathlib import Path

Expand Down Expand Up @@ -67,6 +68,60 @@ def validate_inventory() -> None:
)


def is_unity_hidden(part: str) -> bool:
return part.startswith(".") or part.endswith("~")


# Unity imports these folders as single assets, so their contents have no .meta files.
FOLDER_ASSET_SUFFIXES = (".androidlib", ".bundle", ".framework", ".xcframework")


def is_inside_folder_asset(parts: list[str]) -> bool:
return any(part.endswith(FOLDER_ASSET_SUFFIXES) for part in parts[:-1])


def packed_files(package: str) -> list[str]:
output = subprocess.run(
["npm", "pack", "--dry-run", "--json", "--ignore-scripts"],
cwd=ROOT / package,
check=True,
capture_output=True,
text=True,
).stdout
return [entry["path"] for entry in json.loads(output)[0]["files"]]


def validate_package_metas() -> None:
# UPM packages are immutable, so Unity ignores any asset that ships without a valid .meta.
guids: dict[str, str] = {}
for package in PACKAGE_NAMES:
packed = set(packed_files(package))

assets = set()
for path in packed:
if path.endswith(".meta"):
continue
parts = path.split("/")
if any(is_unity_hidden(part) for part in parts) or is_inside_folder_asset(parts):
continue
assets.add(path)
assets.update("/".join(parts[:i]) for i in range(1, len(parts)))

missing = sorted(f"{package}/{asset}.meta" for asset in assets if f"{asset}.meta" not in packed)
if missing:
fail(f"packed assets are missing .meta files: {', '.join(missing)}")

for meta in sorted(f"{asset}.meta" for asset in assets):
path = f"{package}/{meta}"
match = re.search(r"^guid:\s*([0-9a-f]{32})\s*$", (ROOT / path).read_text(), re.MULTILINE)
if match is None:
fail(f"{path} has no valid guid")
guid = match.group(1)
if guid in guids:
fail(f"{path} reuses guid {guid} from {guids[guid]}")
guids[guid] = path


def validate_packages() -> None:
packages = {
name: json.loads((ROOT / name / "package.json").read_text())
Expand Down Expand Up @@ -136,6 +191,7 @@ def main() -> None:
fail("exportable bootstrap documentation is missing")
validate_inventory()
validate_packages()
validate_package_metas()
print("Unity distribution layout is valid.")


Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
run: |
echo "Tag from output: [${{ steps.npm-tag.outputs.tag }}]"

- name: Validate Unity distribution layout
run: python3 .github/scripts/validate-unity-distribution.py

- name: Publish packages
run: |
publish_pkg() {
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
dotnet-version: "8.0.x"

- name: Install CSharpier
run: dotnet tool install -g csharpier
run: dotnet tool restore

- name: Check formatting
run: csharpier check .
run: dotnet csharpier check .

- name: Validate Unity distribution layout
run: python3 .github/scripts/validate-unity-distribution.py
49 changes: 35 additions & 14 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ on:
workflow_dispatch:
inputs:
unity_version:
description: "New Unity Version (e.g., 5.2.15 or 5.2.15-beta.1)"
required: true
description: "Override the auto-detected version (e.g., 5.2.15 or 5.2.15-beta.1). Leave blank to auto-detect."
required: false
type: string
android_version:
description: "New Android SDK Version (e.g., 2.3.0). Leave blank to skip."
Expand All @@ -52,19 +52,38 @@ permissions:
pull-requests: write

jobs:
determine_version:
runs-on: ubuntu-latest
outputs:
unity_version: ${{ inputs.unity_version || steps.next_version.outputs.version }}
release_needed: ${{ inputs.unity_version != '' || steps.next_version.outputs.release-needed == 'true' }}

steps:
- name: Determine Unity SDK version
if: github.event_name == 'workflow_dispatch' && inputs.unity_version == ''
id: next_version
uses: OneSignal/sdk-shared/.github/actions/determine-next-version@main
with:
github-token: ${{ secrets.GH_PUSH_TOKEN || github.token }}
target-repo: OneSignal/OneSignal-Unity-SDK
target-branch: ${{ inputs.target_branch }}

prep:
needs: determine_version
if: needs.determine_version.outputs.release_needed == 'true'
uses: OneSignal/sdk-shared/.github/workflows/prep-release.yml@main
secrets:
# Need this cross-repo token (sdk-shared & this repo) to perform changes
GH_PUSH_TOKEN: ${{ secrets.GH_PUSH_TOKEN }}
with:
# Need target_repo otherwise caller would set github.repository to the caller itself (e.g. sdk-shared)
target_repo: OneSignal/OneSignal-Unity-SDK
version: ${{ inputs.unity_version }}
version: ${{ needs.determine_version.outputs.unity_version }}
target_branch: ${{ inputs.target_branch }}

# Unity specific steps
update_version:
needs: prep
needs: [determine_version, prep]
runs-on: ubuntu-latest
outputs:
unity_from: ${{ steps.current_versions.outputs.unity_from }}
Expand Down Expand Up @@ -136,26 +155,28 @@ jobs:
git commit -m "Update iOS SDK to ${VERSION}" && git push

- name: Update Unity SDK version
env:
NEW_VERSION: ${{ needs.determine_version.outputs.unity_version }}
run: |
PADDED_VERSION=$(echo "${{ inputs.unity_version }}" | awk -F. '{printf "%02d%02d%02d", $1, $2, $3}')
printf "%s" "${{ inputs.unity_version }}" > examples/demo/Assets/OneSignal/VERSION
PADDED_VERSION=$(echo "${NEW_VERSION}" | awk -F. '{printf "%02d%02d%02d", $1, $2, $3}')
printf "%s" "${NEW_VERSION}" > examples/demo/Assets/OneSignal/VERSION
for file in com.onesignal.unitysdk.core/package.json com.onesignal.unitysdk.android/package.json com.onesignal.unitysdk.ios/package.json; do
sed -i "s/\"version\": \".*\"/\"version\": \"${{ inputs.unity_version }}\"/" "$file"
sed -i "s/\"com.onesignal.unitysdk.core\": \".*\"/\"com.onesignal.unitysdk.core\": \"${{ inputs.unity_version }}\"/" "$file"
sed -i "s/\"version\": \".*\"/\"version\": \"${NEW_VERSION}\"/" "$file"
sed -i "s/\"com.onesignal.unitysdk.core\": \".*\"/\"com.onesignal.unitysdk.core\": \"${NEW_VERSION}\"/" "$file"
done
sed -i "s/public const string Version = \".*\"/public const string Version = \"${{ inputs.unity_version }}\"/" com.onesignal.unitysdk.core/Runtime/OneSignal.cs
sed -i "s/public const string Version = \".*\"/public const string Version = \"${NEW_VERSION}\"/" com.onesignal.unitysdk.core/Runtime/OneSignal.cs
sed -i "s/public const string VersionHeader = \".*\"/public const string VersionHeader = \"${PADDED_VERSION}\"/" com.onesignal.unitysdk.core/Runtime/OneSignalPlatform.cs
for asm in examples/demo/Assets/OneSignal/Editor/OneSignal.UnityPackage.Editor.asmdef examples/demo/Assets/OneSignal/Attribution/OneSignal.UnityPackage.Attribution.asmdef com.onesignal.unitysdk.core/Samples~/OneSignal.UnityPackage.Example.asmdef; do
sed -i "s/\"expression\": \".*\"/\"expression\": \"${{ inputs.unity_version }}\"/" "$asm"
for asm in examples/demo/Assets/OneSignal/Editor/OneSignal.UnityPackage.Editor.asmdef examples/demo/Assets/OneSignal/Attribution/OneSignal.UnityPackage.Attribution.asmdef; do
sed -i "s/\"expression\": \".*\"/\"expression\": \"${NEW_VERSION}\"/" "$asm"
done
sed -i "s/\"com.onesignal.unitysdk.core\": \"[0-9.]\+\"/\"com.onesignal.unitysdk.core\": \"${{ inputs.unity_version }}\"/g" examples/demo/Packages/packages-lock.json
sed -i "s/bundleVersion: .*/bundleVersion: ${{ inputs.unity_version }}/" examples/demo/ProjectSettings/ProjectSettings.asset
sed -i "s/\"com.onesignal.unitysdk.core\": \"[0-9.]\+\"/\"com.onesignal.unitysdk.core\": \"${NEW_VERSION}\"/g" examples/demo/Packages/packages-lock.json
sed -i "s/bundleVersion: .*/bundleVersion: ${NEW_VERSION}/" examples/demo/ProjectSettings/ProjectSettings.asset
sed -i "s/setSdkVersion:@\"[0-9]*\"/setSdkVersion:@\"${PADDED_VERSION}\"/" com.onesignal.unitysdk.ios/Runtime/Plugins/iOS/UIApplication+OneSignalUnity.mm

# Only commit if there are changes
git add -A
git diff --staged --quiet && exit 0
git commit -m "Release ${{ inputs.unity_version }}" && git push
git commit -m "Release ${NEW_VERSION}" && git push

create_pr:
needs: [prep, update_version]
Expand Down
42 changes: 26 additions & 16 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,17 @@ concurrency:

jobs:
build-android:
name: build-android (FID ${{ matrix.fid }})
if: >-
github.event_name == 'push' ||
github.event.inputs.platform == 'android' ||
github.event.inputs.platform == 'both'
runs-on: ubuntu-latest
strategy:
# Each leg activates a Unity license; run them one at a time.
max-parallel: 1
matrix:
fid: ['on', 'off']
steps:
- name: Checkout
uses: actions/checkout@v6
Expand All @@ -54,21 +60,16 @@ jobs:
path.write_text(json.dumps(manifest, indent=2) + "\n")
PY
printf '%s\n' '-define:ONESIGNAL_E2E_ACCESSIBILITY' > examples/demo/Assets/csc.rsp

- name: Resolve OneSignal Android SDK version
id: android-sdk-version
run: |
VERSION=$(grep -oE 'Version = "[0-9]+\.[0-9]+\.[0-9]+"' com.onesignal.unitysdk.android/Editor/OneSignalAndroidDependencies.cs | head -n1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
if [ -z "$VERSION" ]; then
echo "::error::Could not parse OneSignal Android SDK version from OneSignalAndroidDependencies.cs"
exit 1
if [ "${{ matrix.fid }}" = on ]; then
printf '%s\n' '-define:FIREBASE_INSTALLATION_ID_ENABLED' >> examples/demo/Assets/csc.rsp
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"

- name: Wait for OneSignal Android SDK on Maven Central
uses: OneSignal/sdk-shared/.github/actions/wait-for-maven-artifact@main
- name: Write google-services.json
uses: OneSignal/sdk-shared/.github/actions/setup-google-services@main
with:
version: ${{ steps.android-sdk-version.outputs.version }}
google-services-json: ${{ secrets.APPIUM_GOOGLE_SERVICES_JSON }}
enabled: ${{ matrix.fid == 'on' }}
path: examples/demo/google-services.json

- name: Cache Unity Library
uses: actions/cache@v5
Expand All @@ -88,6 +89,7 @@ jobs:
unityVersion: 6000.4.11f1
targetPlatform: Android
buildMethod: BuildScript.BuildAndroidEmulator
customParameters: -demoBundleId com.onesignal.sdkdemo
allowDirtyBuild: true
# Run the Docker build as the runner's host user so the Library
# folder is owned by the runner and actions/cache can tar it in
Expand All @@ -98,7 +100,7 @@ jobs:
- name: Upload APK
uses: actions/upload-artifact@v7
with:
name: demo-apk
name: demo-apk${{ matrix.fid == 'off' && '-fid-off' || '' }}
path: examples/demo/Build/Android/onesignal-demo.apk
retention-days: 1
compression-level: 0
Expand Down Expand Up @@ -163,6 +165,7 @@ jobs:
unityVersion: 6000.4.11f1
targetPlatform: iOS
buildMethod: BuildScript.BuildiOSDevice
customParameters: -demoBundleId com.onesignal.sdkdemo -demoTeamId DL8TF3X4K3
allowDirtyBuild: true
cacheUnityInstallationOnMac: true

Expand All @@ -186,14 +189,17 @@ jobs:
# `pod install` an Unity-iPhone.xcworkspace exists and must be used;
# without CocoaPods we fall back to the .xcodeproj. The
# SigningPostProcessor already pinned DEVELOPMENT_TEAM and the NSE /
# Live Activity bundle IDs to match ExportOptions.plist.
# Live Activity bundle IDs to match ExportOptions.plist. CI only has the
# in-house distribution cert, so the identity and team are also pinned
# here for targets the post-processor skips (UnityFramework, Pods).
run: |
if [ -d Unity-iPhone.xcworkspace ]; then
CONTAINER_ARGS=(-workspace Unity-iPhone.xcworkspace)
else
CONTAINER_ARGS=(-project Unity-iPhone.xcodeproj)
fi
xcodebuild archive \
-jobs 1 \
"${CONTAINER_ARGS[@]}" \
-scheme Unity-iPhone \
-configuration Release \
Expand All @@ -204,6 +210,8 @@ jobs:
-quiet \
-hideShellScriptEnvironment \
CODE_SIGN_STYLE=Manual \
CODE_SIGN_IDENTITY="iPhone Distribution" \
DEVELOPMENT_TEAM=DL8TF3X4K3 \
COMPILER_INDEX_STORE_ENABLE=NO
xcodebuild -exportArchive \
-archivePath build/App.xcarchive \
Expand All @@ -229,8 +237,8 @@ jobs:
unzip -oq demo.ipa -d /tmp/ipa
APP=$(ls -d /tmp/ipa/Payload/*.app | head -n1)
codesign -d --entitlements - "$APP" 2>&1 | tee /tmp/entitlements.txt
if ! grep -q 'aps-environment' /tmp/entitlements.txt; then
echo "::error::Built IPA is missing aps-environment entitlement; push subscription will not work"
if ! grep -A2 'aps-environment' /tmp/entitlements.txt | grep -q 'production'; then
echo "::error::Built IPA needs aps-environment=production for the In House profile"
exit 1
fi

Expand All @@ -249,8 +257,10 @@ jobs:
with:
platform: android
app-artifact: demo-apk
fid-off-app-artifact: demo-apk-fid-off
app-filename: onesignal-demo.apk
sdk-type: unity
bundle-id: com.onesignal.sdkdemo
build-name: unity-android-${{ github.ref_name }}-${{ github.run_number }}

e2e-ios:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ And via many additional platforms. [Check them all out](https://documentation.on
- iOS Builds: CocoaPods 1.11.3 or newer
- In order to test push notifications you will need
- An Android 7 or newer device or emulator with "Google Play Store (Services)" installed
- An iOS 12 or newer device (iPhone, iPad, or iPod Touch)
- An iOS 15 or newer device (iPhone, iPad, or iPod Touch)

### Push Notification Credentials
You must generate the appropriate credentials for the platform(s) you are releasing on:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ internal static void WriteDependencies()
}
}

internal const string Version = "5.10.0";
internal const string Version = "5.11.0";

private static readonly string _dependenciesPath = Path.Combine(
"Assets",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public LogLevel LogLevel
get => _logLevel;
set
{
if (InputGuard.IsInvalidLogLevel(value, "setLogLevel"))
return;
_logLevel = value;
_debug.Call("setLogLevel", ToLogLevel(value));
}
Expand All @@ -58,6 +60,8 @@ public LogLevel AlertLevel
get => _alertLevel;
set
{
if (InputGuard.IsInvalidLogLevel(value, "setAlertLevel"))
return;
_alertLevel = value;
_debug.Call("setAlertLevel", ToLogLevel(value));
}
Expand Down
Loading