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(messaging): initialize app props method to fix isHeadless property #4082

Merged
merged 12 commits into from
Aug 15, 2020

Conversation

russellwheatley
Copy link
Member

@russellwheatley russellwheatley commented Aug 13, 2020

WIP - I have not been able to test properly (outside of preliminary tests) because the FCM gods are not with me today, and my messages are being blocked to my device when my app is in a quit state. Will try again soon unless someone else has it all set up and would like to confirm.

Description

  • Created a initializeAppProps helper method. This ought to guarantee the isHeadless property is present in the properties passed to the component registered. i.e. registerComponent component. This is used when the app is in a quit state and receives a message via FCM for iOS. The setBackgroundMessageHandler is called and the app is also silently booted, this prop will allow the developer to return null based on isHeadless === true.

  • The bug is a result of the application booting before the isHeadless property is added to the appProperties for the RCTRootView instance.

Related issues

fixes #3983

Release Summary

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • 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
    • No

Test Plan


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

@mikehardy
Copy link
Collaborator

false negative on E2E in iOS this time (android ran clean!), I restarted it, will look at iOS next

@Salakar Salakar marked this pull request as ready for review August 15, 2020 14:16
@Salakar Salakar changed the title fix(messaging, iOS): initialise app props method to fix isHeadless property fix(messaging): initialize app props method to fix isHeadless property Aug 15, 2020
@Salakar Salakar merged commit 2bdebb1 into master Aug 15, 2020
@Salakar Salakar deleted the @russell/initialiseProps-isHeadless branch August 15, 2020 14:32
hmhm2292 pushed a commit to hmhm2292/react-native-firebase that referenced this pull request Jul 13, 2021
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.

isHeadless property not being populated while iOS is quit
3 participants