androidcallbackandenginetapjoy

Android Tapjoy offerwall never makes callback


I am using TapJoys offerwall to give the users a way to get "free" game coins for stuff, however, the offerwall never makes the callback when i return to my activity.

I think i have the relevant implements

public class MainActivity extends BaseGameActivity implements ITimerCallback, 
     TapjoyAwardPointsNotifier, TapjoyEarnedPointsNotifier, TapjoyNotifier {

and i do connect to the server.

// Enables logging to the console.
TapjoyLog.enableLogging(true);

// Connect with the Tapjoy server.     
TapjoyConnect.requestTapjoyConnect(getApplicationContext(), appID, secretKey);

TapjoyConnect.getTapjoyConnectInstance().setEarnedPointsNotifier(MainActivity.this);

I call the offerwall like this

TapjoyConnect.getTapjoyConnectInstance().showOffersWithCurrencyID(
    currencyID, false);

And my callback methods that never gets called

@Override
public void earnedTapPoints(int amount) {
    displayText = "Earned points: " + amount;
    Log.d(TAG, displayText);

    gameToast(displayText);
}

@Override
public void getUpdatePoints(String currencyName, int pointTotal) {
    displayText = "Earned points: " + pointTotal;
    Log.d(TAG, displayText);

    gameToast(displayText);
}

@Override
public void getUpdatePointsFailed(String error) {
    Log.d(TAG, error);

    gameToast(displayText);    
}

@Override
public void getAwardPointsResponse(String s, int i) {
    displayText = s + i;
    Log.d(TAG, displayText);

    gameToast(displayText);
}

@Override
public void getAwardPointsResponseFailed(String s) {
    Log.d(TAG, s);

    gameToast(s);
}

None of the toasts get shown and there is nothing in the log...


Solution

  • in my game I did it to make it work

    @Override
    protected void onResume()
    {
        TapjoyConnect.getTapjoyConnectInstance().getTapPoints(this);
        super.onResume();
    }
    

    https://knowledge.tapjoy.com/en/integration/managed-currency

    NOTE: It is best to call getTapPoints(...) on application startup and resume. The callback notifiers for SPEND and AWARD points also return the total virtual currency balance of the user, so use these to update the total amount of currency the user has.