Register

In order for us to know how we can best assist you, please select the best option that describes you

I have encountered a problem or didn't get my credit

I want to promote a product, website or app

I want to monetize my app or website

Instant manager

Remaining: 255 Maximum of 255 characters.

Terms and Conditions

Yes! You’re with us!

Thank you for choosing OfferToro! We will contact you shortly!

Already have an account? Log in

Password reset

Please enter your email address below

< Back to login

Android SDK (version 5)

1. Introduction

The OfferToro Android SDK gives Android developers an easy way to integrate the OfferToro OfferWall into their native Android apps. Before you can integrate our SDK, you must first Create a Publisher Account, then Create an App Placement. The OfferToro Android SDK can be downloaded from your publisher account under the SDK section.

Note: From SDK version 4.1.0 and on, please make sure the app monetization tool you are using is 'SDK - Android'. Please make sure the monetization tool of the app you are using matches the required monetization tool of the integration. An integration with wrong monetization tool might not work.

2. Getting Started

OfferToro SDK requires minimum Android API level 21 (Android 5 - Lollipop).
To integrate the SDK into your project, please follow the simple steps described below:

Step 1. Add the OfferToroSdk to your project
OfferToroSdk-v5.0.aar file should be added to your project libs folder.

Step 2. Add following code to your Gradle file:
The following code should be added to your settings.gradle file:


    flatDir {
        dirs (rootDir.absolutePath + '/app/libs')
    }

                

Example:

In the app's build.gradle file:


    dependencies {
        ...
        implementation(name: 'OfferToroSdk-v5.0', ext: 'aar')
    }

                
3. OfferWall

Step 1. Initialize the OfferWall
In order to initialize OfferWall , the following parameters should be passed in initialization call: secret key, app id and user id. The call should look similar to:


    import com.eagletech.eagletechsdkandroid.OfferWall;
    import com.eagletech.eagletechsdkandroid.OfferWallListener;


    ... 
    // set your App Secret Key 
    public static final String YOUR_OW_SECRET_KEY = "";

    // set your App's ID
    public static final String YOUR_OW_APP_ID = "";

    // set your User's unique ID
    public static final String YOUR_OW_USER_ID = "";

    // initialize offerwall
    OfferWall.getInstance().setConfig(YOUR_OW_APP_ID, YOUR_OW_SECRET_KEY, YOUR_OW_USER_ID);
    

                

NOTES:

- APPID and SECRET_KEY can be found in your OfferToro account, under your "App Placement" settings.

- UserID, is a parameter which should be passed from your end as an id for each end user of your app. User IDs should be URL encoded.

You can also pass extra SubIDs by adding them after the 3 parameters (APPID, SECRET_KEY, USER_ID) in the function setConfig():


    OfferWall.getInstance().setConfig(YOUR_OW_APP_ID, YOUR_OW_SECRET_KEY, YOUR_OW_USER_ID, SUB_ID1, SUB_ID2, SUBID_3);

                

You can pass up to 3 SubIDs.

HTTP Schema

If you need to use non-secured requests (http://), you can configure it as follows:


    ...
    OfferWall.getInstance().useHttpSchema(true);

                

When using this, the server URL will use http:// instead of https://. Please also note that you need to enable Cleartext in your AndroidManifest when using this feature: 1. android:usesCleartextTraffic="true" 2. android:networkSecurityConfig="@xml/network_security_config"> - create a file named network_security_config.xml inside the res/xml folder. The contents of this file should be: Example:


<application
        ...
        android:usesCleartextTraffic="true"
        android:networkSecurityConfig="@xml/network_security_config" >

                
4. Displaying the OfferWall
a. After successfully setting the configuration keys, OfferWall could be displayed into the app. For displaying the OfferWall showOfferWall() method should be called:

    OfferWall.getInstance().showOfferWall(activity);

                    
b. You can also retrieve the user's completed offers. To do so, the getUserWallCredits() function should be called:

    OfferWall.getInstance().getUserWallCredits();

                    

A specific timestamp can be sent to mark the start datetime of the conversions. A maximum of 2 months ago can be retrieved, and is the default.


    OfferWall.getInstance().getUserWallCredits(1693760652);

                    

c. Implement OfferWall listeners
The OfferToro SDK gives a possibility to be notified of events happening in OfferWall lifecycle via OfferWall listeners.

The following listeners are available:

onOfferWallInitSuccess() - invoked when OfferWall is successfully initialized;

onOfferWallInitFail(string errorMessage) - invoked when OfferWall initialization fails and receives (@param errorMessage) describing the reason for fail;

onOfferWallOpened() - invoked when OfferWall is displayed;

onOfferWallOfferClicked(String offer_id) - invoked when an Offer is clicked.

(deprecated) onOfferWallCredited(double credits, double totalCredits) - receive user's balance (@param totalCredits) and the amount of credits the user has earned (@param credits) since the last update.
However, it is not the precise way to calculate the user's balance. For a more robust way, please use the Server-to-Server postbacks instead. The listener could also be updated at any point of time by calling getOTOfferWallCredits() method;

onOfferLoadFail(String errorMessage) - invoked when the OfferWall fails to load.

onOTOfferWallClosed() - invoked when OfferWall is closed.

onOfferWallGetUserCredits(JSONArray obj) - to receive all of the user's completed offers, this listener can be called. The output will be of type JSONArray object. Example response:
{"status":"","response":[{"conversion_id":"11223344","amount":"300.000","timestamp":"1688407614"},{"conversion_id":"11223345","amount":"5.445","timestamp":"1688407615"},{"conversion_id":"11223346","amount":"3.267","timestamp":"1688407615"}]}

onOfferWallGetUserCreditsError(String errorMessage) - when invoking onOfferWallGetUserCredits and an error is encountered, this listener will be called.

To be notified of OfferWall events, setOfferWallListener(OfferWallListener listener) method should be called:

    OfferWall.getInstance().setOfferWallListener(OfferWallListener listener);

                    

This is the latest version of SDK. If you're looking for the old version, you can find it here.