Question about Reward service

0 votes
Hi!

I have 3 reward, Bronze, Silver and Gold. And I have 3 leaderdboard for this 3 rewards.

Bronze = 0 - 2000 Trophys

Silver= 2000-4000 Trophys

Gold = +4000 Trophys

All work fine but I have a problem, when some user raise 2000 trophys I want to delete this user on Bronze leaderboard and move to Silver Leaderboard. I dont see any method for delete record or move between Reward.

How I can make this?
asked Aug 25, 2017 in Unity by rupas30 (15 points)

2 Answers

0 votes
Hi Rupas,

Apologies for late reply.

Could you please share some details like:

1. How are saving Trophys? Which API are you using?

2. How are you managing the leaderboard and rewards together? Please share the APIs you are using.

It will help us to understand the query in better way.

Thanks.
answered Aug 28, 2017 by rajeev.etc (1,660 points)
Please see the answer
0 votes

Thank for reply.

 

1.- For Trophys etc I am using Reward Service API.

2.- Same for leaderboard

 

Example how I use API for show leaderboard for Silver Division:

 

 public GameObject grid;
    public GameObject prefab;

    private string gameName = GlobalContext.gameName;
    private string rewardName = GlobalContext.TrophySilver;
    private int Max = 100;



    RewardService rewardService;



    // Use this for initialization
    void Start()
    {

        App42API.Initialize(GlobalContext.APIKEY, GlobalContext.APISECRET);

        rewardService = App42API.BuildRewardService();
        rewardService.GetTopNRewardEarners(gameName, rewardName, Max, this);

    }



    public void OnSuccess(object response)
    {

        IList<Reward> reward = (IList<Reward>)response;
        int ScorePos = 0;


        for (int i = 0; i < reward.Count; i++)
        {

            ScorePos++;
            Debug.Log("rewardName is: " + reward[i].rank + " UserName: " + reward[i].GetUserName() + " rewardName is: " + reward[i].GetName() + " Point is : " + reward[i].GetPoints());

            GameObject go = Instantiate(prefab, Vector3.zero, Quaternion.identity, grid.transform) as GameObject;
            ClasificacionPlayerData data = go.GetComponent<ClasificacionPlayerData>();

            data.NamePlayer = reward[i].GetUserName();
            data.Score = reward[i].GetPoints().ToString();
            data.TopNumber = ScorePos.ToString();

        }


    }






    public void OnException(Exception e)
    {

        Debug.Log("Exception: " + e);

    }

 

answered Aug 28, 2017 by rupas30 (15 points)
Hi Rupas,
Apologies for late reply.
I have already put a request to provide DeleteReward API and I will update you once it is live.
Thanks.
Still waiting for this, my game is stop waiting this feature, when is implemented?
Hi Rupas,

Apologies for the delayed response.

We have scheduled this Delete Reward API release on 9th October. So, we will send you an update for the same once it will get released.

Thanks for your patience and understanding.

Regards,
Priyanka Singh
App42 Team
Hi Rupas,

Thanks for your patience and understanding!

Please download the Delete Reward API from this link ( http://cdn.shephertz.com/repository/files/6ab7a4745c0c2dba0bd40d6d5a60a354c8ab5b72dbc520dafa0536a91b861dc8/6d4aa9c8b35a34a81ca07a31f795ab056b28e067/App42-Unity3D-SDK-4.1.3 ) and go through it.

If you have any other other queries please do feel free to reach out to us.

We will be happy to help you!

Regards,
Priyanka Singh
App42 Team
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...