Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3256880
D6275.id21364.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D6275.id21364.diff
View Options
diff --git a/native/android/app/src/main/AndroidManifest.xml b/native/android/app/src/main/AndroidManifest.xml
--- a/native/android/app/src/main/AndroidManifest.xml
+++ b/native/android/app/src/main/AndroidManifest.xml
@@ -30,7 +30,6 @@
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
- <service android:name="io.invertase.firebase.messaging.RNFirebaseBackgroundMessagingService" />
<activity
android:name=".MainActivity"
android:launchMode="singleTask"
diff --git a/native/android/app/src/main/java/app/comm/android/notifications/CommNotificationsHandler.java b/native/android/app/src/main/java/app/comm/android/notifications/CommNotificationsHandler.java
--- a/native/android/app/src/main/java/app/comm/android/notifications/CommNotificationsHandler.java
+++ b/native/android/app/src/main/java/app/comm/android/notifications/CommNotificationsHandler.java
@@ -20,37 +20,12 @@
import app.comm.android.fbjni.MessageOperationsUtilities;
import app.comm.android.fbjni.NetworkModule;
import app.comm.android.fbjni.ThreadOperations;
+import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
-import io.invertase.firebase.messaging.RNFirebaseMessagingService;
import java.io.File;
import me.leolin.shortcutbadger.ShortcutBadger;
-/**
- * We're extending RNFirebaseMessagingService here instead of
- * FirebaseMessagingService which is not ideal but let's us work around an
- * Android limitation. If there are a couple of FirebaseMessagingServices
- * declared in manifest, only the first one would get all the notifications.
- * So we need to find a way to have only one service that implements this.
- *
- * There are a couple of solutions here:
- * 1. We could have both services declared and only one of them would handle
- * the intents. Then it would check the intent and forward it to
- * another service. This solution is problematic as the second service would
- * need to listen for a different set of intents that effectively duplicate
- * all the notifications intents.
- * 2. We can instantiate RNFirebaseMessagingService here and call its callbacks
- * which sounds like a good solution. But then, some mechanisms would not work
- * correctly, e.g. we would need to somehow take care of the Context.
- * 3. This solution, in which we extend RNFirebaseMessagingService, would
- * consist of implementing the callbacks and either handling them or calling
- * super methods. In near future we plan to get rid of
- * RNFirebaseMessagingService and at that point super methods will no longer be
- * called and this class could start implementing FirebaseMessagingService.
- *
- * There's nothing that makes 1st and 2nd solution impossible, but 3rd one is
- * the easiest in terms of making it safe.
- */
-public class CommNotificationsHandler extends RNFirebaseMessagingService {
+public class CommNotificationsHandler extends FirebaseMessagingService {
private static final String BADGE_KEY = "badge";
private static final String BADGE_ONLY_KEY = "badgeOnly";
private static final String BACKGROUND_NOTIF_TYPE_KEY = "backgroundNotifType";
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 9:01 PM (21 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2503546
Default Alt Text
D6275.id21364.diff (3 KB)
Attached To
Mode
D6275: Stop subclassing RNFirebaseMessagingService as its functionality is not used anymore
Attached
Detach File
Event Timeline
Log In to Comment