# Reward User

#### 1. Fully Managed by MyChips

{% hint style="info" %}
Use this method only if you have selected Self-Managed Currency. If you already support S2S postback please skip this snippet.
{% endhint %}

**1.1 Implements the Interface in your MainActivity**

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

```java
public class MainActivity implements RewardCallback {
  ...
    @Override
    public void OnRewardReceived(RewardDTO rewardDTO) {
         //rewardDTO.GetRewardInVirtualCurrency()
         //HANDLE HERE YOUR CUSTOM LOGIC
    }

    @Override
    public void onError(Exception e) {

    }
...
}
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
class MainActivity : RewardCallback {
   ...
     override fun onRewardReceived(rewardDTO: RewardDTO) {
        // Handle reward received logic here
        //rewardDTO.GetRewardInVirtualCurrency()
    }

    override fun onRewardError(e: Exception) {
        // Handle error here
    }
  ...
}
```

{% endtab %}
{% endtabs %}

#### 1.2 Check for new reward at app open and app resume

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

```java
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ...
        MCOfferwallSDK.CheckReward("your adunit here",this);
        ...
}

@Override
    protected void onResume() {
        super.onResume();
        MCOfferwallSDK.CheckReward("your adunit here",this);
}

```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    ...
    MCOfferwallSDK.CheckReward(adUnitId, this)
}

override fun onResume() {
    super.onResume()
    MCOfferwallSDK.CheckReward(adUnitId, this)
}
```

{% endtab %}
{% endtabs %}

#### 2. Server-to-Server (S2S) Postbacks

If you prefer server-to-server communication, MyChips can send a postback to your server with bonus information. The configuration for postbacks is available in your publisher dashboard. This method is useful for validating and securely rewarding users without client-side manipulation.&#x20;

If you are testing in Sandbox mode, the value of the macro {user\_payout} will be 0.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mychips.io/android/reward-user.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
