Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
620 views
in Technique[技术] by (71.8m points)

android - TBMP Skeleton: Why are both onTurnBasedMatchReceived and onInvitationReceived not called on my physical device?

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.

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.

The 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.

EDIT: 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...