Regarding Instant Games Invite/Share Feature

0 favourites
  • 13 posts
From the Asset Store
Easily generate many levels from a set of pre-built scenes (Construct 3 template)
  • Hello,

    I'm trying to add invite/challenge feature in instant games using Share event in instant games plugin which will open friend list dialog but while I test the game on messenger no dialog seems to appear. Please advise regarding this issue.

    Reference : construct.net/make-games/manuals/construct-3/plugin-reference/instant-games

    Thanks

  • Make sure that there is at least one instance of the object you're using for the image parameter in the share action in the current layout.

  • Thanks for the reply.

    Yes,I'm using image in the layout.

    Please check screenshot => ibb.co/cu0Rdd and advise.

  • Are you sure that the object is not destroyed at the moment that the share function is called?

    Also whats the size of the image? If the image is much big it couldn't work. I don't know exactly how much is the size limit, but you could try a smaller size.

  • Thanks Renfd for taking time to reply.

    Object was getting destroy, now seems to be working fine.

    Do you have any idea how does chooseAsync work? and how is sharing of message happening automatically after chooseAsync without any user action(check basketball frvr for example?)

  • I also have a problem with the Invite feature.

    For some reason it opens a simple "post photo" dialog, there is no text, no link to the game, nothing but the picture:

    I tried "Share", "Challenge" and "Request" intents instead of "Invite", and there is no difference, they all show the same dialog.

    Here is my event:

    .

    What I need is this dialog, is it possible to get it? (it's a screenshot from another game)

  • you are using the wrong function.

    share is just posting a picture to a thread or to wall. (why the hell do you want to post a resetbutton to anyone?!)

    the picture "play with friends" is chooseAsync. not share.

  • shareAsync has different intent types (Invite, Challenge etc.) that are supposed to invoke different dialogs, but apparently they don't work yet in current SDK. Also, the message I enter in the "Text" field is not displayed.

    Yeah, I already found the solution with chooseAsync function, it does work. You can't change the message or image, but it's better than nothing.

  • shareAsync has different intent types (Invite, Challenge etc.) that are supposed to invoke different dialogs, but apparently they don't work yet in current SDK. Also, the message I enter in the "Text" field is not displayed.

    Yeah, I already found the solution with chooseAsync function, it does work. You can't change the message or image, but it's better than nothing.

    no, they are not supposed to do that.

    chooseAsync does not post any text or image. that is not part of the function.

    you should use updateAsync after chooseAsync to post the image and text.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • no, they are not supposed to do that.

    According to the FAQ, "Intent" was added to future-proof the SDK and it will provide user-facing changes in the future

    Also, the information in Scirra's official manual for Instant Games plugin is misleading. It says "Show a dialog to invite, request, challenge or share, in a chat or timeline. The text to use in the share message can be provided."

    This is how it supposed to work, but not how it really works.

  • yes, sometime in coming SDKs it might have an affect, but currently it is not in use.

    So the issue for you was that you used the wrong function, (shareAsync works fine, the also with text if you post in messenger, but not for wall posts for desktop).

    if you want to post an image with text to the people/group you invite you shall use updateAsync, after chooseAsync.

    If you want to know how the functions work you should look in the SDK References

  • fredriksthlm

    The chooseAsync functions displays "Play with friends" dialog, but friends don't receive any notification or invite to join the game.

    Could you please post an working example (for Construct 3) of how to use updateAsync to actually send an invite message to a friend? Just a simple text like "Can you beat my score?" and a game logo.

    I'm guessing it should be something like "FBInstant.context.chooseAsync() .then(FBInstant.updateAsync.....", but I've spent several hours and couldn't get it working..

    Also, how do you get a Base64 string from a sprite in Construct3?

    Edit: Never mind, I did it!

     
    Browser execute Javascript:
    "FBInstant.context.chooseAsync()
    .then(function () { 
     FBInstant.updateAsync({
     action: 'CUSTOM',
     cta: 'Play it now!',
     image: '" & base64Image & "',
     text: '" & message & "',
     template: 'GAME_TEMPLATE', strategy: 'IMMEDIATE', notification: 'NO_PUSH'}) });"
    

    Instead of encoding a sprite in C3, I used an online tool and simply saved base64 string in a constant variable.

  • dop2000

    Good job, that is the same way we all do it.

    I'm still hoping Scirra will include those functions in the plugin soon..

    construct3.ideas.aha.io/ideas/C3-I-486

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)