Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hasPermission does nothing in mobile browsers #368

Closed
giaesp opened this issue Jul 14, 2024 · 3 comments
Closed

hasPermission does nothing in mobile browsers #368

giaesp opened this issue Jul 14, 2024 · 3 comments

Comments

@giaesp
Copy link

giaesp commented Jul 14, 2024

Package version
5.1.2

Environment

  • OS: Android, iOS
  • Browser: Chrome, Safari

I'm trying to record an audio in a Flutter Web project. It works very fine in desktop browsers, but it lacks the permission requests in mobile browsers, so it doesn't record anything. I have a simple button with this code associated:

startRecording() async {
    if (await _audioRecorder.hasPermission()) {
      _isRecording = true;
      notifyListeners();
      await _audioRecorder.start(
          const RecordConfig(
            encoder: AudioEncoder.wav,
          ),
          path: 'ONWEBTHISPARAMETERISIGNORED :)');
    }
  }

Just a note: I'm running in HTTP. Does permission requests require HTTPS?

@llfbandit
Copy link
Owner

llfbandit commented Jul 14, 2024

Thanks for the report.
There's nothing different between mobile or desktop browsers, web API is the same. Secured layer shouldn't be a part of this issue.
What do you mean by "does nothing"? I guess you had an exception that you didn't handle. If so, could you provide info about it?

@giaesp
Copy link
Author

giaesp commented Jul 16, 2024

I'm expecting to see the classic authorization request dialog but it doesn't appear.
I have no messages in web console and in debug console.
I'm pretty sure this is not a package bug, but a browser standard security behavior: when I'm running in debug in http://localhost it works in every browser, desktop and mobile, I've tested. In the deployed version, running in http due to some my restrictions, it simply does absolutely nothing. I'll try in an https environment so I'll confirm to you. Thank u!

@giaesp
Copy link
Author

giaesp commented Jul 19, 2024

I can confirm, under https everything works like a charm.
Sorry for opening the bug, this is not a package bug, just a browser security settings! Thank u!

@giaesp giaesp closed this as completed Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants