解锁成就谷歌玩游戏默默地

解锁成就谷歌玩游戏默默地

本文介绍了解锁成就谷歌玩游戏默默地,没有显示通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是谷歌播放服务,在我的Andr​​oid游戏成就(它实际上是统一的,但无所谓)。

I'm using google play services, achievements in my android game (it's actually unity, but doesn't matter).

要解锁的成就我使用的插件,调用解锁(GoogleApiClient apiClient,字符串ID)方法。当成果被设置为已完成,谷歌展示了自己的通知,像这样:。

To unlock achievement I use plugin which calls unlock(GoogleApiClient apiClient, String id) method. When achievements are set as completed, google shows its own notification, like this:.

我要默默地解开的成就,而不显示此通知。有什么要隐藏呢?

I need to unlock achievement silently, without showing this notification. Is there anything to hide it?

推荐答案

当你解开你的成就试试这个code。我没有测试过,所以我不知道,如果它的工作原理,但它是值得一试。

Try this code when you unlock your achievement. I haven't tested it so I dont know if it works but it's worth a shot.

这方法是一样的解锁,但它有一个回调,告诉你实现的状态,它已经解锁之后。我刚才说的回报,因此什么都不做不管。但愿prevents通知。

This method is the same as unlock but it has a callback that tells you the status of the achievement after it's been unlocked. I've just said return so it does nothing no matter what. Hopefully prevents the notification.

Games.Achievements.unlockImmediate(GoogleApiClient apiClient, String id).setResultCallback(new  ResultCallback<Achievements.UpdateAchievementResult>() {

            @Override
            public void onResult(UpdateAchievementResult result) {
                return;
            }

        });

这篇关于解锁成就谷歌玩游戏默默地,没有显示通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 12:27