Android通话期间能否展示弹窗通知?含替代方案咨询
Android通话期间弹窗通知可行性及替代方案咨询
我遇到一个问题,在官方文档里没找到明确答案,想咨询:Android设备处于通话状态时,能不能展示弹窗形式的推送/本地通知?
我已经做过这些尝试:
- 配置了弹窗通知的所有必要参数,比如设置了NotificationChannel的
IMPORTANCE_MAX,旧设备也配置了Priority MAX - 参考过类似场景的解决方案,但并不适用于我的情况
- 测试了其他应用,发现就连WhatsApp在通话过程中也不会弹出通知
另外想了解替代方案:使用SMS作为通知载体是否可行?因为SMS属于系统内置功能,通话时会不会被允许弹窗?
附上我的相关代码片段:
通知通道配置(部分)
val notificationChannel = NotificationChannel(notificationChannelID, "com.qyooz.notification1", NotificationManager.IMPORTANCE_MAX)
通知配置代码
val estimated_time_notification = NotificationCompat.Builder(applicationContext, notificationChannelID) .setSmallIcon(R.drawable.ic_notification) .setLargeIcon(bitMapIconEstimated) .setContentTitle("Estimated waiting time:") .setContentText("$totalWaitingTime") .setAutoCancel(true) .setChannelId(notificationChannelID) .setStyle(NotificationCompat.DecoratedCustomViewStyle()) .setContentIntent(pendingIntent) .setGroup(GROUP_KEY) .setPriority(NotificationCompat.PRIORITY_MAX).build()
提前感谢解答。
内容的提问来源于stack exchange,提问作者shahaf tepler
相关产品推荐
相关产品推荐

