TBMP Skeleton:为什么我的物理设备上没有调用 onTurnBasedMatchReceived 和 onInvitationReceived? [英] TBMP Skeleton: Why are both onTurnBasedMatchReceived and onInvitationReceived not called on my physical device?

查看:13
本文介绍了TBMP Skeleton:为什么我的物理设备上没有调用 onTurnBasedMatchReceived 和 onInvitationReceived?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我正在尝试运行 tbmp 骨架示例,我的设置是物理 4.2.2 android 设备和 4.3 genymotion 模拟器.

Currently, im trying to run tbmp skeleton sample and my set up is a physical 4.2.2 android device and a 4.3 genymotion emulator.

双方一切正常,除了当我在模拟器中转弯或发送邀请时我的物理设备没有显示 Toast 通知.模拟器显示一切都很好,但由于某种原因,这两种方法没有在物理设备中被调用.

Everything is working on both sides, except that my physical device isnt displaying the Toast notification when i take a turn in the emulator or when i send invitation. The emulator is displaying everything just fine, but for some reason, this 2 methods just dont get called in the physical device.

代码:

public class SkeletonActivity extends BaseGameActivity implements OnInvitationReceivedListener, OnTurnBasedMatchUpdateReceivedListener {

@Override
public void onSignInSucceeded() {
   ...

   Games.Invitations.registerInvitationListener(getApiClient(), this);

   Games.TurnBasedMultiplayer.registerMatchUpdateListener(getApiClient(), this);

}
@Override
public void onInvitationReceived(Invitation invitation) {
    Toast.makeText(
            this,
            "An invitation has arrived from "
                    + invitation.getInviter().getDisplayName(), TOAST_DELAY)
            .show();
}

@Override
public void onTurnBasedMatchReceived(TurnBasedMatch match) {
    Toast.makeText(this, "A match was updated.", TOAST_DELAY).show();
}

有什么我可能遗漏的吗?也许有一些选项可以让我的设备进行外部推送"?我到处搜索,没有找到任何东西.提前致谢.

Is there anything i might be missing? Maybe some option to allow my device to external "pushes"? I've searched everywhere and havent found anything. Thanks in advance.

我发现问题出在后面..虽然模拟器在轮到它时会收到通知,即使应用程序没有通过玩游戏打开,但我的物理设备没有..我使用的是 Xperia L 4.2.2..谢谢再次.

ive found that the problem is behond that..While the emulator gets notified when its turn starts even if the app isnt on through play games, my physical device doesnt.. Im using Xperia L 4.2.2.. Thanks again.

推荐答案

这是旧帖子,但我遇到了同样的问题,我的解决方案(2.3 设备)是:

It is old post, but i had the same problem and my solution (2.3 device) was:

转到设置 -> 帐户和同步->打开自动同步复选框

Go to the Settings -> Account and sync-> turn on Auto-sync checkbox

打开此复选框后一切正常.

After turning on this checkbox everything works fine.

这篇关于TBMP Skeleton:为什么我的物理设备上没有调用 onTurnBasedMatchReceived 和 onInvitationReceived?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆