Este documento foi atualizado.
A tradução para Português (Brasil) não foi concluída ainda.
Atualização em inglês: 31 de jul de 2023
Atualização em Português (Brasil): 10 de ago de 2018

Instant Games SDK

In this section you'll find the API Reference for the Instant Games JavaScript SDK. If you're starting a new game, we recommend always using our latest version of the SDK. Click the button below to see the SDK reference for our most up-to-date version:

Instant Games SDK ReferenceBundle Configuration Reference

See the changelogs for the currently supported versions of the Instant Games SDK:

Version 7.1

Go to reference documentation for Instant Games SDK v7.1

Changelog

  1. Native video content rendering: Adding APIs for apps to render video content natively.
  2. Rewarded Interstitial API: Rewarded Interstitial is a new ad display format for Instant Game developers to monetize. Unlike Rewarded Video where users opt-in to view the ad, Rewarded Interstitials will appear in place of a regular Interstitial and the user can opt out. If they watch the full video, they will receive an in-game reward.
  3. Top Banner Ads: Allow developers to show banner ads at the top of their game.

Version 7.0

Go to reference documentation for Instant Games SDK v7.0

Changelog

  1. Custom invites Players can invite new players to the game through Messenger. Players will see an “Invite New Players” section with their friends that have not played the game yet. When they click Invite, it will send their friend a message to play the game. Players can send multiple invites at once. We have a guide with more info here.
  2. Haptic feedback Instant Games now support haptic feedback for Android and iOS devices with an integrated vibrator.
  3. Tournament APIs Instant Tournaments are a great way to acquire new players, and a good way to keep players engaged during the life of the tournament (7 days, by default). Players share a leaderboard to their timeline with a prompt for friends to join the challenge. News Feed delivery combined with re-shares by players who join, enable tournaments to traverse the friends graph rapidly to help the game to acquire more players in a short time.
  4. Removal of stats APIs These have been removed in favor of the more flexible player data APIs.
  5. Removal of postSessionScore We are providing postSessionScoreAsync as a replacement as it will provide better info about user actions for dialogs invoked via this API.
  6. Removal of unused parameters in shareAsync and updateAsync We've removed the INTENT parameter from shareAsync since it wasn't being used. We've also removed the IMMEDIATE_CLEAR strategy from updateAsync as we have a policy in place to restrict custom updates to one per context session.
  7. Top Banner Ads: Allow developers to show banner ads at the top of their game.

Version 6.3

Go to reference documentation for Instant Games SDK v6.3

Changelog

  1. (New) FBInstant.postSessionScore This API allows the game to provide Facebook with the player's score from the current game session. Facebook will use these score signals in various platform integrations to help players discover, compete & reengage with the game.
  2. Offline matchmaking Previously, matchmaking has been synchronous, blocking the game for the player while they wait. This release adds an asynchronous option to "matchPlayerAsync". Players starting an offline match will be added to a group thread right away, and players can leave the game while waiting more players to join. Once matched with others, if still in the game, the player will be added and switched into that matched thread's context.
  3. Data APIs for Player, Context, Locale, & Entry Point to start being accessible after "initializeAsync" We're reviving pre-game start access to data APIs! For example, you can now access the player's locale, or entry point data, while the game is loading. This should help you reduce secondary loading screens and overall loading requirements for your games. This change is available now on Web, and will be available on mobile starting in the following releases: FB for Android v219, Messenger for Android v213, FB for iOS v222, Messenger for iOS v216. Earlier mobile releases will exhibit the prior behavior, so make sure to check for any updated values after "startGameAsync" resolves.