Fix applicationDidEnterBackground not being called#48376
Fix applicationDidEnterBackground not being called#48376alextoudic wants to merge 1 commit intofacebook:mainfrom
Conversation
|
Hi @alextoudic! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
cipolleschi
left a comment
There was a problem hiding this comment.
Thanks for fixing this!
|
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
@cipolleschi merged this pull request in adaceba. |
|
This pull request was successfully merged by @alextoudic in adaceba When will my fix make it into a release? | How to file a pick request? |
Summary: #48376 removed `applicationDidEnterBackground` from `RCTAppDelegate` but RNTester called it, leads to crash. cc cipolleschi can you please help to review? ## Changelog: [INTERNAL] [FIXED] - RNTester: Fixes crash when app back to background Pull Request resolved: #48385 Test Plan: RNTester iOS back to background not crash. Reviewed By: cipolleschi Differential Revision: D67657449 Pulled By: philIip fbshipit-source-id: e6d806b2677050fa2faa273a7468055d9d21c2a3
Summary: I noticed that `AppDelegate` subscribers listening for `applicationDidEnterBackground` events in Expo projects (as documented [here](https://github.com/expo/expo/blob/238b6f57e459dd2c0b13ee158f0af709fe922460/docs/pages/modules/appdelegate-subscribers.mdx?plain=1#L56) aren't working as expected anymore. While investigating, I discovered that the events aren't reaching the `ExpoAppDelegate` implementation ([source](https://github.com/expo/expo/blob/71f2c55ff3f11e43ab43761bb5cece2e48eae0bf/packages/expo-modules-core/ios/AppDelegates/ExpoAppDelegate.swift#L61)) because the `RCTAppDelegate` implementation of `applicationDidEnterBackground` interrupts the event chain. This appears to be affecting some legitimate use cases. I believe we could improve this by removing the current implementation, but I'd love to hear your thoughts on this approach. I might be missing some context about why this implementation was originally needed, so any insights would be greatly appreciated! ## Changelog: <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [IOS] [FIXED] - Fix applicationDidEnterBackground not being called For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [IOS] [FIXED] - Fix applicationDidEnterBackground not being called Pull Request resolved: #48376 Test Plan: Ran a local test after change Reviewed By: javache Differential Revision: D67621557 Pulled By: cipolleschi fbshipit-source-id: 2d73711372deba867bd616c79ef4d00c79aa86d5
|
This pull request was successfully merged by @alextoudic in ecb9c58 When will my fix make it into a release? | How to file a pick request? |
Summary:
I noticed that
AppDelegatesubscribers listening forapplicationDidEnterBackgroundevents in Expo projects (as documented here aren't working as expected anymore.While investigating, I discovered that the events aren't reaching the
ExpoAppDelegateimplementation (source) because theRCTAppDelegateimplementation ofapplicationDidEnterBackgroundinterrupts the event chain. This appears to be affecting some legitimate use cases.I believe we could improve this by removing the current implementation, but I'd love to hear your thoughts on this approach. I might be missing some context about why this implementation was originally needed, so any insights would be greatly appreciated!
Changelog:
[IOS] [FIXED] - Fix applicationDidEnterBackground not being called
Test Plan:
Ran a local test after change