invertase / notifee

βš›οΈ A feature rich notifications library for React Native.
https://notifee.app
Apache License 2.0
1.86k stars 225 forks source link

New architecture support (status: v9.1.2 should work, headlessJS needs general upstream fix in react-native) #1077

Open elsa17z opened 3 months ago

elsa17z commented 3 months ago

Discussed in https://github.com/invertase/notifee/discussions/795

Originally posted by **ravindraguptacapgemini** June 13, 2023 Need to know if library support new architecture of React Native with Fabric and Turbo Module.

Currently this module will not work with react-native in new architecture mode, bridgeless or otherwise.

The first step is to get it working in bridgeless mode at minimum. These issues block that:

Update status here when complete: https://reactnative.directory/?search=%40notifee%2Freact-native

github-actions[bot] commented 2 months ago

Hello πŸ‘‹, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

elsa17z commented 2 months ago

Not stale

radko93 commented 2 months ago

Wonder if this library will work with compatibility layer.

blumk commented 1 month ago

@mikehardy React Native 0.76 will ship with the New Architecture enabled by default. This is potentially a breaking change. Has Notifee been migrated to support this change?

see RN 0.76 rc.0: https://github.com/facebook/react-native/releases/tag/v0.76.0-rc.0

https://reactnative.directory/?search=%40notifee%2Freact-native

image
mikehardy commented 1 month ago

I don't believe so, and I haven't had time to personally test it with the compatibility layer - apologies Happy to hear anyone with test results using the compatibility layer to see if it functions In my experience with other libraries (even really complex ones like react-native-firebase) - the changes required for it to work with the compatibility layer were pretty small

The repository is in a "tests working" + "releasable" condition as of now though, so if you check the CONTRIBUTING file I believe everything in there will work for testing any code changes if required

mikehardy commented 1 month ago

Just chatted with the ever-benevolent (I mean that!) overlords @ Invertase and I can check this repo for RN76 compat, so I'll have a go myself but I will always welcome information + help + advice from anyone else so please chime in if you are reading this and you're looking at it too. Hopefully it's easy!

github-actions[bot] commented 3 weeks ago

Hello πŸ‘‹, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

mikehardy commented 3 weeks ago

Not stale, thought I pinned this.

mikehardy commented 2 weeks ago

related issue #621 - android at least already has a known issue

mikehardy commented 2 weeks ago

Hey @brentvatne - sincere apologies for a random, direct ping - but how does one go about updating the react native module registry with information that a module works with new architecture? I just released v9.1.2 here which should support new architecture in bridgeless mode but don't know what to do here: https://reactnative.directory/?search=%40notifee%2Freact-native

Rexogamer commented 2 weeks ago

you'll want to edit the libraries file to add newArchitecture: true

mikehardy commented 2 weeks ago

Thank you @Rexogamer ! Really appreciate the pointer --> https://github.com/react-native-community/directory/pull/1329

mikehardy commented 1 week ago

This is supposed to be fixed in react-native 0.76.1, it needs a retest to see if background handling works again with new architecture. It may take me some time to get a suitable reproduction environment set up and I would welcome anyone to post success or failure on 0.76.1 if they are able to test this before I get to it.

netdown commented 1 week ago

I've just upgraded to 0.76.1 and foreground service does not work with new arch. It works while the app is opened, but gets stuck if I close it. No error messages, I haven't digged it up.

mikehardy commented 1 week ago

That's surprising! That's worse than I was hoping to hear πŸ˜† . I want to put a sad face or a thumbs-down reaction on your comment but it's the content, not for you as a messenger of course @netdown.

Were you able to test if headlessJS works? As that is a separate issue from foreground service

I'll add foreground service testing to the status list above.

netdown commented 1 week ago

I use foreground service only.

InSaine2k13 commented 3 days ago

Same issue @netdown my foreground service freezes completely on new architecture once the app is out of focus

lovegaoshi commented 21 hours ago

at RNTP which also uses headlessJsTaskService, I believe my issue has the same root to what you have. my patch seems to work when app is minimized and/or resumed, but now I'm noticing the Js code executed on event listening does not complete fetch requests. I'm opening an issue in the discussion group in case anyone is interested.

mikehardy commented 21 hours ago

@lovegaoshi definitely interested and I read through the related information from RNTP with great interest earlier, I appreciate the cross-posting an the work you've put in to making headlessJS work on Fabric so far! Hopefully we all get through this in once piece πŸ˜†