Skip to content

Launch notification is dropped when the app is cold-started from a notification tap #81

Description

@asheehan

When a notification is tapped while the app is killed, the payload never reaches the BEAM — Mob.Device.take_launch_notification/0 returns :none. Taps while the app is running or backgrounded work fine, which makes this easy to miss.

The cause is in both native stores: mob_set_launch_notification (android/jni/mob_nif.zig) and mob_set_launch_notification_json (ios/mob_nif.m) return early if their mutex doesn't exist yet. But the mutex is created in nif_load, and on a cold start MainActivity / the app delegate store the payload before the BEAM boots — so the cold-start store is always a no-op, on both platforms.

mob_set_opened_document right next door handles the same window correctly: it stores even before the mutex exists, with a comment explaining why that's safe (nothing reads the global until the take_ NIF, which can only run after nif_load).

Repro: force-stop an app that routes notification taps, send or schedule a notification, tap it from the tray — take_launch_notification returns :none.

Hit this wiring FCM push into a mob app. #77 has a fix (same pre-mutex pattern as opened_document, both platforms).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions