use additonaldata by customcode in ScoreBoardService

0 votes

Hi, app42 support team:

I want to get the additional data fo the user through mScoreBoardService.getTopNRankers,

because of the safe reason, I must write the code in the custom code, 

But it not support App42API in the custom code,

also mScoreBoardService doesn't have "setQuery" way in the custom code.

my code:
String key1 = "name";     
String value1 = "John";  
Query query = QueryBuilder.build(key1, value1, Operator.EQUALS);
App42API.setDbName("<Enter_the_dbName>");  
mScoreBoardService.setQuery("<Your_Collection_Name>", query);  
Game game = mScoreBoardService.getTopNRankers(gameName, 10);
 
What I should do to solve my problem?
Thank you!

 

 

asked Aug 19, 2014 in App42 Cloud API-BaaS by riovoxtools (45 points)

1 Answer

0 votes

Hello Riovox,

Kindly use the below code snippet in your custom code to retrieve the meta info of user.

String key1 = "name";     

String value1 = "John";  

Query query = QueryBuilder.build(key1, value1, Operator.EQUALS);

HashMap<String, String> otherMetaHeaders = new HashMap<String, String>();
JSONObject json = new JSONObject();
json.put("dbName", "Your db name");
json.put("collectionName", "Your collection name");
otherMetaHeaders.put("dbCredentials", json.toString());

mScoreBoardService.setQuery("Your collection name", query);  

mScoreBoardService.setOtherMetaHeaders (otherMetaHeaders);

Game game = mScoreBoardService.getTopNRankers(gameName, 10);

Let us know if it helps.

Thanks

 

answered Aug 19, 2014 by hs00105 (2,005 points)
Hi, hs00105:
Thank you for your reply.
But in the custom code, mScoreBoardService doesn't have setQuery interface.
I can't use like this: mScoreBoardService.setQuery("Your collection name", query);
Please help me.
THank you
Hello Riovox,
Thanks for reporting to us.
We will update our custom code by upcoming Monday for this fix. We will update this thread when it will be live.

Thanks for having patience.
Hi, hs00105
Also, buddyservice don't have "setQuery" interface in the custom code too!
Please add this function too.
Thank you!
Please quick release, thank you!
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
...