Upgrading to SDK Version 26.x
Platform Specific Instructions
Unity Instructions for 26.x
This document is for developers who have previously integrated v25.x of the Skillz Unity SDK.
Before You Upgrade
v26.x of the Skillz SDK was tested with Unity 2018 LTS thru 2019 LTS. Using 2019 LTS is recommended.
Permissions Note
Due to Android being built with Android SDK 28, your app will ask for permissions at runtime, rather than at install time. Unity typically operates by asking for all possible permissions on the first launch of your app, and this can be overwhelming/off-putting to your users. Refer to these instructions on how to prompt for only necessary permissions at runtime.
Firebase
If you plan on adding Firebase to your Unity project, we recommend you use Unity Firebase 6.15.1, as it has been tested with Skillz v26.x.
Firebase Messaging and Dynamic Links
Firebase Messaging and Dynamic Links are currently not supported with Skillz. Using either of these libraries will prevent push notifications and other Skillz SDK features from functioning correctly.
Instructions
Delete the Assets/Skillz/ folder in Unity
Make sure to save any custom code you wrote in these Skillz files for safe keeping. In your Unity project, delete the Assets/Skillz/
folder in your Unity project.
Import the New Unity Package
With your Unity project open, double-click on the Unity package, skillz_unity_crossplatform.unitypackage
, found inside the downloaded Unity SDK. A dialog will pop up with a list of files to import. Make sure all files are checked and click "OK".
Disable Registry Addition
Skillz bundles a plugin by Google called the External Dependency Manager (EDM), which is used to resolve Android dependencies. On import of the Skillz SDK, EDM will display a dialog, similar to the screenshot below, to ask if you would like to add additional Unity Package Manager registries. Click the "Disable Registry Addition" button to dismiss the dialog.
Configure Your Game in Skillz Settings
Skillz has a dedicated settings window to configure your game. Access it from the Skillz > Settings
menu item. It will look similar to:
Enter your game ID, choose either Sandbox
or Production
for the environment, and your game's orientation for Android.
The orientation setting is for Android only. For games that have mixed orientations, the orientation setting tells Skillz what orientation to set your game scene at when it is loaded at the start of a match. For instance, if the scene for your main menu is designed for Portrait mode, but your game scene is designed for Landscape, the orientation setting should be set to Landscape.
Additionally, you can choose if users are allowed to exit the Skillz UI via its sidebar menu.
Test Your Game's Workflow
Test your game's workflow with Skillz using the SDK's Unity Companion feature.
Build Your Game
Follow the instructions on how to export and build your game for iOS or Android.
Next Steps
You have updated your project to v26.x. If you encounter a problem, please contact us with a detailed description of the issue you are encountering.
Custom Theming Warning
If your game takes advantage of our custom themed SDK feature, you will need to build an .ipa or .apk with the new SDK version, upload it to the Skillz Developer Console, and sync your game to Production. Prior to that, you may see artifacts within your custom theme.
iOS Instructions for 26.x
This document is for developers who previously integrated v25.x of the Skillz iOS SDK and are looking to update their integration using the latest v25.x release.
Instructions
Re-Add Skillz.framework
Please download the newest Skillz.framework
from the Skillz Developer Console. Next, remove the older version of Skillz.framework
from your project. Now, add the Skillz.framework
file that was downloaded to your Xcode project. Refer to this article for more information.
Update the Deployment Target
Now, update the deployment target to iOS 10.0.
Next Steps
If you encounter any problems, please contact us with a detailed description of the issue you are encountering.
Android Instructions for 26.x
This document is for developers who have previously integrated v25.x of the Skillz Android SDK and want to update their integration using the latest v26.x release of our SDK.
Instructions
Add a Skillz SDK Dependency
Point your app to the Skillz SDK version 26.x. In your build.gradle
file, update your Skillz dependency to the latest SDK version. For example:
android {
dependencies {
implementation 'com.skillz.sdk:skillz-sdk-android:26.0.6'
}
}
Note
Version
26.0.6
is an example. The newest version of the SDK can be found in Skillz's Maven Repository.
Reference Gradle 5.1+
If you plan on using Google's Maven repository, Gradle version 5.1 and above is required. As such, you will need to modify our build.gradle
file to reference v3.5.2 (or above) of the Gradle plugin. It usually resides in the buildscript
section:
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
}
}
Refer to the official documentation to see which version of the plugin to reference for a different version of Gradle.
Change minSdkVersion, targetSdkVersion, and compileSdkVersion
You will need to modify your build.gradle
file so that the minSdkVersion
is 23, and both targetSdkVersion
and compileSdkVersion
are set to 28:
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 23
targetSdkVersion 28
}
}
Update multidex-keep.txt
The Skillz SDK needs a few classes to end up in your APK's main DEX file upon compilation. Modify build.gradle
to reference a file called multidex-keep.txt
inside the defaultConfig
subsection for the android
section.
android {
defaultConfig {
multiDexKeepProguard file('multidex-keep.txt')
}
}
Now, update the multidex-keep.txt
in your Android Studio project with the contents below:
# multidex-keep.txt
-keep class com.google.firebase.crashlytics.** { *; }
-keep class timber.log.** { *; }
-keep class com.facebook.FacebookSdk
-keep class com.path.android.jobqueue.JobManager
Enable AndroidX and R8
The Skillz SDK depends on the AndroidX Support Libraries instead of the original Android Support Libraries. Additionally, R8 has replaced Proguard as the standard tool for code shrinking, desugaring, and obfuscation.
In your project, add the lines below to the gradle.properties
file; create one if it does not exist. These will tell Android Studio to automatically migrate dependencies from any original Support Libraries to their AndroidX equivalents, and enable R8.
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
Update Proguard rules
Skillz is now obfuscated and requires updated Proguard rules to prevent it from being re-obfuscated and shrunken. Otherwise, this will cause crashes and other problems at runtime. In your build.gradle
, make sure minifyEnabled
and shrinkResources
are both set to false. Additionally, specify 'proguard-rules.pro'
as your Proguard file.
android {
buildTypes {
debug {
jniDebuggable true
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
Next, add the snippet below in your Proguard file:
# The Skillz Android SDK is already obfuscated, prevent it
# from being obfuscated again if minifyEnabled true
-dontobfuscate
# Prevent the Skillz SDK from being minified if minifyEnabled true
-dontshrink
-keep class bitter.jnibridge.* { *; }
-keep class com.unity3d.player.* { *; }
-keep class org.fmod.* { *; }
-keep public class com.dylanvann.fastimage.* { *; }
-keep public class com.dylanvann.fastimage.** { *; }
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class retrofit.** {*;}
-keep class com.facebook.** {*;}
-keep class com.amazonaws.** {*;}
Next Steps
You have now updated your project to 26.x. If you encounter a problem, please contact us with a detailed description of the issue you are encountering.
Cordova Instructions for 26.x
This document is for developers who have previously integrated v25.x of the Skillz Cordova SDK and want to update their integration using the latest v26.x release of our SDK.
Instructions
- Remove old version of the Skillz SDK
cordova plugin remove skillz-crossplatform-cordova
- Install new version of the Skillz SDK
cordova plugin add skillz-crossplatform-cordova --save --searchpath <plugin-path>
- Referencing the Cordova install instructions continue from "Reference SkillzCordova.js and SkillzDelegateCordova.js"