Callback when share success/close dialog in Instant game

0 favourites
  • 2 posts
From the Asset Store
Template for a generic save / load system, fully documented in comments and video
  • hello,

    I have issue when using shareAsync from FBInstant, in this case, how we can detect if user success share, or they just close the share Dialog. with below code, it always "share complete", even user just click close dialog. on facebook instant game document, they mention about return Promise object, but with no example.

    	FBInstant.shareAsync({
     intent: 'SHARE',
     image: imgBase64,
     text: 'X is asking for your help!',
     data: { myReplayData: "..." },
    }).then(function() {
     // continue with the game. 
     console.log("share complete");
    
     /*runtime.callFunction("shareResult");*/
    }).catch(function (e) {
     // Handle subscription failure
     console.log(e);
     console.log("share failed");
    });
    

    thank you.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Not possible.

    The user may choose to cancel the share action and close the dialog, and the returned promise will resolve when the dialog is closed regardless if the user actually shared the content or not

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