You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actual: after step3, I see the message "Safari can not open the page because the address is invalid" before the Twake app is opened
Expect: after step3, the message is not shown
Still see the dialog "Safari cannot open the page because the address is invalid." when returning to the browser, the issue is likely related to how iOS handles opening URIs.
Possible Causes:
After opening app, Safari doesn't receive a proper response from the OAuth webpage.
The OAuth page remains open in the background and does not close itself.
Safari expects a valid web URL after redirection, but instead, it tries to open a deep link (twakemail.mobile://), which is not a standard web page.
Solution
Automatically close the OAuth webpage after redirection
Add this JavaScript snippet to your OAuth webpage (the page that redirects to your app):
<script>setTimeout(function(){window.close();// Close the page after 500ms},500);</script>
=> The OAuth webpage will automatically close after it opens app. Safari will no longer display an invalid address error.
Redirect to a "Success" page before closing
Instead of directly opening the deep link (twakemail.mobile://openapp?...), redirect the user to an intermediate success page before closing:
<p>Login successful! You can close this page.</p><script>setTimeout(function(){window.location.href="twakemail.mobile://openapp?access_token=your_token";setTimeout(()=>window.close(),1000);// Close after opening the app},500);</script>
=> Gives Safari a valid web page to load before switching to app. Avoids the "invalid address" error.
Device: iphone11
Twake app: vesion 0.14.2, browser: safari
environment: stg.lin-saas.com
Precondition: Twake app is installed
Steps:
Actual: after step3, I see the message "Safari can not open the page because the address is invalid" before the Twake app is opened
Expect: after step3, the message is not shown
OpenMailFromSuccessPage.mp4
@tprudentova @hoangdat
The text was updated successfully, but these errors were encountered: