Skip to content

implustech/unity_subscriptions_sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apptilaus Subscriptions SDK for Unity

Tweet Platform Language License 

Overview

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.

Table of contents


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.


Prerequisite

Before adding ApptilausSDK to your project make sure you've successfully downloaded and integrated Unity IAP package.


Add the SDK to your project

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.


Initial Setup

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.

Depending on whether or not you build your app for extended analytics integrations, you might consider to enable sessions tracking.


Register Subscriptions

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;
	}

Register Subscriptions with parameters

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;
	}

Advanced Setup

Session tracking

To register sessions you must perform the steps outlined above. See Enable Session Tracking.


GDPR Right to Erasure

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.


User Enrichment

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";

On-premise Setup

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 your app

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.


Licence and Copyright

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.

Analytics

About

Analyse subscriptions and trial conversions with Apptilaus Unity SDK

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages