Skip to content

Commit ec72a3e

Browse files
Remove failure handling for the enqueueing since expedited has been removed
1 parent 3f28552 commit ec72a3e

File tree

2 files changed

+1
-34
lines changed

2 files changed

+1
-34
lines changed

iterableapi/src/main/java/com/iterable/iterableapi/IterableFirebaseMessagingService.java

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import com.google.firebase.messaging.RemoteMessage;
1212

1313
import java.util.Map;
14-
import java.util.UUID;
1514
import java.util.concurrent.ExecutionException;
1615

1716
public 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
}

iterableapi/src/main/java/com/iterable/iterableapi/IterableNotificationWorkScheduler.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class IterableNotificationWorkScheduler {
2121

2222
interface SchedulerCallback {
2323
void onScheduleSuccess(UUID workId);
24-
void onScheduleFailure(Exception exception, Bundle notificationData);
2524
}
2625

2726
IterableNotificationWorkScheduler(@NonNull Context context) {
@@ -59,10 +58,6 @@ void scheduleNotificationWork(
5958

6059
} catch (Exception e) {
6160
IterableLogger.e(TAG, "Failed to schedule notification work", e);
62-
63-
if (callback != null) {
64-
callback.onScheduleFailure(e, notificationData);
65-
}
6661
}
6762
}
6863

0 commit comments

Comments
 (0)