Difference between revisions of "FBInstant"
|  (new FBInstant page + new GIDEROSOBJ:FBInstant) |  (changed desciption as per sinistersoft recommandation) | ||
| Line 1: | Line 1: | ||
| __NOTOC__ | __NOTOC__ | ||
| <languages /> | <languages /> | ||
| − | |||
| <!-- GIDEROSOBJ:FBInstant --> | <!-- GIDEROSOBJ:FBInstant --> | ||
| − | |||
| '''<translate>Supported platforms</translate>:''' [[File:Platform html5.png]]<br/> | '''<translate>Supported platforms</translate>:''' [[File:Platform html5.png]]<br/> | ||
| '''<translate>Available since</translate>:''' Gideros 2018.3<br/> | '''<translate>Available since</translate>:''' Gideros 2018.3<br/> | ||
| === <translate>Description</translate> === | === <translate>Description</translate> === | ||
| − | + | Facebook Instant Games Initialisation and Core. | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| + | It is very important that only the following API calls are made before startGameAsync has resolved: | ||
| − | + | *'''FBInstant.getSDKVersion()'''<br/> | |
| − | FBInstant.getSDKVersion()<br/> | + | *'''FBInstant.initializeAsync()'''<br/> | 
| − | FBInstant.initializeAsync()<br/> | + | *'''FBInstant.getPlatform()'''<br/> | 
| − | FBInstant.getPlatform()<br/> | + | *'''FBInstant.setLoadingProgress()'''<br/> | 
| − | FBInstant.setLoadingProgress()<br/> | + | *'''FBInstant.getSupportedAPIs()'''<br/> | 
| − | FBInstant.getSupportedAPIs()<br/> | + | *'''FBInstant.quit()'''<br/> | 
| − | FBInstant.quit()<br/> | + | *'''FBInstant.onPause()'''<br/> | 
| − | FBInstant.onPause()<br/> | + | *'''FBInstant.player.getID()'''<br/> | 
| − | FBInstant.player.getID() | ||
| − | |||
| To help do this you could create a variable called FBInstantAPI and set it to true once startGameAsync has been resolved - then only call other API commands if FBInstant is true and then if FBInstantAPI is true. | To help do this you could create a variable called FBInstantAPI and set it to true once startGameAsync has been resolved - then only call other API commands if FBInstant is true and then if FBInstantAPI is true. | ||
| Line 43: | Line 23: | ||
| === <translate>Examples</translate> === | === <translate>Examples</translate> === | ||
| '''Initialisation and removal of the Facebook loading progress indicator.''' | '''Initialisation and removal of the Facebook loading progress indicator.''' | ||
| − | |||
| − | |||
| <source lang="lua">   | <source lang="lua">   | ||
| pcall(function() FBInstant=require "FBInstant" end) | pcall(function() FBInstant=require "FBInstant" end) | ||
Revision as of 22:16, 9 December 2019
Supported platforms: 
Available since: Gideros 2018.3
Description
Facebook Instant Games Initialisation and Core.
It is very important that only the following API calls are made before startGameAsync has resolved:
- FBInstant.getSDKVersion()
- FBInstant.initializeAsync()
- FBInstant.getPlatform()
- FBInstant.setLoadingProgress()
- FBInstant.getSupportedAPIs()
- FBInstant.quit()
- FBInstant.onPause()
- FBInstant.player.getID()
To help do this you could create a variable called FBInstantAPI and set it to true once startGameAsync has been resolved - then only call other API commands if FBInstant is true and then if FBInstantAPI is true.
Examples
Initialisation and removal of the Facebook loading progress indicator.
 
pcall(function() FBInstant=require "FBInstant" end)
if FBInstant then
	FBInstant.startGameAsync(function() 
		print("Loading screen removed")
		FBInstantAPI=true
	end)
else
	print("FBInstant not loaded")
end
| MethodsFBInstant.canCreateShortcutAsync Returns whether or not the user is eligible to have shortcut creation requested. | EventsConstants | 
