I'm implementing an sdk which uses firebase (every app that uses the sdk is subscribing to firebase and has the google-services.json
in its context, and when i send a push from my server to EventsService
listed below, i receive the push in onMessageRecieved.
AppManifest :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test.sampleapplication">
...
<application
...
<service android:name=".EventsService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
</application>
</manifest>
EventsService.java :
public class EventsService extends FirebaseMessagingService {
@Override
public void onMessageReceived(RemoteMessage message) {
...
}
}
SdkManifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.my.sdk">
...
<application
...
<service android:name=".SdkEventsService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
</application>
</manifest>
Now, i want SdkEventsService
to receive the event as well, and basically catch the event in the sdk as well.
However, SdkEventsService
receives the push from firebase ONLY if the EventsService
defined in the app is deleted.
Fyi, it seems that the issue is really : how to define 2 services that catch com.google.firebase.MESSAGING_EVENT
simultaneously and are kinda independant of each other.
- I tried setting
SdkEventsService
a lot of tags (android:exported="true"
fe), but none worked. - I don't want
EventsService
to 'alert' the sdk when a push is received, because i don't want to rely on the client to notify the sdk. - I don't want
EventsService
to extend a base class from the sdk, which will receive the push, because well.. it's quite ugly and not professional. - Basically, i would like a minimum client interference, and i wish the process to be transparent as much as possible.
just saying : this question is really not my issue, and i haven't find anything like this here :(