Apptilaus Unity SDK is an open-source SDK that provides a simplest way to analyse cross-device subscriptions via Apptilaus Service for iOS App Store and Google Play Store.
In order to use the Apptilaus SDK, you must obtain AppID
and AppToken
for your app. You can find the App ID and App Token in the admin panel.
Here is the steps to integrate the Apptilaus Unity SDK into your project using Unity.
Before adding ApptilausSDK to your project make sure you've successfully downloaded and integrated Unity IAP package.
Download the latest version from our releases page.
Open your project in the Unity Editor and navigate to Assets → Import Package → Custom Package
. Select the downloaded ApptilausSDK.unitypackage
.
Add the prefab located at Assets/ApptilausSDK/Apptilaus.prefab
to the first scene.
Edit the parameters of the Apptilaus
script in the Inspector menu of the added prefab.
You have the possibility to set up the following options on the Apptilaus prefab:
Replace {AppID}
and {AppToken}
with your App ID and App Token from your admin panel.
To register subscriptions, call ApptilausManager.Share.Purchase
inside the PurchaseProcessingResult
method of your IStoreListener
implementation. Pass PurchaseEventArgs
object as a parameter.
public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs e) {
ApptilausManager.Shared.Purchase(e);
return PurchaseProcessingResult.Complete;
}
To register subscriptions with custom parameters you must pass another parameter to the Purchase method. It must be a Dictionary<string,string>
which contains an arbitrary number of Key/Value pairs, representing your custom parameters.
public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs e) {
Dictionary<string,string> parameters = new Dictionary<string,string>();
parameters.Add("custom_parameter","custom_value");
ApptilausManager.Shared.Purchase(e, parameters);
return PurchaseProcessingResult.Complete;
}
To register sessions you must perform the steps outlined above. See Enable Session Tracking.
In accordance with article 17 of the EU's General Data Protection Regulation (GDPR), you can notify Apptilaus when a user has exercised their right to be forgotten. Calling the OptOut method will instruct the Apptilaus SDK to communicate the user's choice to be forgotten to the Apptilaus backend and data storage.
The method can take a delegate, which is called when the operation is completed, as an optional parameter.
public void OptOut(){
ApptilausManager.Shared.OptOut(OnOptOutComplete);
}
private void OnOptOutComplete(bool success, string error){
if(success){
Debug.Log("Opt Out processed successfully");
}
else{
Debug.LogError("Opt out error " + error);
}
}
Upon receiving this information, Apptilaus will erase the user's data and the Apptilaus SDK will stop tracking the user. No requests from this device will stored by Apptilaus in the future.
You can optionally set your internal user ID string to track user purchases. It could be done at any moment, e.g. during the app launch, or after app authentication process:
ApptilausManager.Shared.UserId = "CustomId";
To use custom on-premise solution you must set BaseURL property to the URL of your server.
ApptilausManager.Shared.BaseUrl = "https://your.custom.url.here";
Build and run your app. If the build succeeds, you should carefully read the SDK logs in the console. After completing purchase, you should see the info log [Apptilaus]: Purchase Processed
.
The Apptilaus SDK is licensed under the MIT License.
Apptilaus (c) 2018-2019 All Rights Reserved
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.