I check if the previous page in nav stack is called “Page” if so I pop() to this page, if not I push this page.
Testing in browser is working well. Testing on Android / IOS, emulator / device with ionic build ios and ionic build android also working like a charm.
BUT when I ionic build ios --prod or ionic build android --prod the component “Page” is always pushed even if the previous page is also “Page”!
Or simply don’t rely on previous from browser app, just use push directly to the page, it’s way more reliable to my experience. Rethink your buttons to only call direct calls to a push page with simple functions. (I have already a 3 levels tabs nav with sub pages, and it works well, all showing top level back button if i want). (and i forgot all 3 tabs are child of home.ts).
No, I’m saying don’t do that. Each page should be independent of one another, or your design is imposssible to test. Figure out a way to have lifecycle events let pages take control of their own destiny.
So when i go to list of shops -> i choose a shop -> i go to the list of products (the list is on the same page) -> a choose a product -> i click on "see shop" I want to do a nav.pop() to return to the shop page, because if not (if i push again the page “shop”) it will create an infinite navigation… Can you please help me to handle this problem?