Jump to content

Phaser 3 won't regain input on iPhone


pingu
 Share

Recommended Posts

Hi,

In my FB Instant game, I open FB's invite dialog using `FBInstant.chooseAsync()`. It opens up the dialog. Once the dialog is dismissed I see that for about half a second, the game is stuck (as if transitioning). If you tap on the game during this split second, not only does Phaser not receive the input, but also stops receiving further inputs. So pressing during this "stuck" phase after closing the FB dialog shuts down all future inputs to Phaser.

However, if I wait after about a second so that my game is running properly, it accepts inputs normally. This whole behaviour is prevalent only on iPhone only.

Here is my best attempt to overcome this problem which didn't work:
 

// Whether invite is completed
var chosenContext = false;

// Handles invite button clicks
function inviteBtnHandler() {
  // Disable inputs
  this.input.manager.touch.capture = false;
  // This is when control goes away from the game
  FBInstant.context.chooseAsync().then(function() {
    chosenContext = true;
  }).then(function() {
    chosenContext = true;
  });
}

function update() {
  if (chosenContext) {
    // control resumed
    chosenContext = false;
   // enable inputs
    this.input.manager.touch.capture = true;
  }
  // rest of stuff
}

However this did not work.

I really am not sure what is going on here.

Can anyone please help?

Thank you

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...