Facebook Instant Game - Invite and challenge function not working

I like to add invite and challenge functions to my facebook instance game.
So according to “GitHub - defold/extension-fbinstant: Facebook Instant Games extension for the Defold game engine”, I have used " fbinstant.share()" functions with following code.

if screenshot.html5 then
	screenshot.html5(function(self, base64_img)
		-- share your base64 png
		local args = {
			intent ="INVITE",
			text="game text,
			image = base64_img
		}
		if type(args) == "table" then 
			args = json.encode(args)
		end
		fbinstant.share(args,function(self, success)				
		end)
	end)
end

when running the game, it displays the following share screen.I have changed the payload types but it displays the same output

i need following functionalities,

Any help with an example

That is not the correct function to use. Share will open a normal Facebook sharing dialog. You should use fbinstant.choose_context().

Refer to the official Facebook Instant Games docs and the chooseAsync function for more information.

2 Likes

Thank you for helping me