1111import com .google .firebase .messaging .RemoteMessage ;
1212
1313import java .util .Map ;
14- import java .util .UUID ;
1514import java .util .concurrent .ExecutionException ;
1615
1716public class IterableFirebaseMessagingService extends FirebaseMessagingService {
@@ -146,18 +145,7 @@ private static void enqueueNotificationWork(@NonNull final Context context, @Non
146145
147146 scheduler .scheduleNotificationWork (
148147 extras ,
149- new IterableNotificationWorkScheduler .SchedulerCallback () {
150- @ Override
151- public void onScheduleSuccess (UUID workId ) {
152- IterableLogger .d (TAG , "Notification work scheduled: " + workId );
153- }
154-
155- @ Override
156- public void onScheduleFailure (Exception exception , Bundle notificationData ) {
157- IterableLogger .e (TAG , "Failed to schedule notification work, falling back" , exception );
158- handleFallbackNotification (context , notificationData );
159- }
160- }
148+ workId -> IterableLogger .d (TAG , "Notification work scheduled: " + workId )
161149 );
162150 }
163151
@@ -172,20 +160,4 @@ private static void handleNow(@NonNull Context context, @NonNull Bundle extras)
172160 IterableLogger .e (TAG , "Failed to post notification directly" , e );
173161 }
174162 }
175-
176- private static void handleFallbackNotification (@ NonNull Context context , @ NonNull Bundle extras ) {
177- try {
178- IterableNotificationBuilder notificationBuilder = IterableNotificationHelper .createNotification (
179- context .getApplicationContext (), extras );
180- if (notificationBuilder != null ) {
181- IterableNotificationHelper .postNotificationOnDevice (context , notificationBuilder );
182- IterableLogger .d (TAG , "✓ FALLBACK succeeded - notification posted directly" );
183- } else {
184- IterableLogger .w (TAG , "✗ FALLBACK: Notification builder is null" );
185- }
186- } catch (Exception fallbackException ) {
187- IterableLogger .e (TAG , "✗ CRITICAL: FALLBACK also failed!" , fallbackException );
188- IterableLogger .e (TAG , "NOTIFICATION WILL NOT BE DISPLAYED" );
189- }
190- }
191163}
0 commit comments