如何在Flutter中通过锁屏显示窗口小部件?

问题描述 投票:1回答:1

我正在Flutter中构建VoIP呼叫应用。我需要提醒用户并在屏幕上显示Widget,以便用户可以在不解锁电话的情况下接受或拒绝来电。所以基本上我需要this的Flutter版本。

flutter lockscreen
1个回答
0
投票

您可能需要通过flutter应用程序使用MethodChannel才能进行本机android访问。在android中,您可以使用setFullScreenIntent(..)创建通知官方文档中提到<< [Only for use with extremely high-priority notifications demanding the user's immediate attention, such as an incoming phone call

NotificationCompat.Builder builder = new NotificationCompat.Builder(this,"methodId") .setContentText(" content ") .setContentTitle("Title..") .setFullScreenIntent(...) .setSmallIcon(R.drawable.launch_background)
© www.soinside.com 2019 - 2024. All rights reserved.