I made the plugin in flutter which defines a service for the app. for e.g. MyFirebaseMessagingService
.
我在flutter中做了一个插件,它为应用程序定义了一个服务。例如MyFirebaseMessagingService。
As we all know we need to reference it from AndroidManifest.xml.
I tried to define the service inside the plugin's AndroidManifest and included this plugin into the application, when I built the application this does not invoke.
众所周知,我们需要从androidManifest.xml中引用它。我试图在插件的androidManifest中定义服务,并在构建不会调用的应用程序时将该插件包含到应用程序中。
<service android:name=".MyFirebaseMessagingService" android:exported="false" android:directBootAware="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
Other than that I tried to reference .MyFirebaseMessagingService
from the application's AndroidMainfiest
like so: com.example.myPlugin.MyfirebaseMessagingService
but it can't see it.
除此之外,我尝试从应用程序的androidMainfiest中引用.MyFirebase MessagingService,如下所示:com.example.myPlugin.MyfirebaseMessagingService,但它看不到它。
So THE QUESTION IS, if there is a way to make application use the services from the plugin ?
所以问题是,是否有一种方法可以让应用程序使用插件中的服务?
更多回答
优秀答案推荐
我是一名优秀的程序员,十分优秀!