TBMP骨架:为什么都是onTurnBasedMatchReceived和onInvitationReceived不叫我的物理设备上?我的、都是、骨架、不叫

2023-09-05 03:57:19 作者:蓝天拥抱白绵云

目前,即时通讯试图运行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通知。 该仿真器显示一切正常,但由于某些原因,这2种方法就是不被调用的物理设备。

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.

在code:

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.

编辑:香港专业教育学院发现的问题是behond that..While模拟器得到通知时,轮到它,即使通过玩游戏的应用心不是,我的物理设备犯规..即时通讯使用的Xperia大号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.

 
精彩推荐
图片推荐