-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Set iOS AppState to inactive when app is launching #37690
Conversation
Hi @louiszawadzki! 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 [email protected]. Thanks! |
Base commit: 9c11b81 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @louiszawadzki, thanks for this addition.
It looks good to me, let me try and import it. There could be some work needed internally, if some other team was relying on the unknown
state... :/
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @louiszawadzki in 54a5ff9. When will my fix make it into a release? | Upcoming Releases |
* main: (135 commits) translation auto-update for i18n/twilight.config.json on master Interop: Introduce Bridge proxy Remove okhttp internal util usage (facebook#37843) Update debian to fix CI while updating Node (facebook#37841) fix: foreground ripple crash on api < 23 (facebook#37901) Re-add the top level LICENSE file (facebook#37916) Deploy 0.209.0 to xplat (facebook#37921) Re-enable direct debugging with JSC on iOS 16.4+ (facebook#37914) add emitObjectProp in parser primitives (facebook#37904) Make React-utils its own pod (facebook#37659) feat: allow custom assignment of rootView to rootViewController (facebook#37873) Switch xplat prettier config to hermes plugin (facebook#37915) Set iOS AppState to inactive when app is launching (facebook#37690) Use `fileExists` in replace_hermes script (facebook#37911) (docs): fix license url (facebook#37909) Revert D46719890: Re-enable direct debugging with JSC on iOS 16.4+ Re-enable direct debugging with JSC on iOS 16.4+ (facebook#37874) Fix component type references in xplat (facebook#37903) Remove usage of passthroughAnimatedPropExplicitValues in ScrollViewStickyHeader (facebook#37867) test runtime lifecycle callback (facebook#37897) ...
Summary:
When an iOS app launches, the current
AppStateStatus
that is returned is"unknown"
.However,
RCTSharedApplication().applicationState
returnsUIApplicationStateInactive
- which makes sense since the app is still showing its launch screen.I suggest to return
"inactive"
instead of"unknown"
, since it makes more sense and"unknown"
is not mentioned in the official documentation.I also edited the annotation for the
"inactive"
status type to make it more accurate.Changelog:
[IOS] [CHANGED] - Set initial AppState status to "inactive" instead of "unknown"
Test Plan:
I played a bit with the
rn-tester
app to display theAppStateExample
component. I did not manage to display its content, but I managed to render it and log from its render function.This is what I log in the
render
function:Here is the log I saw before the change:
and after the change: