Jump to content

How do you detect 'silent' mode on iOS?


PuzzleGuy
 Share

Recommended Posts

Hi everyone,

My game just got rejected on Instant review due to the following reason:

" On iPhone and iPad, games should mute any sound effects or background music when silent mode is enabled. "

Ok, but how do I detect if the silent mode is enabled? Research didn't help much, except finding this on one forum:

" I've had a response from Apple on this. They've said they don't and never have provided a method for detecting hardware mute switch and don't intend to do so."

Also, there are some workarounds, but none of them is for HTML5. Facebook recommends using the WebAudio API for that, but no further info.

Did anyone face the same issue? Btw, as I just learned, the purpose of physical silent switch on iOS devices is not to mute user initiated sounds (like games, for instance. You have volume control buttons for that), but to prevent sudden sounds (ie, alerts, phone ringing). So, how do you make your game listen to iOS silent switch and make it muted/unmuted?

Link to comment
Share on other sites

@PuzzleGuy  It might be that you do not pause the sound when needed. Does your sounds/music actually play in in silent mode on iOS (do you manage to repro the issue)?
Have you implemented something like this:

FBInstant.onPause(function() {
  // Pause your game and the sound here.
  // Show a dialog with a "Resume" button that will resume the game
  // and the sound.
})
Link to comment
Share on other sites

  • 3 months later...
On 11/19/2018 at 11:19 AM, Noel said:

@PuzzleGuy  It might be that you do not pause the sound when needed. Does your sounds/music actually play in in silent mode on iOS (do you manage to repro the issue)?
Have you implemented something like this:


FBInstant.onPause(function() {
  // Pause your game and the sound here.
  // Show a dialog with a "Resume" button that will resume the game
  // and the sound.
})

I have exactly the same issue as @PuzzleGuy, however my game is made with PIXIJS.

I have FBInstant.onPause implemented and it's totally for a different case, when your game goes to background and it has nothing to do with the physical switch. 
Answering to your question, yes, it's 100% reproducible, the game plays music in the Silent mode.

@PuzzleGuy Hey, could you tell me if by this time you've found a solution for this problem?

Link to comment
Share on other sites

On 11/16/2018 at 11:06 AM, PuzzleGuy said:

Sorry, I forgot to mention that the project is made with 'Construct 3', so I'd appreciate if anyone from that area could say something.

I use C3 too and usually get my games reproved when I send them with only mp4/ogg sound files. When i convert all the audio to webm and send to review again, the game gets approved.

Try it. You can add the same ogg audio files again in the projet that C3 will convert to webm

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...