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

setEnableSpeakerphone(true) doesnt work on ios devices #22

Closed
Aliharu opened this issue Jul 19, 2019 · 9 comments
Closed

setEnableSpeakerphone(true) doesnt work on ios devices #22

Aliharu opened this issue Jul 19, 2019 · 9 comments

Comments

@Aliharu
Copy link

Aliharu commented Jul 19, 2019

Im trying to get audio calls to use the speakerphone but the command to do so does nothing on ios devices.

AgoraRtcEngine.setEnableSpeakerphone(true);
AgoraRtcEngine.isSpeakerphoneEnabled().then((value) {
print(value); //This returns true but on ios it still uses the earpiece speaker.
});

@plutoless
Copy link

did you do it after joining channel?

@Aliharu
Copy link
Author

Aliharu commented Jul 19, 2019

I tried it before and after joining channel.

@plutoless
Copy link

could you pls show me your code snippet if possible?

@Aliharu
Copy link
Author

Aliharu commented Jul 19, 2019

  void initialize() {
    _initAgoraRtcEngine();
    _addAgoraEventHandlers();
      setupChannel();
      joinChannel();
  }
  void setupChannel() {
    AgoraRtcEngine.setEnableSpeakerphone(true); //Trying to do before join channel
  }

  void joinChannel() async {
    AgoraRtcEngine.joinChannel(null, widget.channelName, null, 0);
    AgoraRtcEngine.setEnableSpeakerphone(true); //Trying to join after
  }

I tried in both spots on separate attempt.  Neither works on IOS

@plutoless
Copy link

@Aliharu try doing it after receiving onJoinChannelSuccess callback.

@Aliharu
Copy link
Author

Aliharu commented Jul 19, 2019

Just tried

  void joinChannel() async {
    AgoraRtcEngine.joinChannel(null, widget.channelName, null, 0).then((value) {
      AgoraRtcEngine.setEnableSpeakerphone(true);
    });
  }
and 
  void joinChannel() async {
    await AgoraRtcEngine.joinChannel(null, widget.channelName, null, 0);
    AgoraRtcEngine.setEnableSpeakerphone(true);
  }

Still uses earpiece on IOS

@plutoless
Copy link

@Aliharu calling async on joinChannel simply means the api call was transmitted to native side and returned with a return value
To listen to joinchannelsuccess callback you will need to do sth like this:
https://github.com/AgoraIO-Community/Agora-Flutter-Quickstart/blob/87a097c4d07f01555c0cf4832ee9a8c87f7f27e2/lib/src/pages/call.dart#L79

@Aliharu
Copy link
Author

Aliharu commented Jul 19, 2019

Okay looks like that works. Thank you.

@github-actions
Copy link
Contributor

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please raise a new issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants