Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
version: ${{ steps.npm-tag.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Setup Node
uses: actions/setup-node@v6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Setup .NET
uses: actions/setup-dotnet@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
repository: OneSignal/OneSignal-Unity-SDK
ref: ${{ needs.prep.outputs.release_branch }}
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
restore-keys: unity-library-android-

- name: Build APK
uses: game-ci/unity-builder@v4
uses: game-ci/unity-builder@v5
env:
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
UNITY_EMAIL: ${{ secrets.UNITY_USERNAME }}
Expand All @@ -76,6 +76,11 @@ jobs:
targetPlatform: Android
buildMethod: BuildScript.BuildAndroidEmulator
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
# the post step (otherwise tar exits with code 2 on root-owned
# files).
runAsHostUser: "true"

- name: Upload APK
uses: actions/upload-artifact@v7
Expand Down Expand Up @@ -122,7 +127,7 @@ jobs:
restore-keys: deriveddata-${{ runner.os }}-

- name: Export Xcode project from Unity
uses: game-ci/unity-builder@v4
uses: game-ci/unity-builder@v5
env:
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
UNITY_EMAIL: ${{ secrets.UNITY_USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Add issue to project
uses: actions/add-to-project@v1.0.2
uses: actions/add-to-project@v2
with:
# SDK Cross-Platform Project
project-url: https://github.com/orgs/OneSignal/projects/10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<repositories>
<repository>https://repo.maven.apache.org/maven2</repository>
</repositories>
<androidPackage spec="com.onesignal:OneSignal:5.8.0" />
<androidPackage spec="com.onesignal:OneSignal:5.9.2" />
</androidPackages>
</dependencies>
4 changes: 2 additions & 2 deletions com.onesignal.unity.android/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "com.onesignal.unity.android",
"displayName": "OneSignal Unity SDK - Android",
"version": "5.2.7",
"version": "5.2.8",
"unity": "2018.4",
"description": "OneSignal is the market leader in customer engagement, powering mobile push, web push, email, and in-app messages.",
"dependencies": {
"com.onesignal.unity.core": "5.2.7"
"com.onesignal.unity.core": "5.2.8"
},
"keywords": [
"push-notifications",
Expand Down
2 changes: 1 addition & 1 deletion com.onesignal.unity.core/Runtime/OneSignal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace OneSignalSDK
/// </summary>
public static partial class OneSignal
{
public const string Version = "5.2.7";
public const string Version = "5.2.8";

/// <summary>
/// The default static instance of the OneSignal Unity SDK
Expand Down
2 changes: 1 addition & 1 deletion com.onesignal.unity.core/Runtime/OneSignalPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace OneSignalSDK
{
public abstract class OneSignalPlatform
{
public const string VersionHeader = "050207";
public const string VersionHeader = "050208";

internal static event Action<string> OnInitialize;

Expand Down
2 changes: 1 addition & 1 deletion com.onesignal.unity.core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.onesignal.unity.core",
"displayName": "OneSignal Unity SDK - Core",
"version": "5.2.7",
"version": "5.2.8",
"unity": "2018.4",
"description": "OneSignal is the market leader in customer engagement, powering mobile push, web push, email, and in-app messages.",
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ - (void)setOneSignalUnityDelegate:(id <UIApplicationDelegate>)delegate {

- (BOOL)oneSignalApplication:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[OneSignalWrapper setSdkType:@"unity"];
[OneSignalWrapper setSdkVersion:@"050207"];
[OneSignalWrapper setSdkVersion:@"050208"];
[OneSignal initialize:nil withLaunchOptions:launchOptions];

if ([self respondsToSelector:@selector(oneSignalApplication:didFinishLaunchingWithOptions:)])
Expand Down
4 changes: 2 additions & 2 deletions com.onesignal.unity.ios/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "com.onesignal.unity.ios",
"displayName": "OneSignal Unity SDK - iOS",
"version": "5.2.7",
"version": "5.2.8",
"unity": "2018.4",
"description": "OneSignal is the market leader in customer engagement, powering mobile push, web push, email, and in-app messages.",
"dependencies": {
"com.onesignal.unity.core": "5.2.7"
"com.onesignal.unity.core": "5.2.8"
},
"keywords": [
"push-notifications",
Expand Down
85 changes: 66 additions & 19 deletions examples/demo/Assets/App/Editor/iOS/SigningPostProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#if UNITY_IOS

using System;
using System.IO;
using UnityEditor;
using UnityEditor.Build;
Expand All @@ -12,21 +13,10 @@ namespace App.Editor.iOS
/// <summary>
/// Final iOS post-processor for the demo app. Runs AFTER the OneSignal
/// SDK and demo widget post-processors so it can correct things they set:
///
/// 1. Flips the main target's aps-environment from "production" (the SDK
/// default) to "development". The demo only ever runs on simulator or
/// a development device; "production" mismatches the simulator's APNS
/// environment and triggers iOS's "Keep receiving notifications?"
/// tuning prompt on first delivery (matches what the Flutter demo
/// ships with).
///
/// 2. Normalizes extension bundle IDs to short suffixes (`.NSE`, `.LA`)
/// to match the Flutter demo and keep provisioning profile names
/// consistent across SDKs.
///
/// 3. Pins DEVELOPMENT_TEAM on all targets so a future Manual signing
/// setup with the OneSignal-owned profiles works without manual
/// fix-up in Xcode.
/// flips aps-environment to "development", normalizes extension bundle
/// IDs, pins DEVELOPMENT_TEAM on every target, and (in CI only) switches
/// signing to Manual with the OneSignal-owned Appium provisioning
/// profiles so xcodebuild archive can sign the IPA unattended.
/// </summary>
public class SigningPostProcessor : IPostprocessBuildWithReport
{
Expand All @@ -40,6 +30,17 @@ public class SigningPostProcessor : IPostprocessBuildWithReport
private const string NseBundleSuffix = "NSE";
private const string WidgetBundleSuffix = "LA";

// CI-only manual signing config. Profile names must match the
// OneSignal-owned provisioning profiles fetched by
// .github/workflows/e2e.yml (`Download provisioning profiles`) and
// referenced by examples/demo/iOS/ExportOptions.plist. Local devs
// keep Xcode auto-signing because IsCiBuild only returns true when
// GitHub Actions / similar set CI=true.
private const string MainProfileName = "Appium Demo - Main";
private const string NseProfileName = "Appium Demo - NSE";
private const string WidgetProfileName = "Appium Demo - Live Activity";
private const string DevSignIdentity = "Apple Development";

// Run after both demo widget post-processor (45) and SDK
// post-processor (45). 100 puts us after pod install (50) too.
public int callbackOrder => 100;
Expand Down Expand Up @@ -101,18 +102,24 @@ private static void FixupSigningAndBundleIds(string outputPath)
project.ReadFromString(File.ReadAllText(projectPath));

var appId = PlayerSettings.GetApplicationIdentifier(BuildTargetGroup.iOS);
var manualSigning = IsCiBuild();

ApplyTeamId(project, project.GetUnityMainTargetGuid(), "Unity-iPhone");
var mainGuid = project.GetUnityMainTargetGuid();
ApplyTeamId(project, mainGuid, "Unity-iPhone");
if (manualSigning)
ApplyManualSigning(project, mainGuid, MainProfileName, "Unity-iPhone");

ApplyExtensionFixup(
project,
NseTargetName,
$"{appId}.{NseBundleSuffix}"
$"{appId}.{NseBundleSuffix}",
manualSigning ? NseProfileName : null
);
ApplyExtensionFixup(
project,
WidgetTargetName,
$"{appId}.{WidgetBundleSuffix}"
$"{appId}.{WidgetBundleSuffix}",
manualSigning ? WidgetProfileName : null
);

File.WriteAllText(projectPath, project.WriteToString());
Expand All @@ -127,10 +134,39 @@ private static void ApplyTeamId(PBXProject project, string targetGuid, string la
Debug.Log($"[SigningPostProcessor] Pinned DEVELOPMENT_TEAM={AppleTeamId} on {label}");
}

private static void ApplyManualSigning(
PBXProject project,
string targetGuid,
string profileName,
string label
)
{
if (string.IsNullOrEmpty(targetGuid))
return;

project.SetBuildProperty(targetGuid, "CODE_SIGN_STYLE", "Manual");
project.SetBuildProperty(targetGuid, "PROVISIONING_PROFILE_SPECIFIER", profileName);
// PROVISIONING_PROFILE was deprecated by Xcode in favor of the
// specifier but Unity still emits it on every target; clear it so
// the specifier above wins instead of an empty UUID lookup.
project.SetBuildProperty(targetGuid, "PROVISIONING_PROFILE", "");
project.SetBuildProperty(targetGuid, "CODE_SIGN_IDENTITY", DevSignIdentity);
project.SetBuildProperty(
targetGuid,
"CODE_SIGN_IDENTITY[sdk=iphoneos*]",
DevSignIdentity
);

Debug.Log(
$"[SigningPostProcessor] Manual signing on {label}: profile=\"{profileName}\""
);
}

private static void ApplyExtensionFixup(
PBXProject project,
string targetName,
string bundleId
string bundleId,
string profileName
)
{
var guid = project.TargetGuidByName(targetName);
Expand All @@ -144,10 +180,21 @@ string bundleId

project.SetBuildProperty(guid, "PRODUCT_BUNDLE_IDENTIFIER", bundleId);
ApplyTeamId(project, guid, targetName);
if (!string.IsNullOrEmpty(profileName))
ApplyManualSigning(project, guid, profileName, targetName);
Debug.Log(
$"[SigningPostProcessor] Set {targetName} PRODUCT_BUNDLE_IDENTIFIER={bundleId}"
);
}

private static bool IsCiBuild()
{
return string.Equals(
Environment.GetEnvironmentVariable("CI"),
"true",
StringComparison.OrdinalIgnoreCase
);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"versionDefines": [
{
"name": "com.onesignal.unity.core",
"expression": "5.2.7",
"expression": "5.2.8",
"define": "ONE_SIGNAL_INSTALLED"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"versionDefines": [
{
"name": "com.onesignal.unity.core",
"expression": "5.2.7",
"expression": "5.2.8",
"define": "ONE_SIGNAL_INSTALLED"
}
],
Expand Down
2 changes: 1 addition & 1 deletion examples/demo/Assets/OneSignal/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.2.7
5.2.8
2 changes: 1 addition & 1 deletion examples/demo/Assets/Plugins/Android/mainTemplate.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ apply from: '../shared/common.gradle'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// Android Resolver Dependencies Start
implementation 'com.onesignal:OneSignal:5.8.0' // Packages/com.onesignal.unity.android/Editor/OneSignalAndroidDependencies.xml:6
implementation 'com.onesignal:OneSignal:5.9.2' // Packages/com.onesignal.unity.android/Editor/OneSignalAndroidDependencies.xml:6
// Android Resolver Dependencies End
**DEPS**}

Expand Down
39 changes: 1 addition & 38 deletions examples/demo/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,11 @@
"com.onesignal.unity.android": "file:../../../com.onesignal.unity.android",
"com.onesignal.unity.core": "file:../../../com.onesignal.unity.core",
"com.onesignal.unity.ios": "file:../../../com.onesignal.unity.ios",
"com.unity.ai.navigation": "2.0.12",
"com.unity.ide.rider": "3.0.39",
"com.unity.inputsystem": "1.19.0",
"com.unity.multiplayer.center": "1.0.1",
"com.unity.nuget.newtonsoft-json": "3.2.2",
"com.unity.test-framework": "1.6.0",
"com.unity.timeline": "1.8.12",
"com.unity.ugui": "2.0.0",
"com.unity.modules.accessibility": "1.0.0",
"com.unity.modules.adaptiveperformance": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.cloth": "1.0.0",
"com.unity.modules.director": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.physics2d": "1.0.0",
"com.unity.modules.screencapture": "1.0.0",
"com.unity.modules.terrain": "1.0.0",
"com.unity.modules.terrainphysics": "1.0.0",
"com.unity.modules.tilemap": "1.0.0",
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.uielements": "1.0.0",
"com.unity.modules.umbra": "1.0.0",
"com.unity.modules.unityanalytics": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
"com.unity.modules.unitywebrequestaudio": "1.0.0",
"com.unity.modules.unitywebrequesttexture": "1.0.0",
"com.unity.modules.unitywebrequestwww": "1.0.0",
"com.unity.modules.vectorgraphics": "1.0.0",
"com.unity.modules.vehicles": "1.0.0",
"com.unity.modules.video": "1.0.0",
"com.unity.modules.vr": "1.0.0",
"com.unity.modules.wind": "1.0.0",
"com.unity.modules.xr": "1.0.0"
"com.unity.modules.unitywebrequest": "1.0.0"
},
"scopedRegistries": [
{
Expand Down
Loading