We have a couple mobile Retool apps for internal use with our team. One of these is a field service app - in here a user will select a location to look into. Inside a given location they can select a user to chat with at a given location. This click will write the user's cell number to localStorage and navigate to the Customer Texting app.
Upon getting to the Customer Texting app, there is a JS Query that runs on start that will check to see if there is localStorage (Set by a boolean value) and then navigate to the chat page with the cell number that was passed in by the localStorage. This works fine when navigating through the mobile app on the computer. When I use the Retool IOS app, this does not happen. I went with the localStorage route when navigating between apps because unlike the desktop version, the mobile doesn't seem to be able to use the hash.
I was wondering if there were known limitations with localStorage on the iPhone Retool app or if this is unusual. Any assistance in solving this issue would be greatly appreciated.
That should work! Can you share more about how you're writing to and reading from localStorage?
Thanks for the quick response!
After messing around with it a little more, it seems like it is working some of the time. The way it's set up is that inside the Field Service app there is a listCollection component that lists out users for a given location. There is a button on each of those users that says "Chat". Clicking that will write that users cell number to localStorage and then navigate to the Customer Texting app. When the Customer Texting app opens, a JS query called navToMessages runs and on completion navigates to getMessagesFromStorage page if there is localStorage values and runs a getMessagesFromStorage query which uses the local storage to pull up the conversation with the user selected.
I can't seem to find a pattern for this but it does seem to be working sometimes and then not so much others. I thought at first it might be an issue with press versus button press in the listCollection but there is no press action set up.
I still can't seem to find a pattern for this. It works about 50% of the time with no rhyme or reason to it. I tried changing the action from the listCollection component from button press to just press, but that didn't solve anything.
I realize I must not have hit reply to your original post, so please see above for the answer. My apologies.
Is it possible the localStorage write and the navigation action are racing with each other? Hard to tell exactly what's going on without more specifics on the app. Code examples, screenshots, maybe an app export etc.