在 iOS 中显示自定义 VoIP 应用程序的通话状态栏(双高) [英] Showing in-call status bar (double height) for a custom VoIP app in iOS
问题描述
我使用 Sinch
库在 iOS
中创建了一个 VoIP 应用程序.我能够成功拨打电话,但在创建双高通话状态栏时遇到问题.我的意思是,我的通话窗口出现了,在那个窗口上,我有一个按钮可以离开视图并转到其他地方(无需挂断电话),我希望显示一个绿色的双高通话状态栏,以便我可以点击它并返回我调用视图.
I have created a VoIP app in iOS
using the Sinch
library. I am able to make calls successfully, but am having trouble creating the double-height in-call status bar. By this I mean, my call window appears, and on that window I have a button to leave the view and go somewhere else (WITHOUT hanging up the call) and I would like a green double height in-call status bar to be displayed so that I may tap it and return me to call view.
当我将应用程序发送到后台时,我在跳板上看到双高红色条返回我的应用程序,因此后台模式&voip 模式似乎设置正确.我确信 WhatsApp
设法获得绿条(如此处).
When I send the app to the background, I see the double-height red bar to return to my app on springboard, so the background mode & voip mode seems to be set correctly. I know for sure WhatsApp
manage to get the green bar (as seen here).
我已经搜索了一段时间,我能找到的最好的方法是使用 AVAudioSession
作为回答 这个问题.
I've searched for a while now and the best I could find is to use AVAudioSession
as answered on this question.
但是,即使按照那里的说明进行操作并尝试添加一些其他想法,我也无法弹出绿色通话状态栏.感觉就像我必须告诉 iOS
我的呼叫是在哪个视图上处理的?以便知道何时显示绿色条?
However even after following the instructions there and trying to add some other ideas, I can't get the green in-call status bar to popup. It feels like I would have to tell iOS
which view my call is being handled on? So that it knows when to show the green bar?
我试过的代码:
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionModeVoiceChat error:nil];
[[AVAudioSession sharedInstance] setActive:YES error:nil];
这显然已经由 Sinch
处理,但是,正如他们的 文档 所以我真的很茫然.
This is apparently already handled by Sinch
however, as mentioned in their documentation so really I'm at a loss.
Sinch SDK 应用音频会话类别模式 AVAudioSessionModeVoiceChat 以提高语音质量.
The Sinch SDK applies the audio session category mode AVAudioSessionModeVoiceChat for improved voice quality.
推荐答案
感谢来自 Sinch 的 @cjensen他的帮助,很有用.发布我自己的答案,因为我觉得他的回答并没有完全回答我的问题.
Thanks to @cjensen from Sinch for his help, was useful. Posting my own answer as I don't feel that his response fully answers my question.
基本上 iOS 没有显示应用内状态栏的内置功能,您需要创建自己的.@cjensen 的回复让我看到了这篇文章解释一下.
Basically iOS has no inbuilt functionality to display an in-app status bar, you need to create your own. @cjensen's response led me to this article explaining this.
如果需要应用内调用状态栏,需要自己创建或者使用KrauseFx之类的库TSMessages 为你做这件事.使用@cjensen 建议的 UILocalNotification
只是提供一个入口点来决定何时创建此横幅的一种方式.
If you need an in-app call status bar, you need to create it yourself or use a library like KrauseFx's TSMessages to do it for you. Using a UILocalNotification
as @cjensen suggested is simply one way to provide an entry point to decide when to create this banner.
这篇关于在 iOS 中显示自定义 VoIP 应用程序的通话状态栏(双高)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!