这是我的项目文件夹结构。
应用/
FCM/
FcmMessagingService.class
FcmRegistrationService.class
谷歌-services.json
的Android的Manifest.xml
Android的的Manifest.xml
Android库项目中的Firebase云消息传递。
<service android:name=".fcm.FcmRegistrationService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
<service android:name=".fcm.FcmMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
库(子模块)/
FCM/
LibMessagingService.class
LibRegistrationService.class
穿心莲内酯ID-的Manifest.xml
Android系统的Manifest.xml
<service android:name=".fcm.LibRegistrationService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
<service android:name=".fcm.LibMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
通过以上的实施,我可以能够捕捉到INSTANCE_ID_EVENT和MESSAGING_EVENT,只有从应用程序的服务类。库模块中的Firebase服务类完全没有触发。
是否有可能同时触发两个应用程序和库模块,接收到的消息火力点当服务类?
您是否找到了解决方案? – Blagojco
@Blagojco是的,我发现周围的工作这一点。在我的图书馆,我添加的实际FCM服务和应用程序的FCM服务类将延长我的图书馆的FCM服务,而不是谷歌的FCM服务。 – Karthik