不适用于Unity3D的Google Play游戏插件的邀请

时间:2017-07-08 17:06:45

标签: unity3d google-play-games multiplayer

我正在Unity3D开发一款Android多人游戏。我正在为Unity3D使用Google Play游戏服务插件。我已经完成了身份验证和随机配对部分没有任何问题但是,当我尝试使用邀请创建游戏时,它根本不起作用。我打电话给方法,它显示发送邀请的屏幕,选择播放器并发送邀请但是没有收到另一端。不知道这是什么问题。无论是发送还是不发送,都不知道。请帮忙。

插件激活和身份验证代码:

PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
    .RequestEmail()
    .RequestServerAuthCode(false)
    .RequestIdToken()
    .Build();

PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.Activate();

// Logging in user
Social.localUser.Authenticate((bool success) => { });

发送邀请的代码:

PlayGamesPlatform.Instance.RealTime.CreateWithInvitationScreen(1, 1, 1, this);

接收邀请的代码:

PlayGamesPlatform.Instance.RealTime.AcceptFromInbox(this);
PlayGamesPlatform.Instance.RealTime.GetInvitation();

这是从“开始游戏”到“发送邀请”的logcat

07-10 00:18:53.789    1272-2892/? W/XSpaceManagerService﹕ checkXSpaceControl, from:com.miui.home, to:com.apptech.boxstacker, with act:android.intent.action.MAIN, callingUserId:0, toUserId:0
07-10 00:18:53.798    1272-2892/? I/ActivityManager﹕ START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.apptech.boxstacker/com.unity3d.player.UnityPlayerActivity bnds=[845,604][1013,772] (has extras)} from uid 10023 on display 0
07-10 00:18:53.840    1272-3245/? I/ActivityManager﹕ Start proc 17122:com.apptech.boxstacker/u0a528 for activity com.apptech.boxstacker/com.unity3d.player.UnityPlayerActivity
07-10 00:18:58.141    1272-1283/? I/ActivityManager﹕ START u0 {act=com.google.android.gms.auth.GOOGLE_SIGN_IN cmp=com.apptech.boxstacker/com.google.android.gms.auth.api.signin.internal.SignInHubActivity (has extras)} from uid 10528 on display 0
07-10 00:19:23.691    1272-5569/? I/ActivityManager﹕ START u0 {cmp=com.apptech.boxstacker/com.google.games.bridge.NativeBridgeActivity (has extras)} from uid 10528 on display 0
07-10 00:19:23.740    1272-3250/? W/XSpaceManagerService﹕ checkXSpaceControl, from:com.apptech.boxstacker, to:com.google.android.play.games, with act:com.google.android.gms.games.SELECT_OPPONENTS_REAL_TIME, callingUserId:0, toUserId:0
07-10 00:20:47.411    1272-3258/? I/ActivityManager﹕ Killing 17122:com.apptech.boxstacker/u0a528 (adj 9): RecentTasksManager
07-10 00:20:47.536    1272-3108/? D/ActivityManagerInjector﹕ com.apptech.boxstacker is killed by AMS with adj 16 ,do not allow restart
07-10 00:20:47.540    1272-1283/? I/WindowState﹕ WIN DEATH: Window{ec3249a u0 com.apptech.boxstacker/com.unity3d.player.UnityPlayerActivity}
07-10 00:20:57.925    1272-3108/? W/XSpaceManagerService﹕ checkXSpaceControl, from:com.miui.home, to:com.apptech.boxstacker, with act:android.intent.action.MAIN, callingUserId:0, toUserId:0
07-10 00:20:57.936    1272-3108/? I/ActivityManager﹕ START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.apptech.boxstacker/com.unity3d.player.UnityPlayerActivity bnds=[845,604][1013,772] (has extras)} from uid 10023 on display 0
07-10 00:20:57.962    1272-5569/? I/ActivityManager﹕ Start proc 17464:com.apptech.boxstacker/u0a528 for activity com.apptech.boxstacker/com.unity3d.player.UnityPlayerActivity
07-10 00:21:01.362    1272-8353/? I/ActivityManager﹕ START u0 {act=com.google.android.gms.auth.GOOGLE_SIGN_IN cmp=com.apptech.boxstacker/com.google.android.gms.auth.api.signin.internal.SignInHubActivity (has extras)} from uid 10528 on display 0
07-10 00:22:11.341    1272-3258/? I/ActivityManager﹕ START u0 {cmp=com.apptech.boxstacker/com.google.games.bridge.NativeBridgeActivity (has extras)} from uid 10528 on display 0
07-10 00:22:11.422    1272-2792/? W/XSpaceManagerService﹕ checkXSpaceControl, from:com.apptech.boxstacker, to:com.google.android.play.games, with act:com.google.android.gms.games.SELECT_OPPONENTS_REAL_TIME, callingUserId:0, toUserId:0
07-10 00:25:44.341    1272-3104/? I/ActivityManager﹕ Killing 17464:com.apptech.boxstacker/u0a528 (adj 9): RecentTasksManager
07-10 00:25:44.446    1272-2792/? I/WindowState﹕ WIN DEATH: Window{3783980 u0 com.apptech.boxstacker/com.unity3d.player.UnityPlayerActivity}
07-10 00:25:44.446    1272-5569/? D/ActivityManagerInjector﹕ com.apptech.boxstacker is killed by AMS with adj 16 ,do not allow restart
07-10 00:26:22.618    1272-8354/? W/XSpaceManagerService﹕ checkXSpaceControl, from:com.miui.home, to:com.apptech.boxstacker, with act:android.intent.action.MAIN, callingUserId:0, toUserId:0
07-10 00:26:22.631    1272-8354/? I/ActivityManager﹕ START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.apptech.boxstacker/com.unity3d.player.UnityPlayerActivity bnds=[845,604][1013,772] (has extras)} from uid 10023 on display 0
07-10 00:26:22.678    1272-2792/? I/ActivityManager﹕ Start proc 18011:com.apptech.boxstacker/u0a528 for activity com.apptech.boxstacker/com.unity3d.player.UnityPlayerActivity
07-10 00:26:26.049    1272-3104/? I/ActivityManager﹕ START u0 {act=com.google.android.gms.auth.GOOGLE_SIGN_IN cmp=com.apptech.boxstacker/com.google.android.gms.auth.api.signin.internal.SignInHubActivity (has extras)} from uid 10528 on display 0
07-10 00:32:38.332    1272-8353/? I/ActivityManager﹕ Killing 18011:com.apptech.boxstacker/u0a528 (adj 9): RecentTasksManager
07-10 00:32:38.448    1272-3256/? D/ActivityManagerInjector﹕ com.apptech.boxstacker is killed by AMS with adj 16 ,do not allow restart
07-10 00:32:38.449    1272-3257/? I/WindowState﹕ WIN DEATH: Window{d49ea64 u0 com.apptech.boxstacker/com.unity3d.player.UnityPlayerActivity}
07-10 00:32:45.549    1272-2792/? W/XSpaceManagerService﹕ checkXSpaceControl, from:com.miui.home, to:com.apptech.boxstacker, with act:android.intent.action.MAIN, callingUserId:0, toUserId:0
07-10 00:32:45.559    1272-2792/? I/ActivityManager﹕ START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.apptech.boxstacker/com.unity3d.player.UnityPlayerActivity bnds=[845,604][1013,772] (has extras)} from uid 10023 on display 0
07-10 00:32:45.588    1272-3256/? I/ActivityManager﹕ Start proc 18549:com.apptech.boxstacker/u0a528 for activity com.apptech.boxstacker/com.unity3d.player.UnityPlayerActivity
07-10 00:32:49.745    1272-3250/? I/ActivityManager﹕ START u0 {act=com.google.android.gms.auth.GOOGLE_SIGN_IN cmp=com.apptech.boxstacker/com.google.android.gms.auth.api.signin.internal.SignInHubActivity (has extras)} from uid 10528 on display 0
07-10 00:54:26.982    1272-2792/? I/ActivityManager﹕ START u0 {cmp=com.apptech.boxstacker/com.google.games.bridge.NativeBridgeActivity (has extras)} from uid 10528 on display 0
07-10 00:54:27.079    1272-8354/? W/XSpaceManagerService﹕ checkXSpaceControl, from:com.apptech.boxstacker, to:com.google.android.play.games, with act:com.google.android.gms.games.SELECT_OPPONENTS_REAL_TIME, callingUserId:0, toUserId:0
07-10 00:55:06.705    1272-3257/? I/ActivityManager﹕ Killing 18549:com.apptech.boxstacker/u0a528 (adj 9): RecentTasksManager
07-10 00:55:06.829    1272-8353/? D/ActivityManagerInjector﹕ com.apptech.boxstacker is killed by AMS with adj 9 ,do not allow restart
07-10 00:55:06.830    1272-2699/? W/InputDispatcher﹕ channel 'dae87c9 com.apptech.boxstacker/com.unity3d.player.UnityPlayerActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
07-10 00:55:06.830    1272-2699/? E/InputDispatcher﹕ channel 'dae87c9 com.apptech.boxstacker/com.unity3d.player.UnityPlayerActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
07-10 00:55:06.831    1272-8353/? W/InputDispatcher﹕ Attempted to unregister already unregistered input channel 'dae87c9 com.apptech.boxstacker/com.unity3d.player.UnityPlayerActivity (server)'
07-10 00:55:26.603    1272-3256/? W/XSpaceManagerService﹕ checkXSpaceControl, from:com.miui.home, to:com.apptech.boxstacker, with act:android.intent.action.MAIN, callingUserId:0, toUserId:0
07-10 00:55:26.613    1272-3256/? I/ActivityManager﹕ START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.apptech.boxstacker/com.unity3d.player.UnityPlayerActivity bnds=[845,604][1013,772] (has extras)} from uid 10023 on display 0
07-10 00:55:26.661    1272-3250/? I/ActivityManager﹕ Start proc 20387:com.apptech.boxstacker/u0a528 for activity com.apptech.boxstacker/com.unity3d.player.UnityPlayerActivity
07-10 00:55:26.698    3097-3234/? D/WtProcessController﹕ set foreground process size 1 pid:20387pacakgeName:com.apptech.boxstacker
07-10 00:55:26.851    1272-1297/? I/ActivityManager﹕ Displayed com.apptech.boxstacker/com.unity3d.player.UnityPlayerActivity: +202ms
07-10 00:55:26.981    1272-1297/? I/Timeline﹕ Timeline: Activity_windows_visible id: ActivityRecord{802dfd9 u0 com.apptech.boxstacker/com.unity3d.player.UnityPlayerActivity t1215} time:349337916
07-10 00:55:27.081    1272-1288/? W/System.err﹕ org.json.JSONException: No value for com.apptech.boxstacker
07-10 00:55:29.735    2945-3317/? I/XiaomiFirewall﹕ firewall pkgName:com.apptech.boxstacker, result:0x0
07-10 00:55:30.298    1272-2792/? I/ActivityManager﹕ START u0 {act=com.google.android.gms.auth.GOOGLE_SIGN_IN cmp=com.apptech.boxstacker/com.google.android.gms.auth.api.signin.internal.SignInHubActivity (has extras)} from uid 10528 on display 0
07-10 00:55:30.918    1272-1297/? I/Timeline﹕ Timeline: Activity_windows_visible id: ActivityRecord{65e343f u0 com.apptech.boxstacker/com.google.android.gms.auth.api.signin.internal.SignInHubActivity t1215} time:349341854
07-10 00:55:31.392    3097-3234/? D/WtProcessController﹕ set foreground process size 1 pid:20387pacakgeName:com.apptech.boxstacker
07-10 00:55:31.778    1272-1288/? W/System.err﹕ org.json.JSONException: No value for com.apptech.boxstacker
07-10 00:55:31.798    2945-3317/? I/XiaomiFirewall﹕ firewall pkgName:com.apptech.boxstacker, result:0x0
07-10 00:55:42.427    3097-3234/? W/WtProcessController﹕ do not trim { PackageName :com.apptech.boxstacker Pid: 20387 Uid: 10528 Start by: activity Score:100 Old score:100 state:0 mBackgroundTimeInMillis:0 WakelockCount:0 wakelogsize:0  ActivityDestroied:false Activity size: 1 PackageInfo:{WhetstonePackageInfo#PacakgeName:com.apptech.boxstacker uid:10528 uiMemoryThresold:0 nonUiMemoryThresold:0 Flag:1073746112,0x400010c0 [,TRIMHEAPS,ZRAM,FLAG_DEAL_SCHEDULE] Type:64[,AUTO_START] } tasknum:1215}
07-10 00:55:46.345    1272-3245/? I/ActivityManager﹕ START u0 {cmp=com.apptech.boxstacker/com.google.games.bridge.NativeBridgeActivity (has extras)} from uid 10528 on display 0
07-10 00:55:46.449    1272-5569/? W/XSpaceManagerService﹕ checkXSpaceControl, from:com.apptech.boxstacker, to:com.google.android.play.games, with act:com.google.android.gms.games.SELECT_OPPONENTS_REAL_TIME, callingUserId:0, toUserId:0
07-10 00:55:47.016    1272-1297/? I/Timeline﹕ Timeline: Activity_windows_visible id: ActivityRecord{48674a3 u0 com.apptech.boxstacker/com.google.games.bridge.NativeBridgeActivity t1215} time:349357951
07-10 00:55:51.482    3097-3234/? D/WtProcessController﹕ set foreground process size 1 pid:20387pacakgeName:com.apptech.boxstacker
07-10 00:55:51.863    1272-1288/? W/System.err﹕ org.json.JSONException: No value for com.apptech.boxstacker

0 个答案:

没有答案