Get started guide (Unity 2019 and higher)
Plugin integration consists of these steps:
- Prerequisites
- Add signageOS repository with access keys to the Unity project
- Add required dependencies to the Unity project
- Resolve dependency conflicts
Prerequisites
Gradle Export is no longer required, so make a backup and remove the Gradle Export directory.
Repository and Access Keys
In Unity editor go to menu Edit->Project Settings.
Choose Player at left, then Android settings tab.
Expand Publishing Settings and check Custom Base Gradle Template, if not yet checked.
In project explorer find out the file baseProjectTemplate.gradle and open it to edit.
Copy this block of code into allprojects->repositories definition.
maven { url = "s3://${System.env.AWS_SHARED_MAVEN_S3_BUCKET}/maven2/" credentials(AwsCredentials) { accessKey = System.env.AWS_ACCESS_KEY_ID secretKey = System.env.AWS_SECRET_ACCESS_KEY } content { includeGroupByRegex "io\\.signageos\\..*" } }
Make sure all three environment variables are defined! Alternatively, you may replace System.env.<VARIABLE_NAME>
with hardcoded string. Ask your signageOS Support for access keys to the repository.
Features & dependencies
In Unity editor go to menu Edit->Project Settings.
Choose Player at left, then Android settings tab.
Expand Publishing Settings and check Custom Main Gradle Template, if not yet checked.
In project explorer find out the file mainTemplate.gradle and open it to edit.
Add any or all of the following lines to dependencies definition.
Auto-start
To automatically start the main activity after boot add the following line:
implementation("io.signageos.cc.sdk:sdk-auto-start:0.3.0")
Crash handling
To automatically restart the main process upon crash add the following line:
implementation("io.signageos.cc.sdk:sdk-crash-handler-zeroconfig:0.1.0")
We also recommend using a crash reporting tool such as Firebase Crashlytics to gain insight into production crashes.
Kiosk
This will only work on Android 5 or newer!
To prevent users from escaping the main activity while Kiosk Mode is enabled by signageOS Cloud Control add the following line:
implementation("io.signageos.cc.sdk:sdk-kiosk-zeroconfig:0.2.2")
For this to actually work your app must be installed remotely by Cloud Control and Cloud Control app must be set as Device Owner on the device. You can use ADB:
adb shell dpm set-device-owner io.signageos.cc/sos.cc.admin.DeviceAdmin
Resolving conflicts
In case you use Firebase or Facebook SDK with EDM4U, to prevent dependencies conflict, run Android Resolver (Assets -> External Dependency Manager -> Android Resolver -> Resolve) and be sure it has Patch mainTemplate.gradle option checked in settings.