Matthew Ferry asked 2017-10-17 05:58:50 UTC
Hi - I've downloaded and had a look at the deep linking example, and am trying to adapt the idea to what I need to do.
I need users to be able to pass around links via email, and when the use clicks on the link in the email - it opens the app, user logs in if needed, and then it navigates to the context represented by the # tag that I build into the link. So for example - they might pass a link via email that says - look at this customer's sales report and the link is something like "http://appSite.com/#csr=493 where the app would understand that csr means the customer sales report, and the customer id would be 493.
In my code when the hash changes - I respond to the Application_HashChanged event, and I put the hash into the session. The app then presents the login form as normal and the user logs in; after successful login I then check the session to see if there is a hash saved - and if so - I navigate to the correct context within the app.
All of the above is working great.
However the problem comes when the user already has a browser open and is already logged in. What my code tries to do if the user is already logged in is simply do the navigation to the correct context. However - of course - since the user clicked a link outside of the browser - the browser wants to open a new tab. I'd love it if the app could simply use the browser tab that is already open - but as far as I know that is not possible due to the way browsers work. So I'd be happy if the app opened in a new tab, and navigated to the correct context and presented it normally. This part doesn't work right - a new tab opens - and the context, which includes a modal form (.ShowDialog) starts to try to show up - but its not properly in sync w/ the rest of the app. It displays (including some real data) - but has lost the context of the ui that should be beneath the modal form, and there is a spinner that keeps spinning forever - and strangely it does not use the app's theme - it uses the default theme. And I can't use the normal buttons to close the modal form - I have to close the whole browser tab. Its like the modal form is dead in the water - waiting for a sync w/ the UI context that will never come.
I believe this is because the action of showing the new modal form is being sent to the new tab - while the rest of the app's context is in the old tab - or something like that. Because it is the exact same code that navigates to the context after login (when the user doesn't have the app open already) - which works - but when the app is already open - it fails as described.
Any idea what may be going on or what I'm doing wrong? Or any advice how I can handle this? Do I need to recreate the whole UI again in the context of the new tab?
Thanks in advance for your help.
Matthew
Matthew Ferry asked 2017-10-17 05:58:50 UTC
Hi - I've downloaded and had a look at the deep linking example, and am trying to adapt the idea to what I need to do.
I need users to be able to pass around links via email, and when the use clicks on the link in the email - it opens the app, user logs in if needed, and then it navigates to the context represented by the # tag that I build into the link. So for example - they might pass a link via email that says - look at this customer's sales report and the link is something like "http://appSite.com/#csr=493 where the app would understand that csr means the customer sales report, and the customer id would be 493.
In my code when the hash changes - I respond to the Application_HashChanged event, and I put the hash into the session. The app then presents the login form as normal and the user logs in; after successful login I then check the session to see if there is a hash saved - and if so - I navigate to the correct context within the app.
All of the above is working great.
However the problem comes when the user already has a browser open and is already logged in. What my code tries to do if the user is already logged in is simply do the navigation to the correct context. However - of course - since the user clicked a link outside of the browser - the browser wants to open a new tab. I'd love it if the app could simply use the browser tab that is already open - but as far as I know that is not possible due to the way browsers work. So I'd be happy if the app opened in a new tab, and navigated to the correct context and presented it normally. This part doesn't work right - a new tab opens - and the context, which includes a modal form (.ShowDialog) starts to try to show up - but its not properly in sync w/ the rest of the app. It displays (including some real data) - but has lost the context of the ui that should be beneath the modal form, and there is a spinner that keeps spinning forever - and strangely it does not use the app's theme - it uses the default theme. And I can't use the normal buttons to close the modal form - I have to close the whole browser tab. Its like the modal form is dead in the water - waiting for a sync w/ the UI context that will never come.
I believe this is because the action of showing the new modal form is being sent to the new tab - while the rest of the app's context is in the old tab - or something like that. Because it is the exact same code that navigates to the context after login (when the user doesn't have the app open already) - which works - but when the app is already open - it fails as described.
Any idea what may be going on or what I'm doing wrong? Or any advice how I can handle this? Do I need to recreate the whole UI again in the context of the new tab?
Thanks in advance for your help.
Matthew