NativeScript / NativeScript/firebase

[firebase-messaging] Missing 'foreground' property in onMessage callback on Android

Open
#182 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

android enhancement
Dominant language
TypeScript
Stars
62
Forks
53
Avg merge
8d 4h
Merged PRs (30d)
2

Description

In many instances it is desirable to handle notifications differently depending on if the message was received while the app is in the foreground vs when it is in the background. There is currently no way to determine this right now.

The old Firebase plugin by Eddy had a 'foreground' boolean property to accomplish this. Then in the 'onMessage' callback you could decide how to handle it.

https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/master/docs/MESSAGING.md

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the current Android onMessage callback behavior with the linked Eddy Firebase messaging documentation, then trace where the callback payload is assembled. Done means the callback exposes a foreground boolean that distinguishes foreground and background message delivery, with behavior consistent with the documented example.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, firebase, typescript
Domain
mobile
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.