Android Tapjoy Offerwall 从不回调

标签 android callback andengine tapjoy

我使用 TapJoys 优惠墙为用户提供了一种获取“免费”游戏币的方式,但是,当我返回 Activity 时,优惠墙永远不会进行回调。

我想我有相关的工具

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

我确实连接到了服务器。

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

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

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

我这样称呼优惠墙

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

我的回调方法永远不会被调用

@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);
}

没有显示任何 toast,日志中也没有任何内容...

最佳答案

在我的游戏中,我这样做是为了让它发挥作用

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

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

注意:最好在应用程序启动和恢复时调用 getTapPoints(...)。 SPEND 和 AWARD 积分的回调通知程序还会返回用户的总虚拟货币余额,因此请使用它们来更新用户拥有的货币总量。

关于Android Tapjoy Offerwall 从不回调,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17501747/

相关文章:

安卓。如何从我的应用程序中读取 Aztec 代码?

android - Flutter验证器仅在双击时触发

android - AndEngine 上的示例

java - 如果 Andengine 项目的源代码适用于 Android,我如何将其作为 Java 应用程序运行?

android - 从 sqlite 数据库中检索特定的表项

android - 如何减小应用程序 (.apk) 大小

javascript - NodeJS 回调中的局部变量

jquery - 从blur()调用实际函数

javascript - Node.js 和同步 API 函数

安卓 : AndEngine pixel perfect collision GLES2?