The Adjust Corona SDK allows you to record attribution, events, and other analytics in your Solar2D / Corona applications. Follow the steps in this guide to set up your app with the Adjust SDK.
1. Add the SDK to your project
You can download the latest version of the Adjust SDK from the Adjust Corona SDK releases page. Download both the plugin.adjust.jar
and libplugin_adjust.a
files and add them to your Android Studio and Xcode projects.
Additionally, download the latest version of the Adjust Signature library for iOS from this repository and add it to your Xcode project.
To import the Adjust SDK into your Solar2D / Corona project:
- In your Android Studio project, create a
libs
folder inside your app directory and place theplugin.adjust.jar
file there. - Update your app’s
build.gradle
file by adding the following dependencies:
implementation 'com.adjust.sdk:adjust-android:5.4.1'implementation 'com.android.installreferrer:installreferrer:2.2'
Add Google Play Services
Apps targeting the Google Play Store must use the Google Advertising ID (gps_adid
) to identify devices. Add this dependency to your build.gradle
file:
implementation 'com.google.android.gms:play-services-ads-identifier:18.1.0'
Android permissions
The Adjust SDK includes the com.google.android.gms.AD_ID
permission by default. You can remove it if your app needs to comply with COPPA or if it is not targeting the Google Play Store:
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>
Set up install referrer
The install referrer is a unique identifier that allows attribution of an app install to a specific source. The Adjust SDK requires this information for attribution.
As mentioned above, include the following in your build.gradle
file:
implementation 'com.android.installreferrer:installreferrer:2.2'
Meta referrer integration
The Adjust SDK supports the Meta Install Referrer via the Adjust Meta Install Referrer plugin. See the Corona Meta Install Referrer plugin documentation for integration details.
Add iOS frameworks
The Adjust SDK can gather additional information when you include certain iOS frameworks in your project. These frameworks enable extra features but are not required for basic SDK functionality. Add them to Project Settings → Build Phases → Link Binary With Libraries and mark them as Optional.
Framework | Description | Notes |
---|---|---|
AdSupport.framework | Enables access to the device’s IDFA. Also enables access to LAT information on devices running iOS 14 or earlier | Don’t add this framework if your app targets the “Kids” category |
AdServices.framework | Handles Apple Search Ads attribution | |
StoreKit.framework | Enables access to the SKAdNetwork framework | Required to allow the Adjust SDK to handle communication with SKAdNetwork on devices running iOS 14 or later |
AppTrackingTransparency.framework | Required to allow the Adjust SDK to wrap user ATT consent dialog and access consent responses on devices running iOS 14 or later | Don’t add this framework if your app targets the “Kids” category |
2. Set up SDK Signature
In your Xcode project, select your app’s target, go to General → Linked Frameworks and Libraries, click the +
button, and add the AdjustSigSdk.a
library.
On Android, the signature library is added automatically as part of the SDK dependency.
To secure communications between the Adjust SDK and Adjust servers, follow the instructions in the SDK signature guide.
3. Initialize the Adjust SDK
Initialize the Adjust SDK as early as possible in your Corona app. Set up your configuration table with your app token and environment.
local adjust = require "plugin.adjust"
adjust.initSdk({ appToken = "YourAppToken", environment = "SANDBOX"})
4. Build your app
Well done! You should now be able to build and run your Solar2D / Corona app. Enable logging to check for potential issues and verify that you see the Install tracked
message in your logs.
You are ready to start attributing your users with the Adjust SDK.
5. Test your integration
The Adjust SDK provides tools to help test and troubleshoot your setup:
- Set your environment to
SANDBOX
. - Use a sandbox filter in your Adjust dashboard.
- Set your log level to
VERBOSE
. - On Android, logs are tagged
Android
. On iOS, they are prefixed with[Adjust]
.
Test Google Play Services integration
To test that the Adjust SDK can receive a device’s Google Advertising ID, set the log level to VERBOSE
and the environment to SANDBOX
. Start your app and measure a session or an event. The SDK logs the gps_adid
(Google Play Services Advertiser ID) parameter if it has read the advertising ID.
If you’re experiencing issues retrieving the Google Advertising ID, open an issue in the SDK GitHub repository or contact support@adjust.com.
To verify that the Adjust SDK can read a device’s Google Advertising ID:
- Set your log level to
VERBOSE
and environment toSANDBOX
. - Start your app and record a session or event.
- Check logs for the
gps_adid
(Google Play Services Advertiser ID) parameter.