如何和在MAUI程序中订阅android的广播消息。

猪哥哥 0 Reputation points
2023-02-27T06:15:05.33+00:00

以前在xamarin中可以通过 activity.RegisterReceiver(receiver, new IntentFilter("com.xamarin.example.TEST"));来订阅系统广播,或其他app的广播消息。请问在MAUI中怎么订阅呢?谢谢。

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,883 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Alessandro Caliaro 4,181 Reputation points
    2023-02-27T06:24:56.75+00:00

    I think in the same way. In the platforms/android directory you have a MainActivity class where you can register your broadcastreceivers