Sign in to follow this  
greencoder

Playfab Plugin?

Recommended Posts

@greencoder

I just added support for loading external JavaScript files with addAsset function. Now you can easily load all the PlayFab libraries that you need.

Take a look at the PlayFab JavaScript guide: https://api.playfab.com/docs/getting-started/javascript-getting-started

Example:

game.module(
    'game.main'
)
.body(function() {

game.addAsset('https://download.playfab.com/PlayFabClientApi.js');

game.createScene('Main', {
    init: function() {
        var loginRequest = {
            TitleId: 'myTitleId',
            CustomId: 'myCustomId',
            CreateAccount: true
        };
        
        // Now you can access PlayFabClientSDK object
        PlayFabClientSDK.LoginWithCustomID(loginRequest, function(result, error) {
            if (!error) {
                console.log('Congratulations, you made your first successful API call!');
            }
            else {
                console.log(error);
            }
        });
    }
});

});

Remember to update your game engine to latest 2.6.0 version.

Let me know if you have any issues.

Share this post


Link to post
Share on other sites

Tried it, in the editor, everything seems to work smoothly but when tried the same build on device and browser for instant games, the loading gets stuck at 95% and doesn't load beyond that. Any idea what could be causing it @enpu ?

 

EDIT: And saw this on the debug console
image.thumb.png.310a7aeab5266f0cd6701c2a67b194ad.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.