如何和在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中怎么订阅呢?谢谢。

Community Center | Not monitored
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Alessandro Caliaro 4,201 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


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.