# Adjump SDK Documentation

### Introduction

Welcome to Adjump SDK documentation, your comprehensive guide to integrating ad-based monetization solutions into your Android applications. adjump is an innovative ad monetization platform designed exclusively for Android app developers, offering a seamless and effective way to monetize your apps through ads.

**Monetization and Engagement Made Easy with Adjump**

<figure><img src="https://122674977-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4aXgU5EdA2rMVqDSDppd%2Fuploads%2FQDuYPKh7PViVJkGPsc7B%2FGroup%2048099604.png?alt=media&amp;token=6d268cc9-1a06-49fc-8f3a-355548ea5904" alt=""><figcaption></figcaption></figure>

Boost your app’s revenue and engagement seamlessly with the Adjump Offerwall. Our versatile rewarded ad unit lets you monetize through a variety of offers, including tasks, surveys, and engaging games. Users earn rewards for completing tasks, keeping them engaged while driving high eCPM and conversions for your app.

Leverage Adjump to maximize monetization, enhance user retention, and create a rewarding in-app experience.&#x20;

#### What is Adjump SDK?

Adjump SDK is a powerful tool that allows Android app developers to integrate ad-based monetization features seamlessly into their applications. With Adjump SDK, you can easily implement features such as offerwall and rewarded advertising to engage your users and maximize your app's revenue potential.

#### Key Features

* **Seamless Integration**: Adjump SDK provides a hassle-free integration process, allowing you to monetize your app with just a few lines of code.
* **Offerwall**: Implement an offerwall in your app to incentivize user engagement and earn revenue from completed offers.
* **Rewarded Advertising**: Integrate rewarded ads to provide users with incentives for interacting with ads, such as in-app currency or premium content.

#### Why Choose Adjump SDK?

* **Optimized Monetization**: Adjump SDK is designed to help you maximize your app's revenue potential by offering a variety of ad-based monetization solutions.
* **User Engagement**: By implementing features like offerwall and rewarded advertising, you can enhance user engagement and retention in your app.
* **Easy Integration**: With detailed documentation and code examples, integrating Adjump SDK into your app is quick and straightforward, even for developers with limited experience.

#### Getting Started

Ready to start monetizing your Android app with Adjump SDK? Check out our documentation guide to learn how to integrate adjump SDK into your app and get started with ad-based monetization.

***

Feel free to customize and expand upon this draft to create an introduction page that best suits your documentation needs and effectively communicates the benefits of using Adjump SDK to your audience.


# SDK Setup

### To implement the Adjump SDK in your project using Gradle, follow these steps:

1. Open your project's `build.gradle` file.
2. Inside the `dependencies` block, add the following line:

{% tabs %}
{% tab title="Java" %}

```gradle
implementation("io.leadmint.adjump:offerwall:1.0.4")
```

{% endtab %}

{% tab title="Kotlin" %}

```gradle
implementation("io.leadmint.adjump:offerwall:1.0.4")
```

{% endtab %}
{% endtabs %}

3. Sync your project with Gradle by clicking on the "Sync Now" button in Android Studio or running the `./gradlew` command in your project directory.
4. Once the project is synced, you can start using the Adjump SDK in your project.

Here's how your `build.gradle` file should look after adding the dependency:

{% tabs %}
{% tab title="Java" %}

```gradle
dependencies {
    // Other dependencies...
   implementation("io.leadmint.adjump:offerwall:1.0.4")
}
```

{% endtab %}

{% tab title="Kotlin" %}

```gradle
dependencies {
    // Other dependencies...
    implementation("io.leadmint.adjump:offerwall:1.0.4")
}
```

{% endtab %}
{% endtabs %}

After adding the dependency, Gradle will automatically download the Adjump SDK and include it in your project. You can then start using the SDK's features in your app.


# SDK Initialization

### Initializing the AdJump.

You must initialize the AdJump SDK before you can use any of its features.

{% tabs %}
{% tab title="Java" %}

```java
AdJump adjump = new AdJump(Context context, String accountid, String appid, String userId);
```

{% endtab %}

{% tab title=" Kotlin" %}

```kotlin
val adjump = AdJump(context:Context, accountid:String, appId:String, userId:String)
```

{% endtab %}
{% endtabs %}

The parameters to this call are as follows:

| Parameter | Description                                              |
| --------- | -------------------------------------------------------- |
| context   | Your application's context.                              |
| accountId | Your Adjump account id.                                  |
| appId     | Your Adjump application id.                              |
| userId    | The registered User Id associated with your application. |

### **Initialize AdJump SDK**:

Initialize the AdJump OfferWall SDK by invoking the `initialize` function

{% tabs %}
{% tab title="Java" %}

```java
AdJump.InitialisationListener initialisationListener = new AdJump.InitialisationListener() {
            @Override
            public void onInitialisationSuccess() {
                runOnUiThread(() -> {
                    Log.i("AdJump", "Initialization Success");
                });
            }

            @Override
            public void onInitialisationError(Exception exception) {
                runOnUiThread(() -> {
                    Log.e("AdJump", "Initialization Error: " + exception.getMessage());
                });
            }
        };
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
val initListener = object : AdJump.InitialisationListener {
    override fun onInitialisationSuccess() {
        runOnUiThread {
            Log.i("AdJump", "Initialization Success")
        }
    }

    override fun onInitialisationError(exception: Exception) {
        runOnUiThread {
            Log.e("AdJump", "Initialization Error: ${exception.message}")
        }
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Java" %}

```java
Boolean showBottomSheet = true //Make this true. 
//If you want to show the Special Offer BottomSheet.
adJump.initialize(initialisationListener, showBottomSheet);

//show the bottom sheet.
adJump.showBottomSheet((Activity) context);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
adJump.initialize(listener = initialisationListener, showBottomSheet=false);

adJump.showBottomSheet(context as Activity);
```

{% endtab %}
{% endtabs %}

### Open the Adjump offerwall

To initiate the OfferWall, simply invoke the `launchOfferWall` method.

{% tabs %}
{% tab title="Java" %}

```java
if (adjump.isAvailable()) {
adjump.launchOfferWall(); 
} else {
// show some message or alert when adjump is not available!
// or reinitialize Adjump
}
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
if (adjump.isAvailable) {
    adjump.launchOfferWall()
} else {
    // show some message or alert when adjump is not available!
    // or reinitialize Adjump
}

```

{% endtab %}
{% endtabs %}


# ProGuard Rules

### Adjump ProGuard Rules

To ensure that Adjump functionalities work smoothly with ProGuard enabled, add the following ProGuard rule:

{% code title="proguard-rules.pro" %}

```
-keep class io.adjump** { *; }
```

{% endcode %}

This rule preserves all classes within the `io.adjump.model` package and its subpackages from being obfuscated by ProGuard.

Make sure to include this rule in your ProGuard configuration file to prevent any issues with Adjump integration.


# SDK Setup

### To implement the Adjump SDK in your project using Gradle, follow these steps:

1. Open your project's `build.gradle` file.
2. Inside the `dependencies` block, add the following line:

{% tabs %}
{% tab title="Java" %}

```gradle
implementation 'io.leadmint.adjump:offerwall:1.0.1'
```

{% endtab %}

{% tab title="Kotlin" %}

```gradle
implementation("io.leadmint.adjump:offerwall:1.0.1")
```

{% endtab %}
{% endtabs %}

3. Sync your project with Gradle by clicking on the "Sync Now" button in Android Studio or running the `./gradlew` command in your project directory.
4. Once the project is synced, you can start using the Adjump SDK in your project.

Here's how your `build.gradle` file should look after adding the dependency:

{% tabs %}
{% tab title="Java" %}

```gradle
dependencies {
    // Other dependencies...
   implementation 'io.leadmint.adjump:offerwall:1.0.1'
}
```

{% endtab %}

{% tab title="Kotlin" %}

```gradle
dependencies {
    // Other dependencies...
    implementation("io.leadmint.adjump:offerwall:1.0.1")
}
```

{% endtab %}
{% endtabs %}

After adding the dependency, Gradle will automatically download the Adjump SDK and include it in your project. You can then start using the SDK's features in your app.


# SDK Initialization

### Add Native Module Files

Download the following files and add them to your Android app's module directory:

{% file src="/files/StoE6TZWWe5Nb0LjPHyv" %}

{% file src="/files/RRtyOjT7rOaiXJqBc7wN" %}

### Register the Module

In your `MainApplication` file, locate the `getPackages()` method and register the Adjump SDK module by adding the following line:

{% tabs %}
{% tab title="Java" %}

```java
@Override
protected List<ReactPackage> getPackages() {
    // Get the list of packages
    List<ReactPackage> packages = new PackageList(this).getPackages();
    
    // Add the Adjump SDK package to the list
    packages.add(new AdjumpSdkPackage());
    
    return packages;
}
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
override fun getPackages(): List<ReactPackage> {
    // Get the list of packages
    val packages = PackageList(this).packages
    
    // Add the Adjump SDK package to the list
    packages.add(AdjumpSdkPackage())
    
    return packages
}

```

{% endtab %}
{% endtabs %}

### **Initialize AdJump SDK**: <a href="#initialize-adjump-sdk" id="initialize-adjump-sdk"></a>

```javascript
adjump.initialize(accountId, appId, userId, 
  (message) => {
    console.log(message); // You can optionally log the success message
  }, 
  (error) => {
    console.error(error);
  }
);

```

The parameters to this call are as follows:

| Parameter | Description                                              |
| --------- | -------------------------------------------------------- |
| accountId | Your Adjump account id.                                  |
| appId     | Your Adjump application id.                              |
| userId    | The registered User Id associated with your application. |

### Open the Adjump offerwall

To initiate the OfferWall, simply invoke the `launchOfferWall`method.

```javascript
adjump.launchOfferWall((successMessage) => {
  Alert.alert("Success", successMessage);
}, (errorMessage) => {
  Alert.alert("Error", errorMessage);
});


```


# ProGuard Rules

### Adjump ProGuard Rules

To ensure that Adjump functionalities work smoothly with ProGuard enabled, add the following ProGuard rule:

{% code title="proguard-rules.pro" %}

```
-keep class io.adjump** { *; }
```

{% endcode %}

This rule preserves all classes within the `io.adjump.model` package and its subpackages from being obfuscated by ProGuard.

Make sure to include this rule in your ProGuard configuration file to prevent any issues with Adjump integration.


# SDK Setup

Adjump is an offerwall monetization SDK that enables Flutter apps to launch a native Android offerwall. This Docs walks you through integrating and using Adjump within your Flutter project.

***

### 🚀 Features

* Easy integration with Flutter and native Android
* Simple method channel-based communication
* Automatic handling of SDK initialization and offerwall launch

***

### 🧰 Requirements

* Flutter SDK (2.10+ recommended)
* Android SDK (API 24+)
* Kotlin 1.5+
* Gradle 7.0+
* Internet permission

***

### 📦 Installation

#### 1. Flutter Project Setup

No need to install a Flutter package. The communication is done using a `MethodChannel`.

#### 2. Android Native Setup

Navigate to `android/app/build.gradle` and add this inside the `dependencies` block:

```groovy
implementation("io.leadmint.adjump:offerwall:1.0.1")
```

Also ensure your app has internet permission in `AndroidManifest.xml`:

```xml
<uses-permission android:name="android.permission.INTERNET" />
```

***


# SDK Initialization

### 🧑‍💻 Integration Guide

#### 1. Flutter Implementation

In your `main.dart` file:

```dart
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  static const platform = MethodChannel('com.example.offerwall_app');

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('AdJump Example')),
        body: Center(
          child: ElevatedButton(
            onPressed: () {
              _launchOfferWall();
            },
            child: Text('Launch OfferWall'),
          ),
        ),
      ),
    );
  }

  Future<void> _launchOfferWall() async {
    try {
      final Map<String, String> params = {
        'accountId': 'YOUR_ACCOUNT_ID',
        'appId': 'YOUR_APP_ID',
        'userId': 'USER_ID',
      };
      await platform.invokeMethod('launchOfferWall', params);
    } on PlatformException catch (e) {
      print("Failed to show offer wall: '${e.message}'.");
    }
  }
}
```

#### 2. Android Implementation

In your `MainActivity.kt`:

```kotlin
package com.example.adjump

import android.widget.Toast
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel
import io.adjump.offerwall.AdJump

class MainActivity : FlutterActivity() {
    private val CHANNEL = "com.example.offerwall_app"
    private var adJump: AdJump? = null

    override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
        super.configureFlutterEngine(flutterEngine)

        MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL)
            .setMethodCallHandler { call, result ->
                when (call.method) {
                    "launchOfferWall" -> {
                        val arguments = call.arguments as? Map<*, *>
                        if (arguments != null) {
                            val accountId = arguments["accountId"] as? String
                            val appId = arguments["appId"] as? String
                            val userId = arguments["userId"] as? String

                            if (accountId != null && appId != null && userId != null) {
                                adJump = AdJump(this, accountId, appId, userId)
                                launchOfferWall()
                                result.success("Offer wall launched")
                            } else {
                                result.error("INVALID_ARGUMENTS", "Missing required parameters", null)
                            }
                        } else {
                            result.error("INVALID_ARGUMENTS", "Arguments are required", null)
                        }
                    }
                    else -> result.notImplemented()
                }
            }
    }

    private fun launchOfferWall() {
        adJump?.initialize(object : AdJump.InitialisationListener {
            override fun onInitialisationSuccess() {
                runOnUiThread { Toast.makeText(this@MainActivity, "AdJump SDK Initialized", Toast.LENGTH_SHORT).show() }
                if (adJump?.isAvailable == true) {
                    adJump?.launchOfferWall()
                } else {
                    Toast.makeText(this@MainActivity, "Offerwall not available!", Toast.LENGTH_SHORT).show()
                }
            }

            override fun onInitialisationError(exception: Exception) {
                runOnUiThread { Toast.makeText(this@MainActivity, "Initialization failed: ${exception.message}", Toast.LENGTH_SHORT).show() }
            }
        })
    }
}
```

***

### 🔑 Configuration

1. Replace the placeholder values in your Flutter code with your actual Adjump credentials:
   * `YOUR_ACCOUNT_ID`: Your Adjump account identifier
   * `YOUR_APP_ID`: Your application identifier
   * `USER_ID`: The user identifier for the current session
2. Make sure the method channel name matches in both Flutter and Android code:

   ```dart
   static const platform = MethodChannel('com.example.offerwall_app');
   ```

***

### 🧪 Testing

* Make sure you're running on a physical Android device or emulator with internet access
* Log output and Toast messages will indicate:
  * SDK initialization status
  * Offerwall availability
  * Any errors that occur during the process

***

### ❓ FAQ

**Q: Does it support iOS?**\
A: No, this SDK currently supports Android only.

**Q: Where do I get my `accountId`, `appId`, and `userId`?**\
A: These are provided by the Adjump platform once you're onboarded.

**Q: What happens if the credentials are invalid?**\
A: The SDK will show an error message through a Toast notification and log the error details.

***


# ProGuard Rules

### Adjump ProGuard Rules

To ensure that Adjump functionalities work smoothly with ProGuard enabled, add the following ProGuard rule:

{% code title="proguard-rules.pro" %}

```
-keep class io.adjump** { *; }
```

{% endcode %}

This rule preserves all classes within the `io.adjump.model` package and its subpackages from being obfuscated by ProGuard.

Make sure to include this rule in your ProGuard configuration file to prevent any issues with Adjump integration.


# S2S Postback Setup

## Server-to-server payout

To facilitate the delivery of rewards to your users, Adjump offers a secure and transparent method known as **Server-to-Server Payouts**. This approach ensures that you have full control over how rewards are distributed and provides enhanced security for your users' benefits.

To notify you about rewards and deliver relevant information, Adjump will initiate an **HTTP GET request** to your configured endpoint.

<figure><img src="https://122674977-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4aXgU5EdA2rMVqDSDppd%2Fuploads%2FJW1K9NvRjOmyjfJOsR5e%2FPostback%20empty.png?alt=media&amp;token=0b46f209-7aca-4069-a0c8-1bbcb04c55cc" alt=""><figcaption></figcaption></figure>

Enter User ID and Reward Amount to verify the Postback. (refer the image below)

<figure><img src="https://122674977-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4aXgU5EdA2rMVqDSDppd%2Fuploads%2FZNpt69AF9Ltj07hsAnDw%2FPostback%20Filled.png?alt=media&amp;token=b01a4789-593d-4b6e-9b81-d5714ebfc218" alt=""><figcaption></figcaption></figure>

**Example  URL:**

```url
https://baseURL/hitpoint?[YourParamName]={user_id}&[YourParamName]={reward_amount}
```

<table data-header-hidden><thead><tr><th width="256">Parameter</th><th>Detail</th><th data-hidden>Type</th></tr></thead><tbody><tr><td>Parameter</td><td>Detail</td><td>Format</td></tr><tr><td>user_id</td><td>This parameter uniquely identifies the eligible user to receive rewards.</td><td>string</td></tr><tr><td>reward_amount</td><td>This parameter indicates the rewards earned.</td><td>string</td></tr></tbody></table>


