Difference between revisions of "FBInstant"
| m (Text replacement - "<source" to "<syntaxhighlight") | m (Text replacement - "</source>" to "</syntaxhighlight>") | ||
| Line 33: | Line 33: | ||
| 	print("FBInstant not loaded") | 	print("FBInstant not loaded") | ||
| end | end | ||
| − | </ | + | </syntaxhighlight> | 
| {|- | {|- | ||
Latest revision as of 14:26, 13 July 2023
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 | 
