Skip to content

Latest commit

 

History

History
75 lines (46 loc) · 3.33 KB

File metadata and controls

75 lines (46 loc) · 3.33 KB

Testing on the Demo App

First try to use a more recent Unity version for testing on the emulators.

Publishing to the Asset Store

To upload or update the package on the Unity Asset Store, install the Asset Store Tools from Window > Package Manager within the Unity Editor.

Unity Version

The Asset Store package is a bootstrapper, not the full demo or the UPM sample. Before publishing:

  1. Select OneSignal > Generate File Inventory.
  2. Select OneSignal > Validate Distribution Layout and commit the regenerated inventory.
  3. Select OneSignal > ExportUnityPackage.
  4. Inspect the exported .unitypackage before upload. It must contain only the bootstrap content under Assets/OneSignal; it must not contain Example, Attribution, packager tooling, demo assets, generated dependency XML files, or StreamingAssets/.env.

The canonical user sample is the Full Usage sample in com.onesignal.unity.core/Samples~. The complete demo in this directory is for repository development and testing only.

Command Line

You can build and install without opening the Unity editor by using the provided scripts. Have an emulator/simulator booted first, then run:

# Android — builds APK and installs on a running emulator
./run-android.sh

# iOS — generates Xcode project, builds, and installs on a booted simulator
./run-ios.sh

Both scripts accept --no-install to build only, --install-only to skip rebuilding, and run-ios.sh also supports --open to open the generated Xcode workspace. Set UNITY_PATH if Unity is not at the default location.

Unity versions

The demo can be opened directly in Unity 2022.3 or 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.

Clean Generated State

Use clean.sh when you want to retest setup from the Unity Editor or clear build artifacts before switching between dependency configurations:

./clean.sh

The script removes Unity-generated folders such as Build/, Library/, Temp/, Obj/, Logs/, and UserSettings/. It also removes the generated OneSignal dependency manifest XML files while preserving their .meta files so Unity GUIDs remain stable:

Assets/OneSignal/Editor/OneSignalAndroidDependencies.xml
Assets/OneSignal/Editor/OneSignaliOSDependencies.xml

After running it, reopen the project in Unity. The OneSignal Editor setup code should regenerate those manifests for the default location-enabled dependency set.

Unity Editor

Android

Check your build profiles and make sure Android platform is selected.
Then click build and select a location for the apk bundle.

Android Example 1

Then have an emulator running and drag the apk to the emulator to install it. Then test what OneSignal functionality you want. Android Example 2

iOS

Check your build profiles and make sure iOS platform is selected.
Then configure your play settings and set Target SDK to Simulator SDK iOS Example 1

Then click Build and Run and select a location for the Xcode project. Or click Build to use your own simulator.

iOS Example 2