Native app maintain group through page refresh

So I’ve got a dozen groups (screens) in this native app I’m building now. Navigating by changing the custom state of the page (that all the groups are on) was easy enough to keep track of.

Then I discovered that I also have to scroll back to the top of the page every time I change the custom state, otherwise scrolling down is preserved and the user will start out halfway down the next screen.

Just now I discovered that if I refresh the page, like by accidentally scrolling up too far (on Android that triggers a page refresh) the app goes all the way back to the beginning. So I assume I have to track the user’s current group on the user’s database thing itself so I can put them back where they’re supposed to be if something refreshes.

So I’m looking at every screen navigation consisting of at least

  • scroll to top of page
  • record name of group on page’s custom state
  • record name of group on user (assuming this is probably slower so should be used as a backup)

Can anyone comment on this organization? Am I doing it right? This is looking like a huge pain for a “native” mobile app of any complexity.

3 Likes

I´m asking myself exactly the same question right now, since I set everything up on the same page, however using navigation-to-page instead of hide/show groups. You found the solution already?

1 Like