我已经使用Sinch SDK构建了一个实现基本的app-to-app调用的测试应用程序,并且一切都运行良好。
我现在正试图将这项工作转移到一个更加精美/全功能的应用程序中,但是当我尝试发起呼叫时,我仍然遇到异常:
mSinchClient.getCallClient().callUser(userId);
这是stacktrace:
02-23 21:37:57.979 W/System.err(15111): com.sinch.android.rtc.MissingPermissionException: Requires permission: android.permission.RECORD_AUDIO
02-23 21:37:57.979 W/System.err(15111): at com.sinch.android.rtc.internal.client.calling.DefaultCallClient.throwIfMissingPermission(Unknown Source)
02-23 21:37:57.979 W/System.err(15111): at com.sinch.android.rtc.internal.client.calling.DefaultCallClient.call(Unknown Source)
02-23 21:37:57.980 W/System.err(15111): at com.sinch.android.rtc.internal.client.calling.DefaultCallClient.callConference(Unknown Source)
02-23 21:37:57.980 W/System.err(15111): at com.sinch.android.rtc.internal.client.calling.DefaultCallClient.callConference(Unknown Source)
02-23 21:37:57.980 W/System.err(15111): at com.brenthiggins.clickapp.vext.VextingManagerSinchImpl.connectContact(VextingManagerSinchImpl.java:122)
02-23 21:37:57.980 W/System.err(15111): at com.brenthiggins.clickapp.fragments.VextFragment.vextContactIfNecessary(VextFragment.java:97)
02-23 21:37:57.980 W/System.err(15111): at com.brenthiggins.clickapp.fragments.VextFragment.onSpeakingCompleted(VextFragment.java:81)
02-23 21:37:57.980 W/System.err(15111): at com.brenthiggins.clickapp.helpers.TextToSpeechManager.isDone(TextToSpeechManager.java:141)
02-23 21:37:57.980 W/System.err(15111): at com.brenthiggins.clickapp.helpers.TextToSpeechManager.onDone(TextToSpeechManager.java:69)
02-23 21:37:57.980 W/System.err(15111): at android.speech.tts.TextToSpeech$Connection$1.onSuccess(TextToSpeech.java:2108)
02-23 21:37:57.980 W/System.err(15111): at android.speech.tts.ITextToSpeechCallback$Stub.onTransact(ITextToSpeechCallback.java:63)
02-23 21:37:57.980 W/System.err(15111): at android.os.Binder.execTransact(Binder.java:453)
我绝对拥有录音音频权限:
我也打电话试过
SinchClient.checkManifest()
在SinchClientListener.onClientStarted()中并没有抛出任何异常。但是当我在调用CallClient.callUser()之前使用checkManifest()时,它会失败(即抛出异常)。
任何帮助将不胜感激!谢谢!
答案 0 :(得分:0)
我遇到了同样的问题。
好吧,我刚刚在上一个活动中创建了“ SinchClient(使其保持静态)”,并在下一个活动中进行了通话。
正在发生这种情况,我们开始在启动Sinch客户端之前拨打电话
代码:- 活动A代码
android.content.Context context = this.getApplicationContext();
sinchClient = Sinch.getSinchClientBuilder().context(context)
.applicationKey(SichChatCredentials.app_key)
.applicationSecret(SichChatCredentials.secreates)
.environmentHost(SichChatCredentials.enviroment)
.userId("userID")
.build();
sinchClient.setSupportMessaging(true);
sinchClient.setSupportCalling(true);
// sinchClient.setSupportManagedPush(true);
sinchClient.setSupportActiveConnectionInBackground(true);
sinchClient.startListeningOnActiveConnection();
sinchClient.addSinchClientListener(new SinchClientListener() {
public void onClientStarted(SinchClient client) { }
public void onClientStopped(SinchClient client) { }
public void onClientFailed(SinchClient client, SinchError error) { }
public void onRegistrationCredentialsRequired(SinchClient client, ClientRegistration registrationCallback) { }
public void onLogMessage(int level, String area, String message) { }
});
sinchClient.start();
活动B代码:-
CallClient callClient = sinchClient.getCallClient();
Call call = callClient.callUser(doctorEmail);
call.addCallListener(this);