Difference between revisions of "Facebook Instant Games"

From GiderosMobile
m
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div style="column-count:1;-moz-column-count:1;-webkit-column-count:1">
+
__NOTOC__
 +
<!-- GIDEROSOBJ:Facebook Instant Games -->
 +
'''Supported platforms:''' [[File:Platform html5.png]]<br/>
 +
'''Available since:''' Gideros 2018.3<br/>
  
[[Special:MyLanguage/* Initialisation and Core|* Initialisation and Core]]<br />
+
=== Description ===
[[Special:MyLanguage/Context|Context]]<br />
+
Adds Facebook Instant Games framework to your project.
[[Special:MyLanguage/Payments|Payments]]<br />
 
[[Special:MyLanguage/Player|Player]]<br />
 
  
 +
You need to do two things to target Facebook Instant Games:
 +
# Tick the Facebook Instant Game tickbox when exporting to HTML5, you can also specify the percentage indicator that the game will show it has loaded before you take control.
 +
# Require the FBInstant library code, see the example below.
 +
 +
You can upload, debug and test your game by creating a player and uploading to Facebook servers as a game. The player will interact with the Gideros Studio similar to any other player.
 +
 +
The only restriction with the player is that it only works on the computer viewing the html5 game (localhost) - this would normally rule out actual phones but there is a workaround for Android:
 +
# Connect your Android phone to your computer using ADB.
 +
# Type in this command in a command console shell (Windows) or terminal (Mac): '''adb reverse tcp:15001 tcp:15001'''
 +
# The Android device now will see the Gideros Studio when testing the game when a player is launched from within Facebook Messenger.
 +
 +
Please refer to the https://developers.facebook.com/docs/games/instant-games/getting-started/quickstart original Facebook documentation for more information about testing and uploading.
 +
 +
'''note:''' the official Facebook documentation mentions having to wait for initializeAsync, with Gideros this has already been done for you before your game starts.
 +
 +
=== Old Documentation (Obsolete) ===
 +
[[* Initialisation and Core]]
 +
 +
=== Classes ===
 +
<div style="column-count:2;-moz-column-count:2;-webkit-column-count:2">
 +
[[FBInstant]] ''Facebook Instant Games Initialisation and Core''<br/><!--GIDEROSOBJ:FBInstant Facebook Instant Games Initialisation and Core-->
 +
[[FBInstant.context]] ''contains functions and properties related to the current game context''<br/><!--GIDEROSOBJ:FBInstant.context contains functions and properties related to the current game context-->
 +
[[FBInstant.payments]] ''contains functions and properties related to payments and purchases of game products''<br/><!--GIDEROSOBJ:FBInstant.payments contains functions and properties related to payments and purchases of game products-->
 +
[[FBInstant.player]] ''contains functions and properties related to the current player''<br/><!--GIDEROSOBJ:FBInstant.player contains functions and properties related to the current player-->
 
</div>
 
</div>
 +
 +
{{GIDEROS IMPORTANT LINKS}}

Latest revision as of 00:18, 21 September 2022

Supported platforms: Platform html5.png
Available since: Gideros 2018.3

Description

Adds Facebook Instant Games framework to your project.

You need to do two things to target Facebook Instant Games:

  1. Tick the Facebook Instant Game tickbox when exporting to HTML5, you can also specify the percentage indicator that the game will show it has loaded before you take control.
  2. Require the FBInstant library code, see the example below.

You can upload, debug and test your game by creating a player and uploading to Facebook servers as a game. The player will interact with the Gideros Studio similar to any other player.

The only restriction with the player is that it only works on the computer viewing the html5 game (localhost) - this would normally rule out actual phones but there is a workaround for Android:

  1. Connect your Android phone to your computer using ADB.
  2. Type in this command in a command console shell (Windows) or terminal (Mac): adb reverse tcp:15001 tcp:15001
  3. The Android device now will see the Gideros Studio when testing the game when a player is launched from within Facebook Messenger.

Please refer to the https://developers.facebook.com/docs/games/instant-games/getting-started/quickstart original Facebook documentation for more information about testing and uploading.

note: the official Facebook documentation mentions having to wait for initializeAsync, with Gideros this has already been done for you before your game starts.

Old Documentation (Obsolete)

* Initialisation and Core

Classes

FBInstant Facebook Instant Games Initialisation and Core
FBInstant.context contains functions and properties related to the current game context
FBInstant.payments contains functions and properties related to payments and purchases of game products
FBInstant.player contains functions and properties related to the current player