Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ios, messaging): register background handler task #4180

Merged
merged 2 commits into from
Aug 31, 2020

Conversation

davx1992
Copy link
Contributor

Description

This PR is needed to fix problem reported in this issue #4104 .
#4104 (comment)

Related issues

Fixes #4104

Release Summary

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • [x ] Yes
  • My change supports the following platforms;
    • Android
    • [ x] iOS
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • [x ] No

Test Plan

Nothing to add.

Think react-native-firebase is great? Please consider supporting the project with any of the below:

@vercel
Copy link

vercel bot commented Aug 31, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/invertase/react-native-firebase/j37xrco4o
✅ Preview: https://react-native-firebase-git-fork-davx1992-master.invertase.vercel.app

@CLAassistant
Copy link

CLAassistant commented Aug 31, 2020

CLA assistant check
All committers have signed the CLA.

@davx1992 davx1992 changed the title Minor fix to handle notifications in background state, now we are reg… fix: Minor fix to handle notifications in background state, now we are reg… Aug 31, 2020
@mikehardy mikehardy changed the title fix: Minor fix to handle notifications in background state, now we are reg… fix(ios, messaging): register background handler task Aug 31, 2020
Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making this PR @davx1992 !
What a tricky issue, this makes sense theoretically, and worst case I don't believe it can do any harm?

@Salakar this is good one - there is linked commentary but the essential idea is: dispatch_after won't run if app is live but in background, but starting up this background task thaws the queue. Solves the symptom of FCM events delayed and only pasting when backgrounded app goes foreground.

@mikehardy mikehardy added Workflow: Needs Second Review Waiting on a second review before merge Workflow: Pending Merge Waiting on CI or similar labels Aug 31, 2020
@Salakar
Copy link
Member

Salakar commented Aug 31, 2020

Saw this on the issue earlier and it was a 'doh' moment for me, we should have had this in originally but I completely forgot about it when rewriting messaging 🙈 so LGTM.

@mikehardy mikehardy merged commit cf706c6 into invertase:master Aug 31, 2020
@mikehardy mikehardy removed Workflow: Needs Second Review Waiting on a second review before merge Workflow: Pending Merge Waiting on CI or similar labels Aug 31, 2020
hmhm2292 pushed a commit to hmhm2292/react-native-firebase that referenced this pull request Jul 13, 2021
…nvertase#4180)

* Minor fix to handle notifications in background state, now we are registering background task

* Apply suggestions from code review

Co-authored-by: Mike Hardy <github@mikehardy.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iOS background handler not always triggered
4 participants