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 lifecycle #660

Closed
wants to merge 6 commits into from
Closed

Fix iOS lifecycle #660

wants to merge 6 commits into from

Conversation

mapm14
Copy link
Contributor

@mapm14 mapm14 commented Jan 21, 2024

Fix iOS Lifecycle

Currently, the app's iOS lifecycle wasn't working as expected, when the app was going to the background the Appyx Nodes were not updating their lifecycle states as expected.

This PR solves the issue by making the iOS app to pass the app Lifecycle to the iOSNodeHost.

VEED.CREATE.Edit.mp4

Check list

  • I have updated CHANGELOG.md if required.
  • I have updated documentation if required.

@mapm14 mapm14 added enhancement New feature or request api-breaking labels Jan 21, 2024
@mapm14 mapm14 added this to the 2.0 milestone Jan 21, 2024
@mapm14 mapm14 self-assigned this Jan 21, 2024
# Conflicts:
#	CHANGELOG.md
@@ -18,6 +18,7 @@ Please refer to [2.0.0-alpha10 – Migration guide](2.0.0-alpha10.md)
- [#654](https://github.com/bumble-tech/appyx/pull/654) - Renamings
- [#657](https://github.com/bumble-tech/appyx/pull/657) - Rename ParentNode & Node to Node and LeafNode
- [#644](https://github.com/bumble-tech/appyx/pull/644) – Refactor AppyxComponent and application of draggable modifier
- [#660](https://github.com/bumble-tech/appyx/pull/660) - Make IosNodeHost to receive a Lifecycle class to fix iOS lifecycle problems
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's move this to pending changes, alpha10 is already released

@@ -17,6 +17,7 @@ Please refer to [2.0.0-alpha10 – Migration guide](2.0.0-alpha10.md)
- [#652](https://github.com/bumble-tech/appyx/pull/652) - KSP processor renamed from `mutable-ui-processor` to `appyx-processor`
- [#654](https://github.com/bumble-tech/appyx/pull/654) - Renamings
- [#657](https://github.com/bumble-tech/appyx/pull/657) - Rename ParentNode & Node to Node and LeafNode
- [#660](https://github.com/bumble-tech/appyx/pull/660) - Make IosNodeHost to receive a Lifecycle class to fix iOS lifecycle problems
Copy link
Contributor

Choose a reason for hiding this comment

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

Better to surround code related names with `

}
.onOpenURL { incomingURL in
Main_iosKt.handleDeepLinks(url: incomingURL)
}
.onChange(of: scenePhase) { newPhase in
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: fix indentation

Comment on lines +21 to 29
.onChange(of: scenePhase) { newPhase in
switch newPhase {
case .background: appDelegate.lifecycleHolder.lifecycleHelper.created()
case .inactive: appDelegate.lifecycleHolder.lifecycleHelper.created()
case .active: appDelegate.lifecycleHolder.lifecycleHelper.resumed()
@unknown default: break
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: fix indentation

@mapm14 mapm14 closed this Jan 26, 2024
@mapm14 mapm14 deleted the fix_ios_lifecycle branch January 26, 2024 13:37
@mapm14
Copy link
Contributor Author

mapm14 commented Jan 26, 2024

Fixed in #670

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants