简体   繁体   中英

facebook instant games using position tables LEADERBOARD _NOT_FOUND

I am using this method FBInstant.getLeaderboardAsync ("test"), with any other position table whether contextual or not, I have this error i {code: "LEADERBOARD_NOT_FOUND", message: "A leaderboard with the name" test "was not found"}

an image of the error

Can someone tell me how the leaderboards are obtained? Or are they in custody ?. Or should I send my application to review to access it?

here the code:

FBInstant.getLeaderboardAsync('test')
        .then(leaderboard => {
            console.log(leaderboard.getName());
            return leaderboard.setScoreAsync(42);
        })
        .then(() => {
            console.log('Score saved')
        })
        .catch(error => console.error(error));

FBInstant.getLeaderboardAsync('test.'+ contextID)
        .then(leaderboard => {
            console.log(leaderboard.getName());
            return leaderboard.setScoreAsync(score);
        })
        .then(() => {
            console.log('Score saved')
        })
        .catch(error => console.error(error));

I'm using the sdk 6.0

Thank you


I already did it and it does not work. A question, does it work for you? What steps did you follow to create your instant games app? Or maybe it takes a few days to create the table. I found this in the documentation.

LEADERBOARD_NOT_FOUND string object: a position table with the requested name was not found. The leaderboard does not yet exist or the name does not match any of the leaderboard settings registered for the game.

As if I had not created the leader board, and I'm not mistaken in the name, either contextual or non-contextual.

At the end of the day, I think that my application does not connect with the Facebook database, and I ask what are the steps you followed?

I did the following: create my application, perform the basic configuration, added the product of instant games, create the leader boards, I uploaded my game to web hosting

that's all I did, and even if I try it with: https://www.facebook.com/embed/instantgames/APP_ID/player?game_url=https://localhost:8080 , with a table of leaders without context

or

direct from messenger in a conversation using table of leaders with context I get the same error in the console

Make sure you have created leader board in App's setting 在此处输入图片说明

And contextID is not null. You can get contextID by this method FBInstant.context.getID()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM