Heyzap Profiles Integration Tutorials

The following tutorials are designed to guide you through adding Heyzap Profiles to your flash game.

The current latest Heyzap developer tools API version is 3.3.1.

Contents

Prompt A Player To Login Through Facebook, Twitter, And Heyzap

To use Heyzap Profile, you'll need to download and install the Heyzap tools.

Show the Heyzap login prompt. You will increase engagement by attaching the user's login to an external site like Facebook or Twitter (especially if combined with the social bar - Show the social bar on your game). You will also raise retention and gameplays by allowing users to come back and resume the game where they left off.

The user's data is connected to a Heyzap user via the userChanged event. (Learn to Get information about the player). Before showing the login prompt, you should make sure you are catching the userChanged event. If the user is already logged in, you don't need to ask them to login again - and the login prompt will not show if the user is logged in.

Say the user is not logged in and you show the login prompt. Then, once the user logs in with the prompt, a userChanged event will be fired with the new user information.

To show the login prompt, call showLoginPrompt:

Code Snippet:
HeyzapTools.send("showLoginPrompt", {guest_mode: false});
Example Screenshot:
Related API Links:
Events: userChanged

Get Information About The Player

To use Heyzap Profile, you'll need to download and install the Heyzap tools.

Users have data associated to them, such as points, coins, and a name. The userChanged event returns a user object which has the most up to date user profile data.

You can also associate your own data for the user. See the Save and load a player's game progress

Related API Links:
Events: userChanged

Save And Load A Player's Game Progress

To use Heyzap Profile, you'll need to download and install the Heyzap tools.

You can save data per user. The benefit of using this instead of flash shared objects are:

  • Users can have the same userData whereever your game is hosted.
  • Users can log back in to access there game progress from different computers and browsers

To set user data, just call setUserData

Code Snippet:
HeyzapTools.send("setUserData", {
  user_data: { highest_level: 9, weapons: ["laser", "grenade"] }
});

To get the current user's data, just call getUserData. This will fire a userData event which returns the user_data object.

Code Snippet:
HeyzapTools.send("getUserData");
Related API Links:
Messages: setUserData, getUserData
Events: userChanged, userData