首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Android Tapjoy offerwall从不回调

Android Tapjoy offerwall从不回调
EN

Stack Overflow用户
提问于 2013-07-06 17:53:19
回答 1查看 1.7K关注 0票数 2

我使用TapJoys offerwall为用户提供了一种获得“免费”游戏币的方法,然而,当我返回到我的活动时,offerwall从未进行过回调。

我想我有相关的工具

代码语言:javascript
复制
public class MainActivity extends BaseGameActivity implements ITimerCallback, 
     TapjoyAwardPointsNotifier, TapjoyEarnedPointsNotifier, TapjoyNotifier {

而且我确实连接到了服务器。

代码语言:javascript
复制
// Enables logging to the console.
TapjoyLog.enableLogging(true);

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

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

我这样调用offerwall

代码语言:javascript
复制
TapjoyConnect.getTapjoyConnectInstance().showOffersWithCurrencyID(
    currencyID, false);

以及我的回调方法,这些方法从未被调用过

代码语言:javascript
复制
@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);
}

所有的敬酒词都没有显示,日志中也没有任何内容...

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-07-06 21:49:25

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

代码语言:javascript
复制
@Override
protected void onResume()
{
    TapjoyConnect.getTapjoyConnectInstance().getTapPoints(this);
    super.onResume();
}

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

注意:最好调用getTapPoints(...)在应用程序启动和恢复时。消费和奖励积分的回调通知程序还返回用户的总虚拟货币余额,因此使用这些通知程序来更新用户拥有的货币总金额。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17501747

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档