myChips SDK
  • Introduction
  • Getting Started
    • Create a Publisher Account
    • Create your App/Site
    • Create an AdUnit
    • Test in Sanbox mode
  • Reward Handling
    • Webhook S2S Postback
    • Validating the Webhook S2S
    • Rejected S2S Webhook Postback
  • Billing
  • Unity
    • Install SDK
    • Reward User
    • FAQ
  • Android
    • Install SDK
    • Reward User
  • React Native
    • Install SDK
    • Reward User
  • RN Expo
    • Install SDK
    • Reward User
  • iOS
    • Install SDK
    • Reward User
  • Flutter
    • Install SDK
    • Reward User
  • iFrame
  • WebView & Direct Link
  • Revenue API
Powered by GitBook
On this page
  1. Android

Reward User

1. Fully Managed by MyChips

Use this method only if you have selected Self-Managed Currency. If you already support S2S postback please skip this snippet.

1.1 Implements the Interface in your MainActivity

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

    @Override
    public void onError(Exception e) {

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

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

1.2 Check for new reward at app open and app resume

@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);
}
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    ...
    MCOfferwallSDK.CheckReward(adUnitId, this)
}

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

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.

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

PreviousInstall SDKNextReact Native

Last updated 7 days ago