Base64 png with dynamic score

#1

Using defold FB instance game extension(https://github.com/defold/extension-fbinstant/blob/master/README.md) and screenshot extension we can send the message.Ex-

but I saw most of the FB instance game have this kind of score when it shares.

53%20AM

is there any way to create this kind of message using “fbinstant.update()” function.

*Use static image for background
*change score and profile pic dynamically

this is the function i have used

function shareChalengeHTML(self)
local player = fbinstant.get_player();
local wintexttext = " "..player.name .." Score  "..self.score.." Marks.... Can you beat him?";
if screenshot.html5 then
	screenshot.html5(function(self, base64_img)
		-- share your base64 png
		fbinstant.update(rxijson.encode({
			action = "CUSTOM",
			cta = "Play",
			template = "play_turn",
			image = base64_img,
			text = wintexttext,
			strategy = "IMMEDIATE",
		}), function(self,success)
			print("update_context success",success)
		end)
	end)
  end	
end

any suggestions?

0 Likes