未调用代理方法 - Google Turn-based Match Delegate

时间:2015-11-10 15:34:46

标签: android ios objective-c delegates google-play-games

问题: 我正在尝试使用iOS Google Play SDK创建一个使用自动匹配的回合制游戏,而GPGTurnBasedMatchDelegate似乎无法正常工作。这是我的情况:

  1. 玩家1开始自动比赛并轮流
  2. 玩家2加入自动比赛并轮流
  3. 什么都没发生......从我读过的所有内容中,应该调用以下方法:

    -(void)didReceiveTurnEventForMatch:(GPGTurnBasedMatch *)match participant:(GPGTurnBasedParticipant *)participant fromPushNotification:(BOOL)fromPushNotification
    
  4. 调用此方法的唯一时间是当我显示所有当前匹配时:

    [GPGManager sharedInstance].statusDelegate = self;
    [[GPGLauncherController sharedInstance] presentTurnBasedMatchList];
    

    我的代码结构的方式是我有一个GameManager单例,它在init方法中被设置为委托,并包含“didReceiveTurnEventForMatch”方法。

    -(instancetype) init {
        if (self = [super init]){
            [GPGManager sharedInstance].statusDelegate = self;
            [GPGManager sharedInstance].turnBasedMatchDelegate = self;
            self.isSilentlySigningIn = [[GPGManager sharedInstance] signInWithClientID:kClientID silently:YES];
        }
        return self;
    }
    
    -(void)didReceiveTurnEventForMatch:(GPGTurnBasedMatch *)match participant:(GPGTurnBasedParticipant *)participant fromPushNotification:(BOOL)fromPushNotification {
        NSLog(@"Hooray! Received an event in a match! %@", match);
    }
    

    问题: 我在这里错过了什么吗?我应该期望这种委托方法的工作方式不同吗?

    Android看起来有类似的问题:link

0 个答案:

没有答案