Hello,
I am trying to implement the invite and challenge friends functionality. I’ve read on this forum that this should be done via the “fbinstant.choose_context”. So I implemented the method, uploaded the game and I am now testing on Facebook.
When the user presses the button, which calls this function, the user sees the following:
So all seems to be good here. When the invite is sent, Facebook nicely tells me that I have started a game with friend X in Messenger at the top of the game. However, the invite/challenge is never sent in the Messenger. So no body sees any of the invites/challenges.
The code I’ve written to achieve this looks like this (sharing works fine by the way!):
if message.intent == fbinstant.SHARE_INTENT_SHARE then
local im = sys.load_resource("/fish_game/assets/marketing/share_img_base64.json")
local payload =
{
["intent"] = message.intent,
["image"] = im,
["text"] = message.text
}
payload = rxijson.encode(payload)
fbinstant.share(payload, function(self, success)
print("was it a success?")
print(success)
end)
elseif message.intent == fbinstant.SHARE_INTENT_INVITE then
fbinstant.choose_context(nil, function(self, id, type)
print("chose a context....INVITE!")
print(id)
print(type)
end)
elseif message.intent == fbinstant.SHARE_INTENT_CHALLENGE then
fbinstant.choose_context(nil, function(self, id, type)
print("chose a context....CHALLENGE!")
print(id)
print(type)
end)
end
When I look at the browser console, I do not see the print messages, by the way. I was wondering if I am doing this correctly on the Defold side.
Thanks!