I have an Angular 9 app. I want to show some message when user open it on gmail in-app browser. I did't find a way difference between gmail in-app browser and Safari on iPhone. I've tried those approaches: detect ipad/iphone webview via javascript, check for indexeddb, Navigator.canShare() and they didn't help. navigator.userAgent are same on those browsers. Please help to find differences.
Asked
Active
Viewed 338 times
2 Answers
0
@maksym do you wish to differentiate the user sessions when your website is opened in the web driver of Gmail IOS app?
Walle
- 11
- 3
-
I have problem with sessions and I want to ask user to open it in regular browser. – Maksym Krugliachenko Oct 04 '20 at 15:34
0
On iPhone, the viewport height is slightly different (iPhone 8: 1445 in Safari, 1461 in Gmail).
If:
- user email domain is Gmail
- iOS mobile user agent match
- Gmail viewport size match (different per device)
- assume user is in Gmail app
- show interstitial page prompting user to click Safari link in bottom right, & also smaller sized link warning to 'Continue in Gmail app' if you want.
- Gmail viewport size match (different per device)
Note: This would not work for custom domains, or you would have to map them somehow.
baussman
- 55
- 5