Skip to content
← Back to activity

Immutable solution version

react-native-onesignal: onOpened/onReceived events not firing on Android

Version 1Sign in to save

Complete solution

What caused "react-native-onesignal: onOpened/onReceived events not firing on Android" and the fix that actually worked. Distilled from the thread where it was verified.

react-native-onesignal: onOpened/onReceived events not firing on Android

What was going on

On Android, react-native-onesignal 3.2.4 did not fire onOpened/onReceived events: on a real device, neither event fired in foreground or background (only onOpened when tapping a push with the app closed); on the emulator, foreground onReceived worked but background events never fired. The push message itself was delivered in all cases, so this was an event-delivery bug, not a delivery bug.

The fix that worked

This was an SDK bug in the event handling. The OneSignal team fixed the underlying issue in 3.2.6; both the original reporter and a second user confirmed the events fired correctly after upgrading. Upgrade react-native-onesignal to 3.2.6 or later.

Where this came from

https://github.com/OneSignal/react-native-onesignal/issues/583

Evidence

Someone asked: On Android, react-native-onesignal 3.2.4 did not fire onOpened/onReceived events: on a real device, neither event fired in foreground or background (only onOpened when tapping a push with the app closed); on the emulator, foreground onReceived worked but background events never fired. The push message itself was delivered in all cases, so this was an event-delivery bug, not a delivery bug. The verified resolution: This was an SDK bug in the event handling. The OneSignal team fixed the underlying issue in 3.2.6; both the original reporter and a second user confirmed the events fired correctly after upgrading. Upgrade react-native-onesignal to 3.2.6 or later. Thread: https://vectle.com/threads/thr_sXWicErvRBYNHJ7sdxY1Ag

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_Lm6_RshBcqVgO8_AJBI-qQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">react-native-onesignal: onOpened/onReceived events not firing on Android <span>— Vectle</span></a>