You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$250] Android - Notification shortcut are not display when longpress app icon #96377
Version Number: 9.4.36-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:https://github.com/Expensify/Expensify/issues/430593 Email or phone of affected tester (no customers): - Issue reported by: Applause Internal Team Bug source: Regression TC Execution Device used: Google Pixel 7 Pro - Android 16
Action Performed:
Precondition: 2 accounts log in 2 devices
Log in to NewDot on Android native
Accept notification permission
Leave the app
Send yourself a DM from another account
Long-press on the app icon
Verify that the message notification is displayed as a shortcut
Expected Result:
Verify that the message notification is displayed as a shortcut
The Android conversation shortcut is created natively while the push notification is being built, not from JS. When a DM push arrives, Airship invokes CustomNotificationProvider.applyMessageStyle(), which calls ShortcutManagerUtils.addDynamicShortcut() → ShortcutManagerCompat.pushDynamicShortcut(), then links the notification to it with builder.setShortcutId(accountID). All the ingredients Android needs (long-lived shortcut + Person + MessagingStyle + matching shortcutId) are present, so the recipe itself is correct.
The most likely cause of the regression is that the app now targets Android 16 (targetSdkVersion = 36, android/build.gradle:6-7), and the shortcut is pushed from a background push-processing context. Newer Android versions rate-limit / restrict pushDynamicShortcut when the app is not in the foreground, so the call can be silently dropped or throw. Critically, any failure is swallowed — addDynamicShortcut has no error handling, and the outer block only does e.printStackTrace(). A throw at line 236 aborts beforesetStyle/setShortcutId at 267-268, producing exactly the reported symptom: the notification still shows, but no shortcut appears on long-press.
⚠️This is a medium-confidence hypothesis. The shortcut mechanism is well understood, but why it fails on Android 16 needs on-device confirmation (see verification steps below). The exact regression point could not be bisected (shallow checkout).
What changes do you think we should make in order to solve the problem?
Add error handling + logging around addDynamicShortcut/pushDynamicShortcut so the failure is no longer silent — this is the fastest way to confirm the mechanism in production logs (Firebase/Sentry) instead of guessing.
Guard against background rate-limiting on Android 16: check ShortcutManagerCompat.isRateLimitingActive() before pushing, and if the OS blocks background publishing on API 36, re-publish the shortcut from a foreground-eligible path (e.g. when the app next enters the foreground, or via the existing ShortcutManager JS module) rather than only during headless push processing.
Add a regression test / QA step for the long-press shortcut on an Android 16 device.
What alternative solutions did you explore? (Optional)
Alternatives & things to rule out
Shortcuts cleared by deregister churn — JS deregister() calls removeAllDynamicShortcuts(). If register/deregister fires around notification receipt on Android 16, a freshly created shortcut could be wiped. Worth confirming it isn't firing unexpectedly.
Intent scheme mismatch — the shortcut uses new-expensify://r/<reportID> with no explicit package; verify Android 16 doesn't reject a shortcut whose intent scheme isn't resolvable in the effective manifest.
HybridApp caveat — the shipped Android app is HybridApp, which builds from the Mobile-Expensify submodule (not part of this public repo). If Mobile-Expensify ships its own copy of the notification provider, the effective code path may live there. This should be verified before implementing — if so, the fix must be made in Mobile-Expensify by an internal engineer.
Verification (needed to confirm root cause): On an Android 16 device running 9.4.36-0, reproduce the flow and capture adb logcat (tag NotificationProvider, plus any ShortcutManager rate-limit warnings) and adb shell dumpsys shortcut to see whether the shortcut was published, rate-limited, or rejected.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/96377) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
🚨 Edited by proposal-police: This proposal was edited at 2026-07-17 10:09:46 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Android (HybridApp), receiving a chat message push while the app is backgrounded no longer publishes a conversation shortcut, so long-pressing the app icon shows no notification shortcut. This is a regression of TC 430593, which passed after the shortcut support was ported to the HybridApp in September 2025 (#66703, Mobile-Expensify PRs #13653/#13679). The notification itself still arrives — only the dynamic shortcut (and conversation styling) is gone.
What is the root cause of that problem?
The shipping Android binary is the HybridApp built from Mobile-Expensify/Android (see .github/workflows/buildAndroid.yml), where ExpensifyNotificationProvider applies the MessagingStyle and publishes the shortcut via PushNotificationManager.addMessageShortcut(...) → ShortcutManagerCompat.pushDynamicShortcut(...). Since the Airship 26.5.0 upgrade (App PR #92497 plus its companion Mobile-Expensify PR #13960, merged 2026-06-08), the only way this custom provider gets installed is the new plugin-extender mechanism: the plugin removed the legacy com.urbanairship.reactnative.AIRSHIP_EXTENDER hook, and the framework proxy's BaseAutopilot now discovers the extender by reading the com.urbanairship.plugin.extender manifest meta-data and instantiating that class reflectively via Class.forName(...). The standalone app uses the identical pattern — a manifest string pointing at a tiny class whose only job is pushManager.setNotificationProvider(...):
I decompiled the current production HybridApp APK (9.4.33-8, the build the issue reproduces on in production). The manifest correctly declares com.urbanairship.plugin.extender → org.me.mobiexpensifyg.CustomAirshipExtender, but that class does not exist anywhere in the DEX, and neither does ExpensifyNotificationProvider. The ported shortcut publisher PushNotificationManager.addMessageShortcut is still compiled in (it survives because PushNotificationManager is kept for the YAPL JS bridge) but has zero call sites in the entire APK — it is dead code. R8 even proved the consequence at build time: in the shipped proxy bytecode, ExtenderProvider.get() was rewritten to unconditionally return null because no AirshipPluginExtender implementor exists in the program:
// decompiled from the production APK (9.4.33-8)publicfinalAirshipPluginExtenderget(Contextcontext) {
if (this.created) returnnull;
createExtender(context);
returnnull; // R8 const-propagated: the extender can never load in this binary
}
The cause is R8 shrinking, which is enabled for HybridApp release builds (CI collects outputs/mapping/*/mapping.txt; class names are unobfuscated, so it runs shrink-only). The extender class is referenced solely by the manifest meta-data string — a reference neither R8 nor aapt2's generated keep rules treat as a root (aapt2 only keeps manifest components like activities/services, not meta-data values) — and there is no -keep rule for it, so R8 stripped it, taking ExpensifyNotificationProvider with it as unreachable. At runtime Class.forName throws ClassNotFoundException, the proxy swallows it (logcat shows "Unable to create extender: org.me.mobiexpensifyg.CustomAirshipExtender"), and pushes are built by the stock ReactNotificationProvider: plain BigText notification, no setShortcutId, and pushDynamicShortcut is never called — exactly the reported symptom, with conversation styling/avatars silently lost too. This slipped through because debug builds don't minify (PR testing passed) and PR #92497's QA steps only verified that a notification arrives and opens the right report, which the stock provider still satisfies.
What changes do you think we should make in order to solve the problem?
Add an R8 keep rule for the Airship plugin extender to the Mobile-Expensify Android release build (companion PR, same as the #66703 fix precedent), and the same rule to the standalone app's android/app/proguard-rules.pro, which has the identical latent defect — com.expensify.chat.customairshipextender.CustomAirshipExtender is also referenced only from the manifest string and enableProguardInReleaseBuilds is true. Keying the rule on the interface makes it survive future class renames:
# Airship's framework proxy loads the plugin extender reflectively from the
# com.urbanairship.plugin.extender manifest meta-data, so R8 must not strip it.
-keep class * implements com.urbanairship.android.framework.proxy.AirshipPluginExtender {
public <init>();
}
This is safe and minimal: it only pins one tiny class per app (plus its no-arg constructor, which the proxy invokes via getDeclaredConstructor()), and once the implementor is kept, R8 no longer const-propagates the null through ExtenderProvider.get(), so the extender loads and ExpensifyNotificationProvider is registered again — restoring the shortcut publish, setShortcutId, and MessagingStyle in one shot. No keep rule is needed for the provider itself since the kept extender references it directly. The fix is verifiable end-to-end on a release/staging build: logcat no longer shows "Unable to create extender", and after a background DM push, adb shell dumpsys shortcut lists the sender's dynamic shortcut (category msg), which then appears in the launcher long-press menu:
What alternative solutions did you explore? (Optional)
I considered registering the provider directly in code from OldDot's Airship bootstrap (a direct constructor reference R8 can trace, removing the reflection fragility entirely), but rejected it as the primary fix because the proxy's BaseAutopilot.onAirshipReady deliberately installs its own ReactNotificationProvider before invoking extenders — the extender hook exists precisely to guarantee our provider is set last, and a direct registration elsewhere risks being clobbered by that ordering. I also ruled out Android 16 shortcut rate-limiting as the cause: pushDynamicShortcut is exempt from background rate limits by design, and the decompiled production APK proves the publish code is unreachable, so no runtime throttling theory is needed.
Please re-state the problem that we are trying to solve in this issue.
On Android, when a user receives a DM and then long-presses the app icon on the launcher, no conversation shortcut appears. The notification renders correctly but the entry is absent from the launcher shortcut menu. Reproduced on Pixel 7 Pro / Android 16 (v9.4.36-0).
What is the root cause of that problem?
Primary cause (blocker): wrong shortcut category constant
android/app/src/main/java/com/expensify/chat/shortcutManagerModule/ShortcutManagerUtils.java line 3 imports:
This constant resolves to the string "msg" — a notification category used to signal urgency to the system. It is then passed directly into the shortcut's category set (line 29):
Android's launcher long-press menu only surfaces shortcuts whose category set contains ShortcutInfo.SHORTCUT_CATEGORY_CONVERSATION ("android.shortcut.conversation"). A shortcut categorised as "msg" is treated as a generic shortcut and is never allocated a conversation slot in the launcher, regardless of whether MessagingStyle, setShortcutId, or setLongLived are correctly configured. This is the definitive reason the shortcut never appears.
Secondary gaps (good-practice, won't unblock launcher on their own)
The ShortcutInfoCompat in addDynamicShortcut does not call .setLocusId(new LocusIdCompat(accountID)), and builder in applyMessageStyle (line 268) does not call builder.setLocusId(new LocusIdCompat(accountID)). A matching LocusId pair lets Android correlate the app surface, the shortcut, and the notification into one conversation entity and is required for full Android 12+ conversation-notification ranking. Separately, ShortcutManagerCompat.reportShortcutUsed is never called after pushDynamicShortcut, which suppresses recency-based launcher ranking.
What changes do you think we should make in order to solve the problem?
Fix 1 — correct the shortcut category (root cause, required)
In android/app/src/main/java/com/expensify/chat/shortcutManagerModule/ShortcutManagerUtils.java:
Note: NotificationCompat.CATEGORY_MESSAGE should still be imported in CustomNotificationProvider.java for builder.setCategory(CATEGORY_MESSAGE) at line 110 — that usage is correct and must not be changed.
Receive a DM while the app is backgrounded on Android 11+ (Pixel 7 Pro / Android 16 matches the repro device).
Long-press the app icon — the sender's conversation should appear as a shortcut entry.
Log out or call ShortcutManagerModule.removeAllDynamicShortcuts — confirm the shortcut is cleared.
Fixes 2 and 3 require no platform gating because LocusIdCompat and ShortcutManagerCompat.reportShortcutUsed are no-ops below Android R via the Compat shims.
What alternative solutions did you explore?
Adding only setLocusId / reportShortcutUsed (the approach in the first-pass proposal): these are improvements but do not fix the root problem. A shortcut with the wrong category still never appears in the launcher's conversation slot regardless of LocusId pairing or usage reporting.
Removing setLongLived: not viable — setLongLived(true) is required so the shortcut outlives the notification's lifetime; removing it would cause the shortcut to be garbage-collected when the notification is dismissed.
Note: This isn't a duplicate of the flagged proposal — That proposal blames a build-time failure — R8 shrinking strips CustomAirshipExtender (referenced only from the com.urbanairship.plugin.extender manifest meta-data), so ExpensifyNotificationProvider is never registered and addMessageShortcut is dead code; the fix is a -keep rule in proguard-rules.pro.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Android, long-pressing the app icon does not show the expected conversation/notification shortcuts (the recent-chat shortcuts that should appear in the launcher pop-up menu).
What is the root cause of that problem?
The only code path that ever publishes a launcher shortcut is ShortcutManagerUtils.addDynamicShortcut(...), and it is invoked from exactly one place — CustomNotificationProvider.applyMessageStyle(...) when a message push notification is received:
personIcon comes from fetchIcon(), which returns null when the avatar URL is null/malformed or the fetch fails. IconCompat.createWithBitmap(null) throws, so pushDynamicShortcut never runs and no shortcut is registered — the long-press menu stays empty. Additionally, shortcuts are wiped on deregister/logout (ShortcutManager.removeAllDynamicShortcuts()) and are never re-published proactively, so until a fresh push with a valid avatar arrives the launcher shows nothing.
What changes do you think we should make in order to solve the problem?
Guard the icon in addDynamicShortcut so a null bitmap doesn't abort publication, falling back to a static app icon:
This ensures pushDynamicShortcut always succeeds so the shortcut appears on long-press even when the avatar can't be loaded. Regression check: verify shortcuts still appear with a valid avatar and that the fallback icon shows when the avatar is missing.
🚨 Edited by proposal-police: This proposal was edited at 2026-07-17 10:09:01 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Android, after receiving a DM push notification while the app is backgrounded/killed, long‑pressing the app icon does not show the sender as a conversation shortcut. The notification itself is posted, but no launcher shortcut for it appears.
What is the root cause of that problem?
The launcher shortcut is a conversation shortcut that Android only surfaces if we actually publish a long‑lived dynamic shortcut (ShortcutManagerCompat.pushDynamicShortcut) and tag the notification with a matching setShortcutId. We do publish it — but only from inside applyMessageStyle, and the publish call sits after we turn the fetched avatar into an IconCompat, all wrapped in a try/catch that silently falls back to a plain notification.
The shortcut is published here, right after building the avatar icon:
fetchIcon returns null whenever the avatar can't be downloaded within its 8s window — which is exactly what tends to happen when the push is handled by a cold background process (the repro literally starts with "Leave the app" before the DM arrives):
When personIcon is null, IconCompat.createWithBitmap(personIcon) at L234 throws beforeShortcutManagerUtils.addDynamicShortcut(...) at L236 ever runs, and the exception is swallowed by the surrounding catch:
So the base notification still posts, but no dynamic/conversation shortcut is published — hence nothing shows in the app‑icon long‑press menu. addDynamicShortcut compounds this by making the bitmap mandatory too (setIcon(IconCompat.createWithBitmap(personIcon))):
What changes do you think we should make in order to solve the problem?
Stop letting a missing avatar abort shortcut publication. Build the Person/shortcut with a fallback icon when fetchIcon returns null, so the shortcut is always pushed:
BitmappersonIcon = fetchIcon(context, avatar);
if (personIcon != null) {
builder.setLargeIcon(personIcon);
}
// Fall back to the launcher icon so the Person/shortcut stay valid even when// the avatar can't be fetched in time (e.g. a cold background push process).IconCompatpersonIconCompat = personIcon != null
? IconCompat.createWithBitmap(personIcon)
: IconCompat.createWithResource(context, R.mipmap.ic_launcher);
Personperson = createMessagePersonObject(personIconCompat, accountID, name);
ShortcutManagerUtils.addDynamicShortcut(context, reportID, name, accountID, personIcon, person);
And make the icon optional inside addDynamicShortcut so a null bitmap can't stop pushDynamicShortcut:
With these two changes the conversation shortcut is published on every report‑comment push, independent of whether the avatar resolves, so it reliably shows in the launcher long‑press menu.
What specific scenarios should we cover in automated tests to prevent this problem from happening again?
An instrumented test that runs onExtendBuilder/applyMessageStyle for a report‑comment payload whose avatar URL is unreachable/slow (so fetchIcon returns null), then asserts ShortcutManagerCompat.getDynamicShortcuts(context) contains a shortcut whose id equals accountID, and that the posted notification's shortcutId matches it.
The happy path with a valid avatar: the shortcut is published with the avatar icon and the notification carries the matching shortcutId.
What alternative solutions did you explore? (Optional)
Publish the shortcut first (before any avatar/messaging‑style work) and update its icon asynchronously once fetchIcon completes — this guarantees the shortcut exists immediately, but it splits the shortcut into two writes and adds ordering complexity for little gain over the fallback‑icon approach above. I also considered skipping the network avatar fetch on the notification thread entirely and always using a generated initials avatar, but that would regress the avatars currently shown in the notification shade.
I found that creating the conversation shortcut depends on successfully downloading the sender’s avatar. fetchIcon() returns null for a missing/malformed URL, a timeout, or any download error.
However, applyMessageStyle() passes that nullable bitmap unconditionally to IconCompat.createWithBitmap() before calling addDynamicShortcut(). When the bitmap is unavailable, this throws and the shortcut is never published.
The outer handler catches this failure and returns Airship’s default notification builder, which explains why the message notification itself appears while its launcher shortcut is missing.
Log.e(TAG, "Failed to parse conversation, falling back to default notification style. SendID=" + message.getSendId(), e);
}
returnbuilder;
The shortcut implementation was introduced without nullable-avatar handling, and the recent Airship upgrade only adapted the avatar-loading API, preserving this failure path.
What changes do you think we should make in order to solve the problem?
I think we should make the avatar optional in applyMessageStyle() and ShortcutManagerUtils.addDynamicShortcut(). We should always construct and publish the shortcut, but only add bitmap icons to the Person, notification, and shortcut when fetchIcon() returns a bitmap.
For example, the shortcut construction would change along these lines:
- .setIcon(IconCompat.createWithBitmap(personIcon))+ if (personIcon != null) {+ builder.setIcon(IconCompat.createWithBitmap(personIcon));+ }
The same conditional handling should be used when creating the Person and setting the notification’s large icon. The remaining shortcut metadata—label, deep-link intent, message category, long-lived status, and person—already contains everything needed to publish and open the conversation.
This does not change successful avatar downloads or existing shortcut navigation. It only allows the existing fallback path to publish a shortcut without a custom avatar instead of aborting the entire conversation-style setup. I would test both a valid avatar and a missing/failed avatar, confirm the message remains visible, long-press the launcher icon to verify the shortcut appears, and verify that tapping it opens the correct report.
What alternative solutions did you explore? (Optional)
We could use a bundled default bitmap whenever the avatar download fails. However, making the icon optional is smaller and avoids manufacturing or maintaining another avatar asset; Android can render the shortcut using its remaining person and label metadata.
When a new comment notification is received, the showCommentNotification function in LocalNotification/index.ts is responsible for triggering its display:
This function delegates to BrowserNotifications.pushReportCommentNotification. On Android, for a notification to appear as a dynamic shortcut when the app icon is long-pressed, the application must explicitly publish a ShortcutInfo object using the Android ShortcutManager API. The current Android-specific implementation of BrowserNotifications.pushReportCommentNotification does not include the necessary calls to the ShortcutManager to create and update these dynamic shortcuts. Consequently, while the notification itself is displayed, it is not registered with the system as a shortcut, leading to its absence from the long-press menu.
What changes do you think we should make in order to solve the problem?
Identify the native Android code responsible for BrowserNotifications.pushReportCommentNotification. This function is called by showCommentNotification when a new report comment notification needs to be displayed:
Within this native Android implementation, before displaying the notification, add logic to interact with the Android ShortcutManager.
When BrowserNotifications.pushReportCommentNotification is invoked, construct a ShortcutInfo object for the incoming report. This object should include:
A unique ID (e.g., derived from the reportID).
A short label (e.g., the sender's display name or report name).
A long label (e.g., the message content).
An Intent that, when activated, will open the Expensify app directly to the specific report associated with the notification.
Use ShortcutManager.setDynamicShortcuts() or ShortcutManager.addDynamicShortcuts() to publish this ShortcutInfo to the Android system. This will make the notification available as a dynamic shortcut on the app icon long-press menu.
Implement logic to update or remove these dynamic shortcuts when the corresponding notification is dismissed, read, or becomes irrelevant, to ensure the long-press menu remains accurate and up-to-date.
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
This issue involves changes to our internal Mobile-Expensify repo, so I'm bringing in an Expert Contributor to take over. Thank you all for your contributions
Activity
MelvinBot commentedon Jul 17, 2026
Proposal
What is the root cause of that problem?
The Android conversation shortcut is created natively while the push notification is being built, not from JS. When a DM push arrives, Airship invokes
CustomNotificationProvider.applyMessageStyle(), which callsShortcutManagerUtils.addDynamicShortcut()→ShortcutManagerCompat.pushDynamicShortcut(), then links the notification to it withbuilder.setShortcutId(accountID). All the ingredients Android needs (long-lived shortcut +Person+MessagingStyle+ matchingshortcutId) are present, so the recipe itself is correct.The most likely cause of the regression is that the app now targets Android 16 (
targetSdkVersion = 36,android/build.gradle:6-7), and the shortcut is pushed from a background push-processing context. Newer Android versions rate-limit / restrictpushDynamicShortcutwhen the app is not in the foreground, so the call can be silently dropped or throw. Critically, any failure is swallowed —addDynamicShortcuthas no error handling, and the outer block only doese.printStackTrace(). A throw at line 236 aborts beforesetStyle/setShortcutIdat 267-268, producing exactly the reported symptom: the notification still shows, but no shortcut appears on long-press.What changes do you think we should make in order to solve the problem?
addDynamicShortcut/pushDynamicShortcutso the failure is no longer silent — this is the fastest way to confirm the mechanism in production logs (Firebase/Sentry) instead of guessing.ShortcutManagerCompat.isRateLimitingActive()before pushing, and if the OS blocks background publishing on API 36, re-publish the shortcut from a foreground-eligible path (e.g. when the app next enters the foreground, or via the existingShortcutManagerJS module) rather than only during headless push processing.What alternative solutions did you explore? (Optional)
Alternatives & things to rule out
deregister()callsremoveAllDynamicShortcuts(). If register/deregister fires around notification receipt on Android 16, a freshly created shortcut could be wiped. Worth confirming it isn't firing unexpectedly.new-expensify://r/<reportID>with no explicit package; verify Android 16 doesn't reject a shortcut whose intent scheme isn't resolvable in the effective manifest.Verification (needed to confirm root cause): On an Android 16 device running 9.4.36-0, reproduce the flow and capture
adb logcat(tagNotificationProvider, plus anyShortcutManagerrate-limit warnings) andadb shell dumpsys shortcutto see whether the shortcut was published, rate-limited, or rejected.Related issues
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/96377)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
MobileMage commentedon Jul 17, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-07-17 10:09:46 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Android (HybridApp), receiving a chat message push while the app is backgrounded no longer publishes a conversation shortcut, so long-pressing the app icon shows no notification shortcut. This is a regression of TC 430593, which passed after the shortcut support was ported to the HybridApp in September 2025 (#66703, Mobile-Expensify PRs #13653/#13679). The notification itself still arrives — only the dynamic shortcut (and conversation styling) is gone.
What is the root cause of that problem?
The shipping Android binary is the HybridApp built from
Mobile-Expensify/Android(see.github/workflows/buildAndroid.yml), whereExpensifyNotificationProviderapplies the MessagingStyle and publishes the shortcut viaPushNotificationManager.addMessageShortcut(...)→ShortcutManagerCompat.pushDynamicShortcut(...). Since the Airship 26.5.0 upgrade (App PR #92497 plus its companion Mobile-Expensify PR #13960, merged 2026-06-08), the only way this custom provider gets installed is the new plugin-extender mechanism: the plugin removed the legacycom.urbanairship.reactnative.AIRSHIP_EXTENDERhook, and the framework proxy'sBaseAutopilotnow discovers the extender by reading thecom.urbanairship.plugin.extendermanifest meta-data and instantiating that class reflectively viaClass.forName(...). The standalone app uses the identical pattern — a manifest string pointing at a tiny class whose only job ispushManager.setNotificationProvider(...):App/android/app/src/main/AndroidManifest.xml
Lines 176 to 178 in c0a4080
I decompiled the current production HybridApp APK (9.4.33-8, the build the issue reproduces on in production). The manifest correctly declares
com.urbanairship.plugin.extender→org.me.mobiexpensifyg.CustomAirshipExtender, but that class does not exist anywhere in the DEX, and neither doesExpensifyNotificationProvider. The ported shortcut publisherPushNotificationManager.addMessageShortcutis still compiled in (it survives becausePushNotificationManageris kept for the YAPL JS bridge) but has zero call sites in the entire APK — it is dead code. R8 even proved the consequence at build time: in the shipped proxy bytecode,ExtenderProvider.get()was rewritten to unconditionally return null because noAirshipPluginExtenderimplementor exists in the program:The cause is R8 shrinking, which is enabled for HybridApp release builds (CI collects
outputs/mapping/*/mapping.txt; class names are unobfuscated, so it runs shrink-only). The extender class is referenced solely by the manifest meta-data string — a reference neither R8 nor aapt2's generated keep rules treat as a root (aapt2 only keeps manifest components like activities/services, notmeta-datavalues) — and there is no-keeprule for it, so R8 stripped it, takingExpensifyNotificationProviderwith it as unreachable. At runtimeClass.forNamethrowsClassNotFoundException, the proxy swallows it (logcat shows "Unable to create extender: org.me.mobiexpensifyg.CustomAirshipExtender"), and pushes are built by the stockReactNotificationProvider: plain BigText notification, nosetShortcutId, andpushDynamicShortcutis never called — exactly the reported symptom, with conversation styling/avatars silently lost too. This slipped through because debug builds don't minify (PR testing passed) and PR #92497's QA steps only verified that a notification arrives and opens the right report, which the stock provider still satisfies.What changes do you think we should make in order to solve the problem?
Add an R8 keep rule for the Airship plugin extender to the Mobile-Expensify Android release build (companion PR, same as the #66703 fix precedent), and the same rule to the standalone app's
android/app/proguard-rules.pro, which has the identical latent defect —com.expensify.chat.customairshipextender.CustomAirshipExtenderis also referenced only from the manifest string andenableProguardInReleaseBuildsis true. Keying the rule on the interface makes it survive future class renames:This is safe and minimal: it only pins one tiny class per app (plus its no-arg constructor, which the proxy invokes via
getDeclaredConstructor()), and once the implementor is kept, R8 no longer const-propagates the null throughExtenderProvider.get(), so the extender loads andExpensifyNotificationProvideris registered again — restoring the shortcut publish,setShortcutId, and MessagingStyle in one shot. No keep rule is needed for the provider itself since the kept extender references it directly. The fix is verifiable end-to-end on a release/staging build: logcat no longer shows "Unable to create extender", and after a background DM push,adb shell dumpsys shortcutlists the sender's dynamic shortcut (categorymsg), which then appears in the launcher long-press menu:App/android/app/src/main/java/com/expensify/chat/customairshipextender/CustomAirshipExtender.java
Lines 11 to 15 in c0a4080
What alternative solutions did you explore? (Optional)
I considered registering the provider directly in code from OldDot's Airship bootstrap (a direct constructor reference R8 can trace, removing the reflection fragility entirely), but rejected it as the primary fix because the proxy's
BaseAutopilot.onAirshipReadydeliberately installs its ownReactNotificationProviderbefore invoking extenders — the extender hook exists precisely to guarantee our provider is set last, and a direct registration elsewhere risks being clobbered by that ordering. I also ruled out Android 16 shortcut rate-limiting as the cause:pushDynamicShortcutis exempt from background rate limits by design, and the decompiled production APK proves the publish code is unreachable, so no runtime throttling theory is needed.aswin-s commentedon Jul 17, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Android, when a user receives a DM and then long-presses the app icon on the launcher, no conversation shortcut appears. The notification renders correctly but the entry is absent from the launcher shortcut menu. Reproduced on Pixel 7 Pro / Android 16 (v9.4.36-0).
What is the root cause of that problem?
Primary cause (blocker): wrong shortcut category constant
android/app/src/main/java/com/expensify/chat/shortcutManagerModule/ShortcutManagerUtils.javaline 3 imports:This constant resolves to the string
"msg"— a notification category used to signal urgency to the system. It is then passed directly into the shortcut's category set (line 29):Android's launcher long-press menu only surfaces shortcuts whose category set contains
ShortcutInfo.SHORTCUT_CATEGORY_CONVERSATION("android.shortcut.conversation"). A shortcut categorised as"msg"is treated as a generic shortcut and is never allocated a conversation slot in the launcher, regardless of whetherMessagingStyle,setShortcutId, orsetLongLivedare correctly configured. This is the definitive reason the shortcut never appears.Secondary gaps (good-practice, won't unblock launcher on their own)
The
ShortcutInfoCompatinaddDynamicShortcutdoes not call.setLocusId(new LocusIdCompat(accountID)), andbuilderinapplyMessageStyle(line 268) does not callbuilder.setLocusId(new LocusIdCompat(accountID)). A matchingLocusIdpair lets Android correlate the app surface, the shortcut, and the notification into one conversation entity and is required for full Android 12+ conversation-notification ranking. Separately,ShortcutManagerCompat.reportShortcutUsedis never called afterpushDynamicShortcut, which suppresses recency-based launcher ranking.What changes do you think we should make in order to solve the problem?
Fix 1 — correct the shortcut category (root cause, required)
In
android/app/src/main/java/com/expensify/chat/shortcutManagerModule/ShortcutManagerUtils.java:import static androidx.core.app.NotificationCompat.CATEGORY_MESSAGE;import android.content.pm.ShortcutInfo;Note:
NotificationCompat.CATEGORY_MESSAGEshould still be imported inCustomNotificationProvider.javaforbuilder.setCategory(CATEGORY_MESSAGE)at line 110 — that usage is correct and must not be changed.Fix 2 — add matching LocusId pair (secondary, Android 12+ conversation ranking)
In
ShortcutManagerUtils.addDynamicShortcut, add to theShortcutInfoCompat.Builderchain:Requires
import androidx.core.content.LocusIdCompat;.In
CustomNotificationProvider.applyMessageStyle, alongside the existingbuilder.setShortcutId(accountID)(line 268), add:Fix 3 — report shortcut usage (secondary, recency ranking)
After
ShortcutManagerCompat.pushDynamicShortcut(context, shortcutInfo)inShortcutManagerUtils.addDynamicShortcut, add:Verification
ShortcutManagerModule.removeAllDynamicShortcuts— confirm the shortcut is cleared.LocusIdCompatandShortcutManagerCompat.reportShortcutUsedare no-ops below Android R via the Compat shims.What alternative solutions did you explore?
setLocusId/reportShortcutUsed(the approach in the first-pass proposal): these are improvements but do not fix the root problem. A shortcut with the wrong category still never appears in the launcher's conversation slot regardless ofLocusIdpairing or usage reporting.setLongLived: not viable —setLongLived(true)is required so the shortcut outlives the notification's lifetime; removing it would cause the shortcut to be garbage-collected when the notification is dismissed.ahmdshrif commentedon Jul 17, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Android, long-pressing the app icon does not show the expected conversation/notification shortcuts (the recent-chat shortcuts that should appear in the launcher pop-up menu).
What is the root cause of that problem?
The only code path that ever publishes a launcher shortcut is
ShortcutManagerUtils.addDynamicShortcut(...), and it is invoked from exactly one place —CustomNotificationProvider.applyMessageStyle(...)when a message push notification is received:App/android/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java
Lines 231 to 236 in cdef22d
Inside the builder, the icon is set unconditionally with
IconCompat.createWithBitmap(personIcon):App/android/app/src/main/java/com/expensify/chat/shortcutManagerModule/ShortcutManagerUtils.java
Lines 22 to 36 in cdef22d
personIconcomes fromfetchIcon(), which returnsnullwhen the avatar URL is null/malformed or the fetch fails.IconCompat.createWithBitmap(null)throws, sopushDynamicShortcutnever runs and no shortcut is registered — the long-press menu stays empty. Additionally, shortcuts are wiped on deregister/logout (ShortcutManager.removeAllDynamicShortcuts()) and are never re-published proactively, so until a fresh push with a valid avatar arrives the launcher shows nothing.What changes do you think we should make in order to solve the problem?
Guard the icon in
addDynamicShortcutso a null bitmap doesn't abort publication, falling back to a static app icon:This ensures
pushDynamicShortcutalways succeeds so the shortcut appears on long-press even when the avatar can't be loaded. Regression check: verify shortcuts still appear with a valid avatar and that the fallback icon shows when the avatar is missing.David-2002065 commentedon Jul 17, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-07-17 10:09:01 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Android, after receiving a DM push notification while the app is backgrounded/killed, long‑pressing the app icon does not show the sender as a conversation shortcut. The notification itself is posted, but no launcher shortcut for it appears.
What is the root cause of that problem?
The launcher shortcut is a conversation shortcut that Android only surfaces if we actually publish a long‑lived dynamic shortcut (
ShortcutManagerCompat.pushDynamicShortcut) and tag the notification with a matchingsetShortcutId. We do publish it — but only from insideapplyMessageStyle, and the publish call sits after we turn the fetched avatar into anIconCompat, all wrapped in atry/catchthat silently falls back to a plain notification.The shortcut is published here, right after building the avatar icon:
App/android/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java
Lines 231 to 236 in c0a4080
fetchIconreturnsnullwhenever the avatar can't be downloaded within its 8s window — which is exactly what tends to happen when the push is handled by a cold background process (the repro literally starts with "Leave the app" before the DM arrives):App/android/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java
Lines 359 to 370 in c0a4080
When
personIconisnull,IconCompat.createWithBitmap(personIcon)at L234 throws beforeShortcutManagerUtils.addDynamicShortcut(...)at L236 ever runs, and the exception is swallowed by the surrounding catch:App/android/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java
Lines 280 to 282 in c0a4080
So the base notification still posts, but no dynamic/conversation shortcut is published — hence nothing shows in the app‑icon long‑press menu.
addDynamicShortcutcompounds this by making the bitmap mandatory too (setIcon(IconCompat.createWithBitmap(personIcon))):App/android/app/src/main/java/com/expensify/chat/shortcutManagerModule/ShortcutManagerUtils.java
Lines 22 to 36 in c0a4080
What changes do you think we should make in order to solve the problem?
Stop letting a missing avatar abort shortcut publication. Build the
Person/shortcut with a fallback icon whenfetchIconreturnsnull, so the shortcut is always pushed:And make the icon optional inside
addDynamicShortcutso a null bitmap can't stoppushDynamicShortcut:With these two changes the conversation shortcut is published on every report‑comment push, independent of whether the avatar resolves, so it reliably shows in the launcher long‑press menu.
What specific scenarios should we cover in automated tests to prevent this problem from happening again?
onExtendBuilder/applyMessageStylefor a report‑comment payload whose avatar URL is unreachable/slow (sofetchIconreturnsnull), then assertsShortcutManagerCompat.getDynamicShortcuts(context)contains a shortcut whose id equalsaccountID, and that the posted notification'sshortcutIdmatches it.shortcutId.What alternative solutions did you explore? (Optional)
Publish the shortcut first (before any avatar/messaging‑style work) and update its icon asynchronously once
fetchIconcompletes — this guarantees the shortcut exists immediately, but it splits the shortcut into two writes and adds ordering complexity for little gain over the fallback‑icon approach above. I also considered skipping the network avatar fetch on the notification thread entirely and always using a generated initials avatar, but that would regress the avatars currently shown in the notification shade.mukhrr commentedon Jul 17, 2026
Proposal
What is the root cause of that problem?
I found that creating the conversation shortcut depends on successfully downloading the sender’s avatar.
fetchIcon()returnsnullfor a missing/malformed URL, a timeout, or any download error.App/android/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java
Lines 337 to 370 in cdef22d
However,
applyMessageStyle()passes that nullable bitmap unconditionally toIconCompat.createWithBitmap()before callingaddDynamicShortcut(). When the bitmap is unavailable, this throws and the shortcut is never published.App/android/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java
Lines 230 to 240 in cdef22d
The outer handler catches this failure and returns Airship’s default notification builder, which explains why the message notification itself appears while its launcher shortcut is missing.
App/android/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java
Lines 123 to 151 in cdef22d
The shortcut implementation was introduced without nullable-avatar handling, and the recent Airship upgrade only adapted the avatar-loading API, preserving this failure path.
4a28d61
What changes do you think we should make in order to solve the problem?
I think we should make the avatar optional in
applyMessageStyle()andShortcutManagerUtils.addDynamicShortcut(). We should always construct and publish the shortcut, but only add bitmap icons to thePerson, notification, and shortcut whenfetchIcon()returns a bitmap.For example, the shortcut construction would change along these lines:
The same conditional handling should be used when creating the
Personand setting the notification’s large icon. The remaining shortcut metadata—label, deep-link intent, message category, long-lived status, and person—already contains everything needed to publish and open the conversation.App/android/app/src/main/java/com/expensify/chat/shortcutManagerModule/ShortcutManagerUtils.java
Lines 22 to 35 in cdef22d
This does not change successful avatar downloads or existing shortcut navigation. It only allows the existing fallback path to publish a shortcut without a custom avatar instead of aborting the entire conversation-style setup. I would test both a valid avatar and a missing/failed avatar, confirm the message remains visible, long-press the launcher icon to verify the shortcut appears, and verify that tapping it opens the correct report.
What alternative solutions did you explore? (Optional)
We could use a bundled default bitmap whenever the avatar download fails. However, making the icon optional is smaller and avoids manufacturing or maintaining another avatar asset; Android can render the shortcut using its remaining person and label metadata.
samranahm commentedon Jul 17, 2026
Proposal
What is the root cause of that problem?
When a new comment notification is received, the
showCommentNotificationfunction inLocalNotification/index.tsis responsible for triggering its display:App/src/libs/Notification/LocalNotification/index.ts
Lines 34 to 36 in cdef22d
This function delegates to
BrowserNotifications.pushReportCommentNotification. On Android, for a notification to appear as a dynamic shortcut when the app icon is long-pressed, the application must explicitly publish aShortcutInfoobject using the AndroidShortcutManagerAPI. The current Android-specific implementation ofBrowserNotifications.pushReportCommentNotificationdoes not include the necessary calls to theShortcutManagerto create and update these dynamic shortcuts. Consequently, while the notification itself is displayed, it is not registered with the system as a shortcut, leading to its absence from the long-press menu.What changes do you think we should make in order to solve the problem?
BrowserNotifications.pushReportCommentNotification. This function is called byshowCommentNotificationwhen a new report comment notification needs to be displayed:App/src/libs/Notification/LocalNotification/index.ts
Lines 34 to 36 in cdef22d
Within this native Android implementation, before displaying the notification, add logic to interact with the Android
ShortcutManager.BrowserNotifications.pushReportCommentNotificationis invoked, construct aShortcutInfoobject for the incoming report. This object should include:reportID).Intentthat, when activated, will open the Expensify app directly to the specific report associated with the notification.ShortcutManager.setDynamicShortcuts()orShortcutManager.addDynamicShortcuts()to publish thisShortcutInfoto the Android system. This will make the notification available as a dynamic shortcut on the app icon long-press menu.What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
aswin-s commentedon Jul 17, 2026
Proposal
Updated
melvin-bot commentedon Jul 17, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @cretadn22 (
External)16 remaining items
melvin-bot commentedon Jul 20, 2026
@cretadn22 Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Jul 22, 2026
@cretadn22 Eep! 4 days overdue now. Issues have feelings too...
melvin-bot commentedon Jul 24, 2026
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
melvin-bot commentedon Jul 24, 2026
@cretadn22 Still overdue 6 days?! Let's take care of this!
cretadn22 commentedon Jul 25, 2026
This issue involves changes to our internal Mobile-Expensify repo, so I'm bringing in an Expert Contributor to take over. Thank you all for your contributions
Julesssss commentedon Jul 28, 2026
Being handled internally
arosiclair commentedon Jul 30, 2026
Fixed in v9.4.46-5