Stack Holistic Solution SDK for Unity simplifies the collection and transfer of the necessary parameters from third-party services to the corresponding Stack SDKs to improve the performance of services such as Mediation and UA
To import the Appodeal-Unity-HS-Plugin-2.0.5-20.01.2022.unitypackage, double-click on the Appodeal-Unity-HS-Plugin-2.0.5-20.01.2022.unitypackage, or go to Assets → Import Package → Custom Package. Keep all the files in the Importing Package window selected, and click Import.
- Enable flag Custom Gradle Template for Unity 2017.4 - Unity 2019.2 versions or Custom Base Gradle Template for Unity 2019.3 or higher versions in Player Settings/Publishing Settings
- Change classpath 'com.android.tools.build:gradle:3.4.0' to 'com.android.tools.build:gradle:3.4.3' in Custom Gradle Template file (path - Assets/Plugins/Android/mainTemplate.gradle) for Unity 2017.4 - Unity 2019.4 versions. Change classpath 'com.android.tools.build:gradle:3.6.0' to 'com.android.tools.build:gradle:3.6.4' in Custom Base Gradle Template file (path - Assets/Plugins/Android/baseProjectTemplate.gradle) for Unity 2020.1 or higher versions.
- Appodeal Holistic Solution plugin includes External Dependency Manager package. You need to complete these following steps to resolve Appodeal's dependencies:
- After the import Appodeal Unity Plugin, in the Unity editor select File → Build Settings → Android.
- Add flag Custom Gradle Template (Build Settings → Player Settings → Publishing settings).
- Enable the setting "Patch mainTemplate.gradle" (Assets → External Dependency Manager → Android Resolver → Settings).
- Enable the setting "Use Jetifier" (Assets → External Dependency Manager → Android Resolver → Settings).
- Then run Assets → External Dependency Manager → Android Resolver and press Resolve or Force Resolve.
- As a result, the modules, that are required for the Appodeal SDK support, will be imported to project's mainTemplate.gradle file.
Appodeal plugin includes Play Services Resolver package. You need to complete these following steps to resolve Appodeal's dependencies:
- After the import Appodeal Unity Plugin, in the Unity editor select File → Build Settings → iOS.
- During build a project the modules, that are required for the Appodeal SDK support, will be imported to your project. You can edit them or add other modules in the Assets → Appodeal → Editor → AppodealDependencies.xml file.
Note that HS Facebook Service will include only 'facebook-core' dependency independently
Please follow this guide to configure you Facebook app
Note that HS Firebase Service will include 'firebase-analytics' and 'firebase-config' dependencies independently
Please, follow this guide to configure you Firebase app
Holistic Solution SDK will automatically initialize all components and sync all required data to connectors (e.g - Appodeal).
To initialize SDK add the line below to your script:
public class HolisticSolutionDemo : MonoBehaviour, IHSAppInitializeListener
{
void Start()
{
HSAppConfig appConfig = new HSAppConfig()
.setDebugEnabled(true)
.setAppKey("YOUR_APP_KEY")
.setComponentInitializeTimeout(10000)
.setAdType(Appodeal.INTERSTITIAL | Appodeal.REWARDED_VIDEO | Appodeal.BANNER);
HSApp.initialize(appConfig, this);
}
public void onAppInitialized(string error)
{
if (!string.IsNullOrEmpty(error))
{
Debug.Log($"onAppInitializeFailed - {error}");
}
Debug.Log("Holistic Solution Initialize - " + HSApp.isInitialized());
//HSApp initialization finished, now you can initialize required SDK
}
...
}
Parameter | Description |
---|---|
appKey | Appodeal application key. |
adType | Appodeal ad types (e.g - Appodeal.INTERSTITIAL ). |
debug | Enable sdk, services and connectors debug logic if possible. |
timeout | In this case is timeout for one operation: starting attribution service or fetching remote config. By default the value is 30 sec. |
Holistic Solution SDK allows you to send events to analytic services such as Firebase, AppsFlyer and Facebook using a single method:
Event parameters can only be strings and numbers
Holistic Solution SDK allows you to unify purchase validation using a single method:
public class HolisticSolutionDemo : MonoBehaviour, IInAppPurchaseValidationCallback
{
void Start()
{
PurchaseTest();
}
private void PurchaseTest()
{
#if UNITY_ANDROID
HSInAppPurchase purchase = new HSInAppPurchase.Builder(PurchaseType.SUBS)
.withPublicKey("YOUR_PUBLIC_KEY")
.withAdditionalParams(new Dictionary<string, string>
{
{"test_key", "test_value"},
})
.withSignature("Signature")
.withPurchaseData("PurchaseData")
.withPurchaseToken("PurchaseToken")
.withPurchaseTimestamp(12345)
.withDeveloperPayload("DeveloperPayload")
.withOrderId("OrderId")
.withSku("Sku")
.withPrice("Price")
.withCurrency("Currency")
.build();
HSApp.validateInAppPurchaseAndroid(purchase, this);
#elif UNITY_IOS
HSApp.validateInAppPurchaseiOS("productIdentifier", "price", "currency", "transactionId",
"additionalParams", iOSPurchaseType.consumable, this);
#endif
}
#region InAppPurchaseValidationCallback
public void InAppPurchaseValidationSuccessCallback(string json)
{
if (string.IsNullOrEmpty(json)) return;
Debug.Log($"InAppPurchaseValidationSuccessCallback - {json}");
}
public void InAppPurchaseValidationFailureCallback(string error)
{
if (string.IsNullOrEmpty(error)) return;
Debug.Log($"InAppPurchaseValidationFailureCallback - {error}");
}
#endregion
...
}
Parameter | Description | Usage |
---|---|---|
purchaseType | Purchase type. Must be one of PurchaseType. | Adjust/AppsFlyer |
publicKey | Public key from Google Developer Console. | AppsFlyer |
signature | Transaction signature (returned from Google API when the purchase is completed). | Adjust/AppsFlyer |
purchaseData | Product purchased in JSON format (returned from Google API when the purchase is completed). | AppsFlyer |
purchaseToken | Product purchased token (returned from Google API when the purchase is completed). | Adjust |
purchaseTimestamp | Product purchased timestamp (returned from Google API when the purchase is completed). | Adjust |
developerPayload | Product purchased developer payload (returned from Google API when the purchase is completed). | Adjust |
orderId | Product purchased unique order id for the transaction (returned from Google API when the purchase is completed). | Adjust |
sku | Stock keeping unit id. | Adjust |
price | Purchase revenue. | Adjust/AppsFlyer/Appodeal |
currency | Purchase currency. | Adjust/AppsFlyer/Appodeal |
additionalParameters | Additional parameters of the purchase event. | Adjust/AppsFlyer |
In-App purchase validation runs by FIFO queue in a single thread