W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
該功能預期幫助游戲提升:新增、留存、在線時長、arpu、錄屏分享等數(shù)據(jù)項。
Notice:
使用開放數(shù)據(jù)域接口tt.setUserCloudStorage,其中 key 為排行榜 key,value 形如{'ttgame': {'score': 1}} 調(diào)用接口示例如下:
const data = {
ttgame: {
score: 16,
update_time: 1513080573
},
cost_ms: 36500
};
tt.setUserCloudStorage({
KVDataList: [{ key: "testRank", value: JSON.stringify(data) }]
});
使用開放數(shù)據(jù)域接口tt.getCloudStorageByRelation,其中,type 字段填寫"group",key 為排行榜 key 調(diào)用接口示例如下:
tt.getCloudStorageByRelation({
type: "group",
keyList: ["testRank"],
extra: {
sortKey: "testRank"
},
success(res) {},
fail(e) {}
});
接口返回數(shù)據(jù)示例:
{
data: [
// 每一項對應一個用戶存儲的數(shù)據(jù)
{ avatarUrl: '', nickname: '', openid: '', KVDataList: [{ key: 'test1', value: '' }...], money: 0},
...
]
}
同 3 接口,遍歷,isMe字段等于true為本人
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: