android - 当移动应用程序(iOS和Android)进入后台时,该持续的通话/正在进行中的栏是什么?

标签 android ios android-studio

至少对于iOS,诸如Spotify,环聊和Google Maps之类的应用程序可以显示出它们在后台(当您暂时离开它们以检查其他应用程序等时)仍处于 Activity 状态。在iOS中,状态栏通常显示为较粗的状态栏。

screenshot showing example of such a bar

其他变体:

enter image description here

这个酒吧叫什么名字,这可能会在Android上实现吗?我有一个使用TokBox(本质上是WebRTC)的视频聊天应用程序(在Google Play和App Store中都使用),并且在后台运行时它已经为iOS渲染了此栏,但没有Android。

最佳答案

中指示正在进行的电话的一致方式是使用通知。在这种情况下,Android手机应用程序还会使用通知:

Android In-Call Notification

为防止用户取消此通知,您可以使用FLAG_ONGOING_EVENTFLAG_NO_CLEAR-请参见https://developer.android.com/reference/android/app/Notification#FLAG_ONGOING_EVENT

iOS 上,您可能想要设置特定的Audio ModeAudio Category以获得正确的状态栏外观。

参见https://developer.apple.com/documentation/audiotoolbox/audio_session_services/1618405-audio_session_modes
https://developer.apple.com/documentation/audiotoolbox/audio_session_services/1618427-audio_session_categories

此外,还需要Background Audio功能-否则,将您的Apps音频 session 移至后台后,它将停止。

为了获得更加一致的用户体验,您可能需要集成iOS CallKit或Android ConnectionService,请参阅
-https://developer.apple.com/documentation/callkit
-https://developer.android.com/reference/android/telecom/ConnectionService

关于android - 当移动应用程序(iOS和Android)进入后台时,该持续的通话/正在进行中的栏是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52340528/

相关文章:

java - 有关小部件上下文/生命周期的信息

ios - 我的 View Controller 没有出现在屏幕上

java - 如何使用 Retrofit 发布多个 JSON 数组(Android、Java)

Android API 14 - 网络操作/AsyncTask

android - App Crashing using Android Studio, Sunshine App, 无法获取AsyncTask的概念

iOS Storyboarding App-Wide 元素(持久性侧边栏)

iphone - 我们可以在多个 View 上添加单个手势并使其工作吗?

android-studio - <Flutter> 模拟器已启动但未被 android studio 检测到

android-studio - Android Studio 中的警告屏幕选项在哪里?

android - AdMob 响应消息为空或零长度