1

验证签名时,后台服务器显示{"rtnCode":-1,"errMsg":"check playerSSign fail"} 客户端提供的数据是

if(huaweiid != null){
PlayersClient player = Games.getPlayersClient(this, huaweiid);
player.getCurrentPlayer().addOnSuccessListener(new OnSuccessListener<Player>() {
    @Override
    public void onSuccess(Player player) {
        String ts = player.getSignTs();
        String playerId = player.getPlayerId();
        int playerLevel = player.getLevel();
        String playerSign = player.getPlayerSign();
        //String displayName = player.getDisplayName();
        //Uri hiResImageUri = player.getHiResImageUri();
        //Uri iconImageUri = player.getIconImageUri();
        JSONObject jo = new JSONObject();
        try {
            jo.put("signTs", ts);
            jo.put("playerId", playerId);
            jo.put("playerLevel", playerLevel);
            jo.put("playerSign", playerSign);

            EditText ed = findViewById(R.id.editText);
            ed.setText(jo.toString());
            Log.i("huawei user info", jo.toString());
        } catch (JSONException e) {
            e.printStackTrace();
            Log.i("huawei user info", Objects.requireNonNull(e.getMessage()));
        }
    }
});

} 使用前面的四个数据项和下面的描述文档:

https://developer.huawei.com/consumer/cn/doc/HMSCore-References-V5/verify-login-signature-0000001050123503-V5

后台验证时总是出错。

{"rtnCode":-1,"errMsg":"check playerSSign fail"} 

appId/cpid从agconnect-services.json获取,agconnect-services.json从后台下载。

什么原因?

4

1 回答 1

0

下表描述了输入参数的典型设置错误。请验证参数设置。 在此处输入图像描述

https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/faq-check-login-0000001050746133-V5

于 2020-07-22T12:19:34.417 回答