SDK-324 - Updated way of handling notifications to not use AsyncTask#981
Open
franco-zalamena-iterable wants to merge 3 commits intomasterfrom
Open
SDK-324 - Updated way of handling notifications to not use AsyncTask#981franco-zalamena-iterable wants to merge 3 commits intomasterfrom
franco-zalamena-iterable wants to merge 3 commits intomasterfrom
Conversation
43368df to
bfd33a5
Compare
|
|
||
| Bundle extras = IterableNotificationHelper.mapToBundle(messageData); | ||
| return IterableNotificationHelper.isGhostPush(extras); | ||
| private static void enqueueNotificationWork(@NonNull final Context context, @NonNull final Bundle extras, boolean isGhostPush) { |
Check notice
Code scanning / CodeQL
Useless parameter Note
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔹 Jira Ticket(s) if any
✏️ Description
Migrates push notification handling from the deprecated
AsyncTaskto Android'sWorkManagerwith expedited work support.Why
AsyncTaskwas deprecated in API 30. Firebase and Android documentation explicitly recommendWorkManagerfor processing FCM messages:How
IterableFirebaseMessagingService- replacedAsyncTaskexecution withenqueueNotificationWork(), which schedules an expeditedOneTimeWorkRequestviaWorkManager. Includes a fallback that posts directly if scheduling fails.IterableNotificationWorkScheduler(new) - schedules expedited work withOutOfQuotaPolicy.RUN_AS_NON_EXPEDITED_WORK_REQUEST, ensuring notifications are always processed even when quota is exhausted.IterableNotificationWorker(new) -Workersubclass that deserializes notification data, builds the notification, and posts it. OverridesgetForegroundInfo()for pre-Android 12 compatibility.IterableNotificationHelper- added null-safety checks onextrasparameter.IterableNotificationManager- marked@Deprecated, kept for backward compatibility.Since
minSdkVersionis 21, devices running Android 5–11 requiregetForegroundInfo()to avoidIllegalStateExceptionwhen running expedited work:Dependencies
androidx.work:work-runtime:2.9.0androidx.work:work-testing:2.9.0(test only)